Răsfoiți Sursa

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

lucw 6 luni în urmă
părinte
comite
eb686c0e1e

+ 28 - 6
src/views/produce/components/outsourcing/batchChooseGoods.vue

@@ -15,11 +15,12 @@
       :datasource="allList"
       :selection.sync="selection"
       row-key="id"
-      height="calc(100vh - 550px)"
+      height="calc(100vh - 450px)"
       :cache-key="tableKey"
       :row-click-checked="true"
       :row-click-checked-intelligent="false"
       @update:selection="handleSelectionChange"
+      :pageSize="20"
     >
       <!-- <template v-slot:engrave="{ row, $index }">
         <el-input size="mini" v-model="row.engrave" @click.native.stop />
@@ -113,21 +114,37 @@
 
       open(item, allList, list, index) {
         this.visible = true;
+
         this.allSelection = list || [];
-        this.allList = allList.map((item) => item);
         this.index = index;
-
-        console.log(this.allList, 'this.allListthis.allList');
         this.itemData = item;
+
+        const mySelectedIds = new Set(this.allSelection.map((it) => it.id));
+
+        this.allList = allList.filter((it) => {
+          if (mySelectedIds.has(it.id)) return true;
+
+          return !it.selected;
+        });
+
         this.$nextTick(() => {
-          this.allSelection.forEach((item) => {
-            this.$refs.table.toggleRowSelection(item, true);
+          this.$refs.table.clearSelection();
+
+          this.allSelection.forEach((sel) => {
+            const row = this.allList.find((it) => it.id === sel.id);
+            if (row) {
+              this.$refs.table.toggleRowSelection(row, true);
+            }
           });
         });
       },
 
       handleSelectionChange(list) {
         this.allSelection = list;
+        // this.allSelection = list.map((item) => {
+        //   item.selected = true;
+        //   return item;
+        // });
       },
 
       selected() {
@@ -135,6 +152,11 @@
           return this.$message.warning('请至少选择一条数据');
         }
 
+        this.allSelection = this.allSelection.map((item) => {
+          item.selected = true;
+          return item;
+        });
+
         this.$emit('chooseData', this.allSelection, this.index);
         this.handleClose();
       }

+ 520 - 95
src/views/produce/components/outsourcing/new_outsourceList.vue

@@ -2,7 +2,7 @@
   <!-- 委外下一步 -->
   <div class="card">
     <div class="c_header_title">
-      <div class="c_title">委外记录</div>
+      <div class="c_title">委外请托</div>
     </div>
 
     <div class="card_box">
@@ -190,7 +190,7 @@
         </el-descriptions-item> -->
     <!-- </el-descriptions> -->
 
-    <el-tabs v-model="activeName">
+    <el-tabs v-model="activeName" v-if="timeList.length == 0">
       <el-tab-pane label="物品清单" name="0">
         <div class="materialList">
           <div class="u-reset">
@@ -521,6 +521,316 @@
       </el-tab-pane>
     </el-tabs>
 
+    <el-tabs v-model="activeBatch" v-else type="card">
+      <el-tab-pane
+        v-for="(it, index) in timeList"
+        :key="it.batchNo"
+        :label="it.batchNo"
+        :name="it.batchNo"
+      >
+        <!-- 内层 Tabs(物品/带料/产出) -->
+        <el-tabs v-model="it.innerActive" type="border-card">
+          <!-- 物品清单 -->
+          <el-tab-pane label="物品清单" name="0">
+            <div class="materialList">
+              <el-table
+                ref="pickOutRefs"
+                class="table_content"
+                :max-height="600"
+                :data="it.pickoutInList"
+                tooltip-effect="dark"
+                style="width: 100%; margin-top: 10px"
+                stripe
+                border
+                @selection-change="selectionPickOut"
+              >
+                <el-table-column
+                  align="center"
+                  type="selection"
+                  width="55"
+                  v-if="it.batchNo == '一次性到货'"
+                >
+                </el-table-column>
+                <el-table-column label="序号" type="index" width="55">
+                  <template slot-scope="{ row, $index }">
+                    {{ $index + 1 }}
+                  </template>
+                </el-table-column>
+
+                <el-table-column
+                  label="编码"
+                  type="code"
+                  minWidth="110"
+                  show-overflow-tooltip
+                >
+                  <template slot-scope="{ row, $index }">
+                    {{ row.categoryCode }}
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="名称"
+                  type="name"
+                  minWidth="110"
+                  show-overflow-tooltip
+                >
+                  <template slot-scope="{ row, $index }">
+                    {{ row.name }}
+                    <!-- ({{
+							row.rootCategoryLevelId == 2
+							? '在制品'
+							: row.rootCategoryLevelId == 23
+							? '半成品'
+							: row.rootCategoryLevelId == 9
+							? '产品'
+							: item.rootCategoryLevelId == 28
+							? '废品'
+							: ''
+						}}) -->
+                  </template>
+                </el-table-column>
+
+                <el-table-column
+                  label="型号"
+                  type="modelType"
+                  show-overflow-tooltip
+                >
+                  <template slot-scope="{ row, $index }">
+                    {{ row.modelType }}
+                  </template>
+                </el-table-column>
+
+                <el-table-column
+                  label="规格"
+                  type="specification"
+                  show-overflow-tooltip
+                >
+                  <template slot-scope="{ row, $index }">
+                    {{ row.specification }}
+                  </template>
+                </el-table-column>
+
+                <el-table-column
+                  label="牌号"
+                  type="brandNum"
+                  show-overflow-tooltip
+                >
+                  <template slot-scope="{ row, $index }">
+                    {{ row.brandNum }}
+                  </template>
+                </el-table-column>
+
+                <el-table-column
+                  label="数量"
+                  type="feedQuantity"
+                  show-overflow-tooltip
+                >
+                  <template slot-scope="{ row, $index }">
+                    <el-input
+                      v-model="row.feedQuantity"
+                      v-if="row.isSelection == '1'"
+                      @input="inputNum(row, $index)"
+                    ></el-input>
+                    <span v-else> {{ row.feedQuantity }}</span>
+                  </template>
+                  <!-- <template slot-scope="{ row, $index }" v-else>
+                {{ row.feedQuantity }}
+              </template> -->
+                </el-table-column>
+
+                <el-table-column
+                  label="重量"
+                  type="weightUnit"
+                  width="120"
+                  show-overflow-tooltip
+                >
+                  <template slot-scope="{ row, $index }">
+                    {{ row.newWeight || 0 }} {{ row.weightUnit }}
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="刻码"
+                  type="engrave"
+                  show-overflow-tooltip
+                >
+                  <template slot-scope="{ row, $index }">
+                    {{ row.extInfo.engrave }}
+                  </template>
+                </el-table-column>
+
+                <el-table-column
+                  label="物料代号"
+                  type="materielCode"
+                  show-overflow-tooltip
+                >
+                  <template slot-scope="{ row, $index }">
+                    {{ row.extInfo.materielCode }}
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="客户代号"
+                  type="clientCode"
+                  show-overflow-tooltip
+                >
+                  <template slot-scope="{ row, $index }">
+                    {{ row.extInfo.clientCode }}
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </el-tab-pane>
+
+          <el-tab-pane label="带料清单" name="1">
+            <div class="materialList">
+              <div v-for="(item, index) in it.bomMaterialList" :key="index">
+                <label class="listBox rx-bs">
+                  <div class="listBox-con">
+                    <div class="listBox-bottom rx">
+                      <div class="items">
+                        <span>序号</span>{{ index + 1 }}
+                      </div>
+                      <div class="items" :title="item.name">
+                        <span>名称</span>{{ item.name }}
+                      </div>
+
+                      <div class="items" :title="item.code">
+                        <span>编码</span>{{ item.code }}
+                      </div>
+
+                      <div
+                        v-for="(itm, index) in tableH(item.rootCategoryLevelId)"
+                        :key="index"
+                        class="items"
+                        v-if="!itm.formatter"
+                      >
+                        <span>{{ itm.label }}</span
+                        >{{ item[itm.prop] }}
+                      </div>
+
+                      <div
+                        class="items"
+                        v-if="item.isDemandQuantity && clientEnvironmentId != 2"
+                        style="width: 15%"
+                      >
+                        <span>数量</span
+                        >{{
+                          checkListLen == 0
+                            ? item.demandQuantity
+                            : item.count * (checkListLen || 1)
+                        }}
+                        {{ item.unit }}
+                      </div>
+                      <div
+                        class="items content_num"
+                        v-if="
+                          !item.isDemandQuantity && clientEnvironmentId != 2
+                        "
+                        style="width: 15%"
+                      >
+                        <span>数量</span>
+                        <!-- <input
+                          style="width: 90% !important"
+                          v-model="item.demandQuantity"
+                          disabled
+                        /> -->
+                        {{ item.demandQuantity }}
+                        {{ item.measuringUnit }}
+                      </div>
+
+                      <div
+                        class="items"
+                        v-if="item.isDemandQuantity && clientEnvironmentId == 2"
+                        style="width: 15%"
+                      >
+                        <span>数量</span
+                        >{{ item.count * (outObj.formedNumLast || 1) }}
+                      </div>
+                      <div
+                        class="items content_num"
+                        v-if="
+                          !item.isDemandQuantity && clientEnvironmentId == 2
+                        "
+                        style="width: 15%"
+                      >
+                        <span>数量</span>
+                        <!-- <input
+                          style="width: 90% !important"
+                          v-model="item.demandQuantity"
+                          disabled
+                        /> -->
+                        {{ item.demandQuantity }}
+                        {{ item.measuringUnit }}
+                      </div>
+                    </div>
+                  </div>
+                </label>
+              </div>
+            </div>
+          </el-tab-pane>
+
+          <el-tab-pane label="产出清单" name="2">
+            <div class="materialList">
+              <div class="u-reset"> </div>
+              <div v-for="(item, index) in it.standardOutputList" :key="index">
+                <label class="listBox rx-bs">
+                  <div class="listBox-con">
+                    <div class="listBox-bottom rx">
+                      <div class="items" style="width: 15%">
+                        <span>序号</span>{{ index + 1 }}
+                      </div>
+                      <div class="items">
+                        <span>名称</span>{{ item.name }}
+                      </div>
+
+                      <div class="items">
+                        <span>编码</span>{{ item.code }}
+                      </div>
+
+                      <div
+                        v-for="(itm, index) in tableH(item.rootCategoryLevelId)"
+                        :key="index"
+                        class="items"
+                        v-if="!itm.formatter"
+                      >
+                        <span>{{ itm.label }}</span
+                        >{{ item[itm.prop] }}
+                      </div>
+
+                      <div class="items">
+                        <span>数量</span>
+                        <!-- <input
+                          style="width: 30% !important"
+                          v-model="item.demandQuantity"
+                          disabled
+                        /> -->
+                        {{ item.demandQuantity }}
+                        {{ item.measuringUnit }}
+                      </div>
+
+                      <div
+                        class="items"
+                        v-if="item.isSelection && item.isSelection == '1'"
+                      >
+                        <span>产出工序</span>
+                        <el-select v-model="item.taskId" placeholder="请选择">
+                          <el-option
+                            v-for="item in outObj.taskDataList"
+                            :key="item.taskId"
+                            :label="item.taskTypeName"
+                            :value="item.taskId"
+                          >
+                          </el-option>
+                        </el-select>
+                      </div>
+                    </div>
+                  </div>
+                </label>
+              </div>
+            </div>
+          </el-tab-pane>
+        </el-tabs>
+      </el-tab-pane>
+    </el-tabs>
+
     <div class="operate_box" v-if="isInfo">
       <el-button
         size="small"
@@ -686,7 +996,12 @@
             value: 2
           }
         ],
