quwangxin 2 سال پیش
والد
کامیت
a0eb46b8c5

+ 10 - 6
src/views/produceOrder/components/createDialog.vue

@@ -46,7 +46,12 @@
           >
             <span slot="label" class="label-required">成型数量</span>
             <el-form-item prop="formingNum" required>
-              <el-input v-model="formData.formingNum"></el-input>
+              <el-input-number
+                v-model="formData.formingNum"
+                class="w100"
+                :max="formData.requiredFormingNum || 0"
+                :controls="false"
+              ></el-input-number>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item
@@ -89,7 +94,7 @@
     <apsPlanOrder ref="apsPlanOrderRef" />
     <equipmentDailog
       ref="equipmentDailogRef"
-      :produceVersionId="produceVersionId"
+      :produceVersionId="formData.produceVersionId"
     />
   </ele-modal>
 </template>
@@ -105,8 +110,8 @@
         visible: false,
         titleOpt: ['创建工单'],
         type: 0,
-        produceVersionId: '',
         formData: {
+          produceVersionId: '',
           productionPlanCode: '',
           deviceCode: '',
           deviceName: '',
@@ -142,12 +147,11 @@
           this.formData.model = res.model;
           this.formData.productNum = res.productNum;
           this.formData.requiredFormingNum = res.requiredFormingNum;
-
-          this.produceVersionId = res.produceVersionId;
+          this.formData.produceVersionId = res.produceVersionId;
         });
       },
       getEquip () {
-        if (!this.produceVersionId) {
+        if (!this.formData.produceVersionId) {
           return this.$message.error('请先选择计划');
         }
         this.$refs.equipmentDailogRef.openSingle(

+ 20 - 23
src/views/produceOrder/components/order-dailog.vue

@@ -7,7 +7,8 @@
   >
     <div class="search-box">
       生产工单号:
-      <el-input placeholder="请输入" v-model="orderCode"></el-input>
+      <el-input placeholder="请输入" v-model="orderCode" clearable></el-input>
+      <el-button type="primary" @click="reload">搜索</el-button>
     </div>
     <!-- 数据表格 -->
     <ele-pro-table
@@ -15,8 +16,6 @@
       :columns="columns"
       @done="handleDone"
       row-key="id"
-      :needPage="false"
-      :initLoad="false"
       :selection.sync="selectionList"
       :datasource="datasource"
       height="45vh"
@@ -44,19 +43,13 @@
     computed: {
       columns () {
         const list = [
-          {
-            type: 'selection',
-            width: 55,
-            align: 'center',
-            fixed: 'left',
-            reserveSelection: true
-          },
           {
             columnKey: 'index',
             label: '序号',
             type: 'index',
             width: 55,
             align: 'center',
+            fixed: 'left',
             showOverflowTooltip: true
           },
           {
@@ -146,14 +139,11 @@
             minWidth: 110
           },
           {
-            columnKey: 'action',
-            label: '操作',
-            width: 350,
+            type: 'selection',
+            width: 55,
             align: 'center',
-            resizable: false,
             fixed: 'right',
-            slot: 'action',
-            showOverflowTooltip: true
+            reserveSelection: true
           }
         ];
 
@@ -166,27 +156,34 @@
         this.visible = true;
       },
       handleDone ({ data }) {
-        if (this.memoList.length) {
+        if (this.memoList.length && data.length) {
           this.$nextTick(() => {
-            this.memoList.length &&
-              this.$refs.table.setSelectedRowKeys(
-                this.memoList.map((i) => i.id)
-              );
+            this.$refs.table.setSelectedRowKeys(this.memoList.map((i) => i.id));
           });
         }
       },
+      reload () {
+        this.$refs.table.reload();
+      },
       /* 表格数据源 */
       datasource ({ page, limit }) {
         return getPage({
           pageNum: page,
           size: limit,
-          code: this.orderCode
+          code: this.orderCode,
+          statusList: [5, 4, 7]
         });
       },
       confirm () {
         if (!this.selectionList?.length)
           return this.$message.error('请选择数据');
-        this.$emit('success', this.selectionList);
+
+        this.$emit('success', [
+          ...this.selectionList,
+          ...this.memoList.filter(
+            (item) => !this.selectionList.find((p) => p.id === item.id)
+          )
+        ]);
 
         this.cancel();
       },

+ 3 - 4
src/views/produceOrder/components/produceOrder-search.vue

@@ -125,7 +125,6 @@
 </template>
 
 <script>
-import { number } from 'echarts/core';
   export default {
     props: ['activeName', 'statusOpt', 'planType'],
     data () {
@@ -139,8 +138,7 @@ import { number } from 'echarts/core';
         brandNo: '',
         model: '',
         planType: '',
-        createTime: [],
-		status:''
+        createTime: []
       };
       return {
         // 表单数据
@@ -179,7 +177,8 @@ import { number } from 'echarts/core';
         }
         delete where.createTime;
 
-        where.statusList = where.status.split(',');
+        // where.status = where.status.split(',');
+
         this.$emit('search', where);
       },
       /*  重置 */

+ 10 - 5
src/views/produceOrder/index.vue

@@ -178,7 +178,8 @@
           {
             slot: 'code',
             label: '生产工单号',
-            align: 'center'
+            align: 'center',
+            minWidth: 110
           },
           {
             prop: 'productionPlanCode',
@@ -219,25 +220,29 @@
             prop: 'formingNum',
             label: '要求成型数量',
             align: 'center',
-            showOverflowTooltip: true
+            showOverflowTooltip: true,
+            minWidth: 110
           },
           {
             prop: 'formingWeight',
             label: '要求成型重量',
             align: 'center',
-            showOverflowTooltip: true
+            showOverflowTooltip: true,
+            minWidth: 110
           },
           {
             prop: 'formedNum',
             label: '已成型数量',
             align: 'center',
-            showOverflowTooltip: true
+            showOverflowTooltip: true,
+            minWidth: 110
           },
           {
             prop: 'formedWeight',
             label: '已成型重量',
             align: 'center',
-            showOverflowTooltip: true
+            showOverflowTooltip: true,
+            minWidth: 110
           },
           {
             prop: 'planStartTime',

+ 21 - 25
src/views/produceOrder/picking.vue

@@ -92,56 +92,61 @@
         orderColumns: [
           {
             label: '工单号',
-            prop: 'a'
+            prop: 'code'
           },
           {
             label: '产品编码',
-            prop: 'a'
+            prop: 'productCode'
           },
           {
             label: '产品名称',
-            prop: 'a'
+            prop: 'productName'
           },
           {
             label: '牌号',
-            prop: 'a'
+            prop: 'brandNo'
           },
           {
             label: '型号',
-            prop: 'a'
+            prop: 'model'
           },
           {
             label: '要求成型数量',
-            prop: 'a'
+            prop: 'formingNum'
           },
           {
             label: '要求成型重量',
-            prop: 'a'
+            prop: 'formingWeight'
           },
           {
             label: '未成型数量',
-            prop: 'a'
+            prop: 'a',
+            formatter: (row) => {
+              return row.formingNum - row.formedNum;
+            }
           },
           {
             label: '未成型重量',
-            prop: 'a'
+            prop: 'a',
+            formatter: (row) => {
+              return row.formingWeight - row.formedWeight;
+            }
           },
           {
             label: '计划开始时间',
-            prop: 'a'
+            prop: 'planStartTime'
           },
           {
             label: '实际开始时间',
-            prop: 'a'
+            prop: 'startTime'
           },
           {
             slot: 'action',
-            label: '操作',
-            prop: 'a'
+            label: '操作'
           }
         ],
-        orderList: [{}],
-        materialList: [{}],
+        orderList: [],
+        materialList: [],
         materialColumns: [
           {
             label: '序号',
@@ -202,16 +207,7 @@
         this.$refs.orderDailogRef.open(this.orderList.slice(0));
       },
       orderSuccess (list) {
-        const obj = {};
-
-        this.orderList = [...this.orderList, ...list].reduce((next, pre) => {
-          if (!obj[pre.id]) {
-            next.push(pre);
-            obj[pre.id] = true;
-          }
-
-          return next;
-        }, []);
+        this.orderList = list;
       },
       delMaterial (index) {
         this.$confirm('是否删除', '提示')