فهرست منبع

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-aps into dev

LAPTOP-16IUEB3P\Lenovo 2 سال پیش
والد
کامیت
018bbf24ed

+ 4 - 4
src/api/productionPlan/index.js

@@ -1,12 +1,12 @@
 import request from '@/utils/request';
 
 /**
- * 登录
+ * 列表
  */
-export async function login (data) {
-  const res = await request.get('/aps/productionplan/page', data);
+export async function getList (params) {
+  const res = await request.get('/aps/productionplan/page', { params });
   if (res.data.code == 0) {
-    return res.data;
+    return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }

+ 1 - 1
src/styles/transition/common.scss

@@ -1,5 +1,5 @@
 .w100 {
-  width: 100%;
+  width: 100% !important;
 }
 // 页头
 .ele-body {

+ 117 - 24
src/views/productionPlan/components/productionPlan-search.vue

@@ -14,33 +14,76 @@
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="产品编码:">
-          <el-input clearable v-model="where.code" placeholder="请输入" />
+          <el-input
+            clearable
+            v-model="where.productCode"
+            placeholder="请输入"
+          />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="牌号:" label-width="80px">
-          <el-input clearable v-model="where.code" placeholder="请输入" />
+          <el-input clearable v-model="where.brandNo" placeholder="请输入" />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="型号:" label-width="80px">
-          <el-input clearable v-model="where.code" placeholder="请输入" />
+          <el-input clearable v-model="where.model" placeholder="请输入" />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="计划类型:" label-width="80px">
-          <el-input clearable v-model="where.code" placeholder="请输入" />
+          <el-select
+            clearable
+            v-model="where.orderType"
+            placeholder="请选择"
+            class="w100"
+          >
+            <el-option
+              v-for="item in planType"
+              :label="item.label"
+              :value="item.value"
+              :key="item.value"
+            ></el-option>
+          </el-select>
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="计划状态:" label-width="80px">
-          <el-input clearable v-model="where.code" placeholder="请输入" />
+          <el-select
+            clearable
+            v-model="where.status"
+            placeholder="请选择"
+            class="w100"
+          >
+            <el-option
+              v-for="item in statusOpt[activeName]"
+              :label="item.label"
+              :value="item.value"
+              :key="item.value"
+            ></el-option>
+          </el-select>
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
-        <el-form-item label="交货日期:">
+      <el-col v-bind="styleResponsive ? { lg: 9, md: 12 } : { span: 9 }">
+        <el-form-item label-width="150px">
+          <template slot="label">
+            <el-select
+              v-model="deliveryVal"
+              @change="
+                () => {
+                  where.deliveryTime = [];
+                  where.formingTime = [];
+                }
+              "
+            >
+              <el-option label="预测交货日期" value="deliveryTime"></el-option>
+              <el-option label="实际交货日期" value="formingTime"></el-option>
+            </el-select>
+          </template>
           <el-date-picker
-            v-model="where.time"
+            class="w100"
+            v-model="where[deliveryVal]"
             type="daterange"
             range-separator="至"
             start-placeholder="开始日期"
@@ -51,10 +94,33 @@
           </el-date-picker>
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
-        <el-form-item label="发布日期:">
+      <el-col v-bind="styleResponsive ? { lg: 9, md: 12 } : { span: 9 }">
+        <el-form-item label="" label-width="150px">
+          <template slot="label">
+            <el-select
+              v-model="shapeVal"
+              @change="
+                () => {
+                  where.requiredFormingTime = [];
+                  where.planFormingTime = [];
+                  where.formingTime = [];
+                }
+              "
+            >
+              <el-option
+                label="要求成型日期"
+                value="requiredFormingTime"
+              ></el-option>
+              <el-option
+                label="预测成型日期"
+                value="planFormingTime"
+              ></el-option>
+              <!-- <el-option label="实际成型日期" value="formingTime"></el-option> -->
+            </el-select>
+          </template>
           <el-date-picker
-            v-model="where.time"
+            class="w100"
+            v-model="where[shapeVal]"
             type="daterange"
             range-separator="至"
             start-placeholder="开始日期"
@@ -65,22 +131,32 @@
           </el-date-picker>
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
+      <el-col v-bind="styleResponsive ? { lg: 9, md: 12 } : { span: 9 }">
+        <el-form-item label="工单发布时间:" label-width="150px">
+          <el-date-picker
+            class="w100"
+            v-model="where.releaseTime"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <div class="ele-form-actions">
           <el-button
             type="primary"
             icon="el-icon-search"
             class="ele-btn-icon"
             @click="search"
-            size="small"
           >
             查询
           </el-button>
-          <el-button
-            @click="reset"
-            icon="el-icon-refresh-left"
-            size="small"
-            type="primary"
+          <el-button @click="reset" icon="el-icon-refresh-left" type="primary"
             >重置</el-button
           >
         </div>
@@ -91,16 +167,27 @@
 
 <script>
   export default {
+    props: ['activeName', 'statusOpt', 'planType'],
     data () {
       // 默认表单数据
       const defaultWhere = {
-        staus: '',
         code: '',
-        time: [],
+        productCode: '',
+        status: '',
+        model: '',
+        brandNo: '',
+        orderType: '',
+        releaseTime: [],
+        deliveryTime: [],
+        formingTime: [],
+        requiredFormingTime: [],
+        planFormingTime: [],
         executeUserName: ''
       };
       return {
         // 表单数据
+        deliveryVal: 'deliveryTime',
+        shapeVal: 'requiredFormingTime',
         where: { ...defaultWhere },
         treeData: []
       };
@@ -111,15 +198,21 @@
         return this.$store.state.theme.styleResponsive;
       }
     },
+    watch: {
+      activeName () {
+        this.search();
+      }
+    },
     created () {},
     methods: {
       /* 搜索 */
       search () {
         const where = this.where;
-
-        if (where.time?.length) {
-          where.startTime = where.time[0];
-          where.endTime = where.time[1];
+        for (const key in where) {
+          if (Array.isArray(where[key])) {
+            where[`${key}End`] = where[key][1];
+            where[key] = where[key][0];
+          }
         }
 
         this.$emit('search', where);

+ 115 - 58
src/views/productionPlan/index.vue

@@ -1,7 +1,13 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-      <productionPlan-search @search="reload" ref="searchRef">
+      <productionPlan-search
+        @search="reload"
+        ref="searchRef"
+        :statusOpt="statusOpt"
+        :planType="planType"
+        :activeName="activeName"
+      >
       </productionPlan-search>
       <el-tabs v-model="activeName" type="card" @tab-click="handleTabChange">
         <el-tab-pane label="未发布" name="first"></el-tab-pane>
@@ -41,6 +47,7 @@
 </template>
 
 <script>
+  import { getList } from '@/api/productionPlan/index.js';
   import productionPlanSearch from './components/productionPlan-search.vue';
   export default {
     components: {
@@ -54,12 +61,74 @@
         loading: false,
         pageType: 'add',
         dialogTitle: '',
-        isBindPlan: false
+        isBindPlan: false,
+        statusOpt: {
+          first: [
+            { label: '所有状态', value: '1,2' },
+            { label: '待发布', value: '1' },
+            { label: '发布状态', value: '2' }
+          ],
+          second: [
+            { label: '所有状态', value: '0,3,4,5,6' },
+            { label: '待排产', value: '0' },
+            { label: '待生产', value: '3' },
+            { label: '生产中', value: '4' },
+            { label: '已完成', value: '5' },
+            { label: '已延期', value: '6' }
+          ]
+        },
+        planType: [
+          { label: '所有计划类型', value: '0,1' },
+          { label: '内销计划', value: '0' },
+          { label: '外销计划', value: '1' }
+        ]
       };
     },
     computed: {
       // 表格列配置
       columns () {
+        const opt = {
+          first: [
+            {
+              prop: 'deliveryTime',
+              label: '预测交货日期',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 110
+            }
+          ],
+          second: [
+            // {
+            //   prop: 'formingTime',
+            //   label: '实际成型日期',
+            //   align: 'center',
+            //   showOverflowTooltip: true,
+            //   minWidth: 110
+            // },
+            {
+              prop: 'releaseTime',
+              label: '工单发布日期',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 110
+            },
+            {
+              prop: 'deliveryTime',
+              label: '预测交货日期',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 110
+            },
+            {
+              prop: 'formingTime',
+              label: '实际交货日期',
+              align: 'center',
+              showOverflowTooltip: true,
+              minWidth: 110
+            }
+          ]
+        };
+
         return [
           {
             columnKey: 'index',
@@ -71,129 +140,119 @@
             fixed: 'left'
           },
           {
+            slot: 'code',
             prop: 'code',
+            action: 'code',
             label: '计划编号',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'planCode',
+            prop: 'productCode',
             label: '产品编号',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'planName',
+            prop: 'brandNo',
             label: '牌号',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'equiCode',
+            prop: 'model',
             label: '型号',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'equiName',
+            prop: 'productNum',
             label: '计划数量',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'executeUserName',
+            prop: 'productWeight',
             label: '计划重量',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'planFinishTime',
+            prop: 'requiredFormingNum',
             label: '要求成型数量',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
+          // {
+          //   prop: '',
+          //   label: '已成型数量',
+          //   align: 'center',
+          //   showOverflowTooltip: true,
+          //   minWidth: 110
+          // },
           {
-            prop: 'acceptTime',
-            label: '已成型数量',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'finishTime',
+            prop: 'requiredFormingTime',
             label: '要求成型日期',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'sj',
+            prop: 'planFormingTime',
             label: '预测成型日期',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
+          ...opt[this.activeName],
+
           {
-            prop: 'status',
-            label: '实际成型日期',
+            prop: 'orderType',
+            label: '计划类型',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 110
+            formatter: (row) => {
+              const obj = this.planType.find((i) => i.value == row.orderType);
+              return obj && obj.label;
+            }
           },
           {
-            prop: 'status',
-            label: '交货日期',
+            prop: 'createTime',
+            label: '创建时间',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'status',
-            label: '预测交货日期',
+            prop: 'planStatus',
+            label: '状态',
             align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            formatter: (row) => {
+              const obj = this.statusOpt[this.activeName].find(
+                (i) => i.value == row.orderType
+              );
+              return obj && obj.label;
+            }
           },
           ...(this.activeName === 'second'
             ? [
                 {
-                  prop: 'code',
-                  label: '实际交货日期',
+                  prop: 'releaseTime',
+                  label: '发布时间',
                   align: 'center',
                   showOverflowTooltip: true,
                   minWidth: 110
                 }
               ]
             : []),
-          {
-            prop: 'status',
-            label: '计划类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'status',
-            label: '创建时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'status',
-            label: '状态',
-            fixed: this.activeName === 'second' ? 'right' : false,
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
           ...(this.activeName === 'first'
             ? [
                 {
@@ -213,14 +272,12 @@
     },
     methods: {
       /* 表格数据源 */
-      datasource ({ page, limit, where, order }) {
-        return [{}];
-        // return getWorkOrderList({
-        //   pageNum: page,
-        //   size: limit,
-        //   ...where,
-        //   type: 3
-        // });
+      datasource ({ page, limit, where }) {
+        return getList({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
       },
       // 发布工单
       handleOrderPublish (row) {

+ 2 - 1
vue.config.js

@@ -31,7 +31,8 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        target: 'http://192.168.3.35:8080', // kang杨威
+        // target: 'http://192.168.3.35:8080', // kang杨威
+        target: 'http://192.168.3.38:8080', // 陈潇
         // target: 'http://192.168.3.25:8080', // 黄峥嵘
         // target: 'http://192.168.3.41:8080', // 何江鹏
         // target: 'http://192.168.3.33:8080', // 谢一平