-        isInfo: false
+        isInfo: false,
+
+        activeBatch: '',
+
+        defaultInnerActive: '0',
+        outsourcedQuantity: ''
       };
     },
 
@@ -852,34 +1167,6 @@
 
         this.changNumber(this.pickOutInList);
 
-        // let param = {
-        // 	taskId: this.outObj.taskId,
-        // 	taskIds: this.outObj.taskIds,
-        // 	workOrderId: this.outObj.workOrderId
-
-        // }
-        // checkOutsourceMaterial(param).then(res => {
-
-        // 	let _arr = []
-        // 	_arr = [...res.pickOutInList, ...res.materialList]
-        // 	this.pickOutInList = _arr.reduce((acc, item) => {
-        // 		const existingItem = acc.find(existing => existing.id === item.id);
-        // 		if (!existingItem) {
-        // 			acc.push(item);
-        // 		}
-        // 		return acc;
-        // 	}, []);
-
-        // 	this.bomMaterialList = res.bomMaterialList.map((m) => {
-        // 		return {
-        // 			...m,
-        // 			isDemandQuantity: true
-
-        // 		}
-        // 	})
-        // 	this.standardOutputList = res.standardOutputList
-        // 	this.$forceUpdate()
-        // })
         this.$nextTick(() => {
           this.$refs.pickOutRef.toggleAllSelection();
         });
@@ -887,7 +1174,9 @@
 
       changNumber(list) {
         let total = 0;
-        if (list && list.length != 0) {
+        let batchTotal = 0;
+
+        if (list && list.length !== 0) {
           total = list.reduce(
             (acc, pro) =>
               acc + (pro.checked ? Number(pro.feedQuantity || 0) : 0),
@@ -895,15 +1184,25 @@
           );
         }
 
-        this.attributeData.formedNumLast = total;
+        if (this.timeList.length !== 0) {
+          for (let item of this.timeList) {
+            if (item.batchNo !== '一次性到货') {
+              batchTotal += Number(item.purchaseQuantity || 0);
+            }
+          }
+        }
+
+        this.attributeData.formedNumLast = total + batchTotal;
       },
 
       handleRowSelect(selection, row) {
-        this.changNumber(selection);
+        // console.log(selection, 'handleRowSelect');
+        // this.changNumber(selection);
       },
 
       handleSelectAll(selection) {
-        this.changNumber(selection);
+        // console.log(selection, 'handleSelectAll');
+        // this.changNumber(selection);
       },
 
       inputNum(item, index) {
@@ -944,43 +1243,7 @@
       tableH(type) {
         return tableHeader(type);
       },
-      //勾选
-      selectVal(e, val, index) {
-        this.$forceUpdate();
-        this.pickOutInList[index] = val;
-        this.$set(this, 'pickOutInList', this.pickOutInList);
-
-        this.checkListLen = this.pickOutInList.filter(
-          (f) => f.checked == true
-        ).length;
-      },
-
-      _seletedAll() {
-        console.log(this.seletedAll, this.pickOutInList, 'this.seletedAll');
-        // this.seletedAll true 是全选
 
-        if (!this.seletedAll) {
-          // 非全选
-          this.seletedAll = true;
-          this.checkListLen = 0;
-
-          this.pickOutInList.map((item) => {
-            item.checked = false;
-          });
-
-          this.$set(this, 'pickOutInList', this.pickOutInList);
-        } else {
-          this.seletedAll = false;
-
-          this.pickOutInList.map((item) => {
-            item.checked = true;
-          });
-          this.$set(this, 'pickOutInList', this.pickOutInList);
-        }
-        this.checkListLen = this.pickOutInList.filter(
-          (f) => f.checked == true
-        ).length;
-      },
       selectionPickOut(val) {
         this.pickOutInListSelect = val;
         this.changNumber(val);
@@ -1077,35 +1340,46 @@
       },
 
       setBatchTime() {
-        if (this.pickOutInList.length == 0) {
+        if (!this.pickOutInList.length) {
           return this.$message.warning('请先添加物料清单!');
         }
-
-        if (this.attributeData.formedNumLast == 0) {
+        if (!this.pickOutInListSelect.length) {
           return this.$message.warning('请先勾选需要分批物料清单');
         }
 
-        const checkedList = this.pickOutInList.filter((item) => item.checked);
+        const batchList = this.timeList
+          .filter(
+            (b) => b.batchNo != '一次性到货' && Array.isArray(b.pickoutInList)
+          )
+          .flatMap((b) => b.pickoutInList);
+
+        const checkedList = [...this.pickOutInListSelect, ...batchList];
+        const batchTimeList = this.timeList.filter(
+          (b) => b.batchNo != '一次性到货'
+        );
+
+        console.log(checkedList, 'checkedListcheckedList');
 
         this.$refs.timeDialogRef.open(
           this.attributeData,
           null,
           false,
           checkedList,
-          this.workData.list[0]
+          this.workData.list[0],
+          batchTimeList
         );
-        // this.$refs.timeDialogRef.open(this.attributeData, null, false);
       },
 
       cancel() {
         this.$emit('outScucc');
       },
 
+      removeTab() {},
+
       async save() {
         const valid = await this.$refs.form.validate().catch(() => false);
         if (!valid) return;
 
-        // chooseType = 1 的处理
         if (this.chooseType == '1') {
           if (this.attributeData.supplierId) {
             const obj = this.gysList.find(
@@ -1114,7 +1388,6 @@
             this.attributeData.supplierName = obj ? obj.name : '';
           }
 
-          // 先清空,避免多次打开叠加
           this.attributeData.taskDataList = [];
 
           this.attributeData.taskIdes.forEach((it) => {
@@ -1129,12 +1402,11 @@
           taskId: this.attributeData.taskId,
           taskIds: this.attributeData.taskIds,
           workOrderId: this.attributeData.workOrderId,
-          quantity: this.attributeData.formedNumLast
+          quantity: this.attributeData.formedNumLast || 0
         };
 
         const res = await checkOutsourceMaterial(req);
 
-        // pickOutInList
         this.outObj = this.deepCopy({ ...res.data, ...this.attributeData });
 
         if (this.outObj.pickOutInList.length == 0) {
@@ -1143,7 +1415,6 @@
 
         this.outsourceMaterialFn(this.outObj);
 
-        console.log(this.outObj, 'this.outObjthis.outObj');
         this.isInfo = true;
       },
 
@@ -1183,7 +1454,162 @@
       },
 
       chooseTime(current, clonedTimeList, currentIndex) {
-        this.timeList = clonedTimeList;
+        if (clonedTimeList.length === 0) {
+          this.timeList = [];
+          this.attributeData.formedNumLast = 0;
+          this.pickOutInListSelect = [];
+
+          this.$nextTick(() => {
+            if (this.$refs.pickOutRef) {
+              this.$refs.pickOutRef.clearSelection();
+            }
+          });
+
+          return;
+        }
+
+        this.timeList = clonedTimeList.map((item) => item);
+
+        if (this.workData.list[0].singleReport == 1) {
+          const selectedIds = new Set();
+          for (let item of this.timeList) {
+            for (let it of item.pickoutInList) {
+              selectedIds.add(it.id);
+            }
+          }
+
+          this.attributeData.formedNumLast = this.timeList.reduce(
+            (acc, pro) => {
+              const num = parseFloat(pro.purchaseQuantity);
+              return acc + (isNaN(num) ? 0 : num);
+            },
+            0
+          );
+
+          const unassignedList = this.pickOutInList.filter(
+            (item) => !selectedIds.has(item.id)
+          );
+
+          const totalNum = this.pickOutInList.reduce(
+            (sum, item) => sum + Number(item.feedQuantity || 0),
+            0
+          );
+
+          if (unassignedList.length > 0) {
+            const data = {
+              batchNo: '一次性到货',
+              requireDeliveryTime: null,
+              purchaseQuantity: unassignedList.length,
+              pickoutInList: unassignedList,
+              bomMaterialList: [],
+              standardOutputList: []
+            };
+
+            const exists = this.timeList.some((t) => t.batchNo == '一次性到货');
+
+            if (!exists) {
+              this.timeList.unshift(data);
+            } else {
+              const index = this.timeList.findIndex(
+                (t) => t.batchNo == '一次性到货'
+              );
+              this.timeList.splice(index, 1, data);
+            }
+          }
+
+          if (this.bomMaterialList.length != 0) {
+            for (let item of this.bomMaterialList) {
+              for (let it of this.timeList) {
+                const proportion = this.div(it.purchaseQuantity, totalNum);
+                const allocatedQuantity = this.mul(
+                  proportion,
+                  item.demandQuantity
+                );
+
+                const materialItem = {
+                  ...item,
+                  demandQuantity: allocatedQuantity
+                };
+
+                it.bomMaterialList.push(materialItem);
+              }
+            }
+          }
+
+          if (this.standardOutputList.length != 0) {
+            for (let item of this.standardOutputList) {
+              for (let it of this.timeList) {
+                const proportion = this.div(it.purchaseQuantity, totalNum);
+                const allocatedQuantity = this.mul(
+                  proportion,
+                  item.demandQuantity
+                );
+
+                const materialItem = {
+                  ...item,
+                  demandQuantity: allocatedQuantity
+                };
+
+                it.standardOutputList.push(materialItem);
+              }
+            }
+          }
+
+          this.timeList[0].innerActive = '0';
+          this.activeBatch = this.timeList[0].batchNo;
+          this.pickOutInListSelect = [];
+
+          console.log(this.timeList, '8285');
+        }
+      },
+
+      getDecimalLength(num) {
+        return (num.toString().split('.')[1] || '').length;
+      },
+
+      toInteger(num) {
+        const len = this.getDecimalLength(num);
+        return {
+          int: Math.round(num * Math.pow(10, len)),
+          factor: Math.pow(10, len)
+        };
+      },
+
+      add(a, b) {
+        const { int: aInt, factor: aFactor } = this.toInteger(a);
+        const { int: bInt, factor: bFactor } = this.toInteger(b);
+        const maxFactor = Math.max(aFactor, bFactor);
+        return (
+          (aInt * (maxFactor / aFactor) + bInt * (maxFactor / bFactor)) /
+          maxFactor
+        );
+      },
+      sub(a, b) {
+        const { int: aInt, factor: aFactor } = this.toInteger(a);
+        const { int: bInt, factor: bFactor } = this.toInteger(b);
+        const maxFactor = Math.max(aFactor, bFactor);
+        return (
+          (aInt * (maxFactor / aFactor) - bInt * (maxFactor / bFactor)) /
+          maxFactor
+        );
+      },
+      mul(a, b) {
+        const aLen = this.getDecimalLength(a);
+        const bLen = this.getDecimalLength(b);
+        return (
+          (Number(a.toString().replace('.', '')) *
+            Number(b.toString().replace('.', ''))) /
+          Math.pow(10, aLen + bLen)
+        );
+      },
+      div(a, b) {
+        const aLen = this.getDecimalLength(a);
+        const bLen = this.getDecimalLength(b);
+        return (
+          (Number(a.toString().replace('.', '')) /
+            Number(b.toString().replace('.', ''))) *
+          Math.pow(10, bLen - aLen)
+        );
       },
 
       handOK(isRelease) {
@@ -1193,12 +1619,14 @@
           return this.$message.warning('请选择交付日期!');
         }
 
-        // if (this.checkListLen > 0 && !this.outObj.warehouseId) {
-        //   return this.$message({
-        //     message: '请选择仓库',
-        //     type: 'warning'
-        //   });
-        // }
+        if (isRelease == 1) {
+          if (
+            this.timeList.length == 0 &&
+            this.attributeData.deliveryMethod == 2
+          ) {
+            return this.$message.warning('请先分批!');
+          }
+        }
 
         // 环境判断
         let _pickOutInList = [];
@@ -1206,7 +1634,6 @@
         if (this.clientEnvironmentId == 2) {
           _pickOutInList = this.pickOutInList;
         } else {
-          // _pickOutInList = this.pickOutInList.filter(f => f.checked == true)
           _pickOutInList = this.pickOutInListSelect;
         }
 
@@ -1231,8 +1658,6 @@
 
         this.outObj = this.deepCopy({ ...this.outObj, ...this.attributeData });
 
-        // this.outObj.formedNumLast = this.outsourceData.formedNumLast;
-
         let param = {
           ...this.outObj,
           isRelease: isRelease,
@@ -1272,7 +1697,7 @@
     display: flex;
     align-items: center;
     margin-bottom: 0;
-    height: 58px;
+    height: 40px;
     margin-bottom: 10px;
     box-sizing: border-box;
     border-bottom: 1px solid var(--border-color-lighter);
@@ -1293,7 +1718,7 @@
   }
 
   .materialList {
-    height: 25vh;
+    height: 34vh;
     overflow: auto;
   }
 
@@ -1368,7 +1793,7 @@
   }
 
   ::v-deep .el-form-item {
-    margin-bottom: 5px;
+    margin-bottom: 4px;
   }
 
   .full {

+ 18 - 9
src/views/produce/components/outsourcing/timeDialog.vue

@@ -149,7 +149,9 @@
               requireDeliveryTime: null,
               purchaseQuantity: null,
               batchNo: null,
-              pickoutInList: []
+              pickoutInList: [],
+              bomMaterialList: [],
+              standardOutputList: []
             }
           ]
         },
@@ -190,14 +192,14 @@
       }
     },
     methods: {
-      open(row, index, isAll, pickOutInList, workOrderData) {
+      open(row, index, isAll, pickOutInList, workOrderData, timeList) {
         this.workOrderData = workOrderData;
         this.pickOutInList = pickOutInList.map((item) => item);
         this.isAll = isAll;
         if (row) {
           let row1 = JSON.parse(JSON.stringify(row));
           this.count = row1.demandQuantity || 0;
-          this.form.timeList = row1.timeList || [];
+          this.form.timeList = timeList?.map((item) => item);
           this.form.timeList?.forEach(async (item, index) => {
             if (!item.batchNo) {
               this.$set(
@@ -207,6 +209,7 @@
               );
             }
           });
+
           this.count = row.formedNumLast;
           this.current = row1;
           this.currentIndex = index;
@@ -219,11 +222,16 @@
           requireDeliveryTime: null,
           purchaseQuantity: null,
           batchNo: await getCode('lot_number_code'),
-          pickoutInList: []
+          pickoutInList: [],
+          bomMaterialList: [],
+          standardOutputList: []
         });
       },
 
       handleDel(index) {
+        this.form.timeList[index].pickoutInList.forEach((item) => {
+          item.selected = false;
+        });
         this.form.timeList.splice(index, 1);
       },
 
@@ -231,7 +239,7 @@
         this.$refs.batchChooseGoodsRef.open(
           this.workOrderData,
           this.pickOutInList,
-          this.form.timeList[index].list,
+          this.form.timeList[index].pickoutInList,
           index
         );
       },
@@ -256,9 +264,6 @@
               if (this.num < 0) {
                 return this.$message.warning('分配数量不能大于需求数量!');
               }
-              if (this.num > 0) {
-                return this.$message.warning('需求数量还未分配完,请检查!');
-              }
             }
 
             this.$emit(
@@ -277,7 +282,11 @@
         this.form.timeList = [
           {
             requireDeliveryTime: null,
-            purchaseQuantity: null
+            purchaseQuantity: null,
+            batchNo: null,
+            pickoutInList: [],
+            bomMaterialList: [],
+            standardOutputList: []
           }
         ];
       }

+ 27 - 27
src/views/produce/components/workPlan/components/sampleListDialog.vue

@@ -129,7 +129,11 @@
                     @input="
                       handleInput(scope.row, scope.row.qualityResultContent)
                     "
-                  ></el-input>
+                  >
+                    <template slot="append" v-if="scope.row.unitName">
+                      {{ scope.row.unitName }}
+                    </template>
+                  </el-input>
                 </template>
               </el-table-column>
               <el-table-column
@@ -246,6 +250,24 @@
           { label: '物料代号', prop: 'materielDesignation', align: 'center' },
           { label: '客户代号', prop: 'clientCode', align: 'center' },
           { label: '刻码', prop: 'engrave', align: 'center' },
+          {
+            label: '型号',
+            prop: 'modelType',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '规格',
+            prop: 'specification',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '电压等级',
+            prop: 'voltage',
+            align: 'center',
+            showOverflowTooltip: true
+          },
           { label: '重量', prop: 'weight', align: 'center' },
           { label: '重量单位', prop: 'weightUnit', align: 'center' },
           { label: '仓库', prop: 'warehouseName', align: 'center' },
@@ -327,12 +349,9 @@
             this.getQuality(item.qualitySampleTemplateList)
           );
         });
-
-        this.$forceUpdate();
       },
       getQuality(arr) {
         let getQualityValue = 1;
-        console.log(arr, 'arrrrrr');
         arr.forEach((item) => {
           if (item.qualityResults == 2) {
             getQualityValue = 2;
@@ -341,6 +360,7 @@
         return getQualityValue;
       },
       inputResultContent(e, row) {
+        console.log(row, 'row row row');
         if (row.textType == '1') {
           if (!row.symbol) {
             if (row.qualityResultContent != row.defaultValue) {
@@ -352,6 +372,7 @@
           }
           let key = this.mathematicalJudgment(row);
           this.$set(row, 'qualityResults', key);
+          return;
         }
 
         if (row.textType == '3') {
@@ -374,16 +395,10 @@
         let symbol = row.symbol?.trim(); // 符号
         let Ivalue = Number(row.qualityResultContent); // 输入的值
         let Dvalue = Number(row.defaultValue); // 判断的值
-
-        console.log(symbol, Ivalue, Dvalue, 'symbol, Ivalue, Dvalue');
         if (Ivalue == NaN || Dvalue == NaN) {
           return 2;
         }
         if (symbol == '±') {
-          console.log(
-            Math.abs(Ivalue) != Math.abs(Dvalue),
-            'Math.abs(Ivalue) != Math.abs(Dvalue)'
-          );
           if (Math.abs(Ivalue) != Math.abs(Dvalue)) {
             return 1;
           } else {
@@ -432,7 +447,7 @@
           }
         }
         if (symbol == '<') {
-          if (Ivalue > Dvalue) {
+          if (Ivalue < Dvalue) {
             return 1;
           } else {
             return 2;
@@ -443,7 +458,7 @@
       },
 
       handleInput(item, value) {
-        console.log(item, 'itemitemitem');
+        console.log(item, 'item');
         if (value) {
           if (item.textType == '1') {
             if (!item.symbol) {
@@ -480,21 +495,6 @@
           this.$set(item, 'qualityResults', 1);
           this.qualityResultsListChange();
         }
-        // if (item.defaultValue) {
-        //   const number = Number(item.defaultValue);
-
-        //   if (isNaN(number)) return;
-
-        //   const valueNumber = Number(value);
-
-        //   if (isNaN(valueNumber)) return;
-
-        //   if (valueNumber > number) {
-        //     item.qualityResults = 2;
-        //   } else {
-        //     item.qualityResults = 1;
-        //   }
-        // }
       },
 
       handleClose() {

+ 21 - 5
src/views/produceOrder/workReport.vue

@@ -218,14 +218,24 @@
                         v-if="isStep"
                       ></outsourcing>
 
-                      <!--   -->
                       <outsourceList
-                        :outsourceFormVal="outObj"
+                        :workData="workInfoList"
+                        :taskObj="taskObj"
+                        :outsourceFormVal="outsourceForm"
+                        :chooseType="chooseType"
                         @closeForm="closeForm"
                         @outScucc="outScucc"
                         v-if="isOutsource"
                       ></outsourceList>
 
+                      <!--   -->
+                      <!-- <outsourceList
+                        :outsourceFormVal="outObj"
+                        @closeForm="closeForm"
+                        @outScucc="outScucc"
+                        v-if="isOutsource"
+                      ></outsourceList> -->
+
                       <pleaseEntrust
                         :outsourceFormVal="outObj"
                         @closeForm="closeForm"
@@ -321,7 +331,8 @@
   import workPlan from '@/views/produce/components/workPlan/index.vue';
   // import workes from './components/workPlan/components/work.vue';
   import warehousing from '@/views/produce/components/warehousing/index.vue';
-  import outsourceList from '@/views/produce/components/outsourcing/outsourceList.vue';
+  // import outsourceList from '@/views/produce/components/outsourcing/outsourceList.vue';
+  import outsourceList from '@/views/produce/components/outsourcing/new_outsourceList.vue';
   import pleaseEntrust from '@/views/produce/components/outsourcing/pleaseEntrust.vue';
   import workStep from '@/views/produce/components/workStep/index.vue';
   import createError from '@/views/produce/components/createError.vue';
@@ -910,13 +921,18 @@
       },
 
       outsourcingAdd(type, activeName) {
-        this.getTaskInstanceByIdFn(this.workListIds[0]);
         this.chooseType = activeName;
+        this.getTaskInstanceByIdFn(this.workListIds[0]);
 
-        this.isStep = true;
+        // this.isStep = true;
 
         this.workInfoList = { list: [] };
         this.workInfoList.list.push(this.workData);
+        if (this.chooseType == '2') {
+          this.isStep = true;
+        } else {
+          this.isOutsource = true;
+        }
       },
 
       async handOutsource(workOrderId) {

+ 2 - 2
src/views/taskList/index.vue

@@ -84,7 +84,7 @@
               tabValue != '2'
             "
           >
-            <el-button slot="reference" type="text">接收任务</el-button>
+            <el-button slot="reference" type="text">接收</el-button>
           </el-popconfirm>
 
           <el-popconfirm
@@ -97,7 +97,7 @@
               tabValue != '2'
             "
           >
-            <el-button slot="reference" type="text">拒绝任务</el-button>
+            <el-button slot="reference" type="text">拒绝</el-button>
           </el-popconfirm>
 
           <!-- <el-link