chencc 1 год назад
Родитель
Сommit
76bd8424c2

+ 150 - 19
src/components/common/seekPage.vue

@@ -1,22 +1,93 @@
 <template>
     <div class="index_box">
-        <el-form label-width="90px" :inline="true" @keyup.enter.native="search" @submit.native.prevent>
-
-            <el-form-item :label="item.label" v-for="(item, i) in seekList" :key="i">
-                <!-- input 输入 -->
-                <div v-if="item.type == 'input'">
-                    <el-input clearable v-model="item.value" :placeholder="item.placeholder"
-                        :style="{ width: item.width ? item.width + 'px' : '260px' }" />
-                </div>
-                <div v-if="item.type == 'select'">
-                    <el-select clearable v-model="item.value" :placeholder="item.placeholder"
-                        :style="{ width: item.width ? item.width + 'px' : '260px' }">
-                        <el-option v-for="op in item.planList" :label="op.label" :value="op.value"
-                            :key="item.value"></el-option>
-                    </el-select>
-                </div>
+        <el-form label-width="90px" :inline="true">
+            <el-form-item v-for="(item, i) in seekList" :key="i">
+                <el-form-item :label="item.label" :label-width="item.labelWidth + 'px'" v-if="i <= 2">
+                    <!-- input 输入 -->
+                    <div>
+                        <div v-if="item.type == 'input'">
+
+                            <el-input clearable v-model="defaultWhere[item.value]"
+                                :placeholder="item.placeholder || '请输入内容'"
+                                :style="{ width: item.width ? item.width + 'px' : '220px' }" />
+                        </div>
+                        <div v-if="item.type == 'select'">
+                            <el-select clearable :v-model="defaultWhere[item.value]"
+                                :placeholder="item.placeholder || '请输入内容'" :multiple="item.multiple ? item.multiple : false"
+                                :filterable="item.filterable ? item.filterable : true"
+                                :style="{ width: item.width ? item.width + 'px' : '220px' }">
+                                <el-option v-for="(op, i) in item.planList" :label="op.label" :value="op.value"
+                                    :key="i"></el-option>
+                            </el-select>
+                        </div>
+                        <div v-if="item.type == 'date'">
+                            <el-date-picker v-model="defaultWhere[item.value]" @visible-change="change"
+                                :type="item.dateType || 'daterange'" range-separator="至" start-placeholder="开始日期"
+                                end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss"
+                                :style="{ width: item.width ? item.width + 'px' : '220px' }">
+
+
+                            </el-date-picker>
+                        </div>
+                    </div>
+                </el-form-item>
 
             </el-form-item>
+
+            <el-form-item>
+                <el-dropdown ref="dropdownref" trigger="click" :hide-on-click="false" v-model="dropdownVisible">
+                    <div v-if="seekList.length > 3">
+                        <span class="el-dropdown-link">
+                            更多选项<i class="el-icon-arrow-down el-icon--right"></i>
+                        </span>
+                        <el-dropdown-menu slot="dropdown" >
+                            <div class="padding">
+                                <el-form label-position="left">
+                                    <el-form-item v-for="(item, i) in deboListRow" :key="i" :inline="true"
+                                        label-position="left">
+                                        <el-form-item :label-width="item.labelWidth ? item.labelWidth : '90' + 'px'"
+                                            :inline="true" :label="item.label">
+                                            <div v-if="item.type == 'input'">
+                                                <el-input clearable v-model="defaultWhere[item.value]"
+                                                    :placeholder="item.placeholder || '请输入内容'"
+                                                    :style="{ width: item.width ? item.width + 'px' : '220px' }" />
+                                            </div>
+                                            <div v-if="item.type == 'select'">
+                                                <el-select clearable v-model="defaultWhere[item.value]"
+                                                    :multiple="item.multiple ? item.multiple : false"
+                                                    :filterable="item.filterable ? item.filterable : true"
+                                                    :placeholder="item.placeholder || '请输入内容'"
+                                                    :style="{ width: item.width ? item.width + 'px' : '220px' }"
+                                                    @visible-change="change" @change="handerChange">
+                                                    <el-option v-for="(op, i) in item.planList" :label="op.label"
+                                                        :value="op.value" :key="i"></el-option>
+                                                </el-select>
+                                            </div>
+
+                                            <div v-if="item.type == 'date'">
+                                                <el-date-picker v-model="defaultWhere[item.value]"
+                                                    @blur="change" :type="item.dateType || 'daterange'"
+                                                    range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
+                                                    value-format="yyyy-MM-dd HH:mm:ss"
+                                                    
+                                                    :style="{ width: item.width ? item.width + 'px' : '220px' }">
+
+
+                                                </el-date-picker>
+                                            </div>
+
+                                        </el-form-item>
+                                    </el-form-item>
+                                </el-form>
+                            </div>
+
+                        </el-dropdown-menu>
+                    </div>
+                </el-dropdown>
+
+
+            </el-form-item>
+
             <el-form-item>
                 <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search">
                     查询
@@ -31,8 +102,7 @@
 
 <script>
 
-
-
+let defaultWhere = {};
 export default {
     props: {
         seekList: {
@@ -44,15 +114,49 @@ export default {
     components: {
 
     },
+    watch: {
+        seekList: {
+            handler(val) {
+
+                val.forEach(item => {
+
+                    defaultWhere[item.value] = null;
+
+                })
+
+                this.$nextTick(() => {
+
+                    if (Array.isArray(val) && val.length <= 3) {
+                        this.seekListRow = val
+                    } else if (Array.isArray(val) && val.length >= 3) {
+                        this.seekListRow = val.slice(0, 3);
+                        this.deboListRow = val.slice(3);
+                    }
+                })
+
+            },
+            deep: true,
+            immediate: true,
+        }
+    },
+
     data() {
+
+
         return {
+            defaultWhere: {},
+            dropdownVisible: true,
+
+            deboListRow: [],
+            seekListRow: []
         }
     },
 
     computed: {
         info() {
             return this.$store.state.user.info;
-        }
+        },
+
     },
 
     created() {
@@ -60,9 +164,36 @@ export default {
 
     },
     methods: {
+
+        change(visible) {
+           
+            this.dropdownVisible = visible;
+            this.$refs.dropdownref.show()
+        },
+        handerChange() {
+            this.$refs.dropdownref.show()
+        },
+
+        search() {
+            this.$emit('search', this.defaultWhere);
+        },
+        // 重置
+        reset() {
+            this.defaultWhere = {};
+            this.search();
+        }
+
         //  折叠悬浮中样式调整
     },
 }
 </script>
 
-<style scoped></style>
+<style scoped>
+.index_box {
+    display: flex;
+}
+
+.padding {
+    padding: 20px;
+}
+</style>

+ 16 - 2
src/views/produce/components/feeding/components/packingBom.vue

@@ -7,7 +7,7 @@
     </div>
 
     <div class="material">
-      <div class="content_table" v-for="(item, index) in list" :key="index">
+      <div class="content_table" v-for="(item, index) in arrList" :key="index">
         <div class="item rx-sc">
           <div class="rx ww33">
             <div class="lable rx-cc">编号</div>
@@ -93,10 +93,24 @@
       }
     },
 
+    watch: {
+      list:{
+        handler(val){
+          if(val.length){
+            this.arrList = val.filter(v=>v.rootCategoryLevelId==='13')
+          }
+        },
+        immediate: true,
+        deep: true
+      }
+    },
+
     computed: {},
 
     data() {
-      return {};
+      return {
+        arrList:[],
+      };
     },
 
     methods: {

+ 39 - 7
src/views/produce/components/feeding/index.vue

@@ -1,7 +1,17 @@
 <template>
   <div>
     <div v-if="isShow">
+
+
       <div class="top_fixed">
+        <div style="display: flex;align-items: center;margin-right: 10px;" v-if="List.length > 1">
+          <div class="rx-bc">
+            <div class="name">批量投料时间:</div>
+          </div>
+          <el-date-picker v-model="executorTime" type="datetime" value-format="yyyy-MM-dd HH:dd:ss" placeholder="选择日期"
+            @change="handleCreate">
+          </el-date-picker>
+        </div>
         <el-button type="primary" size="mini" @click="save(2, 'all')">一键投料(报工)</el-button>
         <el-button type="primary" size="mini" @click="removeCacheFn('all')">清空缓存</el-button>
         <el-button type="primary" size="mini" @click="save(1, 'all')">缓存</el-button>
@@ -22,7 +32,7 @@
 
           <workOrderBom :item="item"></workOrderBom>
 
-          <div >
+          <div>
             <div class="title_box rx-bc">
               <div class="name">投料时间 </div>
             </div>
@@ -45,7 +55,7 @@
           </modelBom>
 
           <!-- 物料清单 -->
-          
+
           <instanceBom v-if="item.instanceList.length != 0" :list="item.instanceList"
             :equipmentList="item.equipmentList" :currentTaskDiagram="item.currentTaskDiagram" :workInfo="item">
           </instanceBom>
@@ -62,12 +72,16 @@
 
           <palletBom v-if="item.palletList.length != 0" :list="item.palletList"></palletBom>
 
+          <!-- // 包装物料清单 -->
+
+          <packingBom v-if="item.pickOutInList.length != 0" :list="item.pickOutInList"></packingBom>
+
           <revolvingDiskBom v-if="item.revolvingDiskList.length != 0" :list="item.revolvingDiskList"></revolvingDiskBom>
         </div>
       </div>
 
       <pickingList isType="feed" ref="pickingListRef" @allSelection="allSelection"></pickingList>
-      
+
     </div>
 
     <div v-else>
@@ -86,7 +100,7 @@ import {
 } from '@/api/produce/feeding';
 
 import pickingList from '../picking/pickingList.vue';
-
+import packingBom from './components/packingBom.vue';
 import workOrderBom from './components/workOrderBom.vue';
 import paramBom from './components/paramBom.vue';
 import deviceBom from './components/deviceBom.vue';
@@ -103,7 +117,7 @@ export default {
   name: 'feeding',
   components: {
     pickingList,
-
+    packingBom,
     workOrderBom,
     paramBom,
     deviceBom,
@@ -147,12 +161,26 @@ export default {
     return {
       List: [],
       idsList: [],
+      executorTime: '',
       isLoad: false,
       isShow: true
     };
   },
 
   methods: {
+    handleCreate(e) {
+
+      if (e) {
+        const list = JSON.parse(JSON.stringify(this.List));
+        console.log(list);
+        list.map(item => {
+          item.executorTime = e;
+        })
+
+        this.$set(this, 'List', list);
+
+      }
+    },
     getList(ids) {
       this.idsList = ids || [];
       let param = {
@@ -237,7 +265,7 @@ export default {
     },
 
     openPicking(id, item) {
-      this.$refs.pickingListRef.open(id, item,'选择列表');
+      this.$refs.pickingListRef.open(id, item, '选择列表');
     },
 
     allSelection(id, selectList) {
@@ -320,7 +348,7 @@ export default {
     },
 
     async save(type, index) {
-      
+
       this.List.forEach((f) => {
         f.instanceList.forEach((e) => {
           if (Object.prototype.hasOwnProperty.call(e, 'type')) {
@@ -335,7 +363,11 @@ export default {
       if (!isCache) {
         return false;
       }
+      let arr = this.List.filter((L) => L.executorTime)
 
+      if (!arr.length) {
+        return this.$message.warning('请选择执行时间');
+      }
       batchSave(this.List).then((res) => {
         this.$message.success('投料成功');
         this.getList(this.idsList);

+ 7 - 2
src/views/produce/components/inspection/index.vue

@@ -65,7 +65,9 @@
                 <!-- 报告信息 -->
 
                 <!-- 取样列表 -->
-                <newQualityTesting ref="newQualityTestingRef"></newQualityTesting>
+                
+                <newQualityTesting ref="newQualityTestingRef" :singleReport="item.singleReport"></newQualityTesting>
+                
                 <!-- 物料清单 -->
                 <instanceBom v-if="item.instanceList.length != 0" :list="item.instanceList"
                     :equipmentList="item.equipmentList" :currentTaskDiagram="item.currentTaskDiagram" :workInfo="item">
@@ -163,7 +165,10 @@ export default {
             default() {
                 return [];
             }
-        }
+        },
+        singleReport: {
+        default: null
+      }
     },
 
     computed: {

+ 530 - 642
src/views/produce/components/jobBooking/components/semiProductJobBom.vue

@@ -1,22 +1,14 @@
 <template>
   <div>
     <div class="title_box rx-bc mt6">
- 
-      <div class="name">报工信息({{ list.length || 0 }})个  </div>
+
+      <div class="name">报工信息({{ list.length || 0 }})个 </div>
 
       <div class="rx-bc"> </div>
     </div>
 
-    <el-table
-      ref="oneJobQualityBom"
-      class="table_content"
-      :max-height="600"
-      :data="list"
-      tooltip-effect="dark"
-      style="width: 100%"
-      stripe
-      border
-    >
+    <el-table ref="oneJobQualityBom" class="table_content" :max-height="600" :data="list" tooltip-effect="dark"
+      style="width: 100%" stripe border>
       <el-table-column label="序号" type="index" width="55">
         <template slot-scope="{ row, $index }">
           {{ $index + 1 }}
@@ -39,12 +31,12 @@
             row.rootCategoryLevelId == 2
               ? '在制品'
               : row.rootCategoryLevelId == 23
-              ? '半成品'
-              : row.rootCategoryLevelId == 9
-              ? '产品'
-              : row.rootCategoryLevelId == 28
-              ? '废品'
-              : ''
+                ? '半成品'
+                : row.rootCategoryLevelId == 9
+                  ? '产品'
+                  : row.rootCategoryLevelId == 28
+                    ? '废品'
+                    : ''
           }})
         </template>
       </el-table-column>
@@ -55,56 +47,29 @@
       <el-table-column v-if="singleReport == 1" label="刻码" prop="engrave">
         <template slot-scope="{ row, $index }">
           <span v-if="isDetails">{{ row.extInfo.engrave }}</span>
-          <el-input
-            v-else
-            size="mini"
-            class="content_num"
-            v-model="row.extInfo.engrave"
-            placeholder="刻码"
-          />
+          <el-input v-else size="mini" class="content_num" v-model="row.extInfo.engrave" placeholder="刻码" />
         </template>
       </el-table-column>
       <el-table-column label="序列号" prop="productSequence">
         <template slot-scope="{ row, $index }">
           {{ row.extInfo?.productSequence }}
         </template>
-      </el-table-column>    
+      </el-table-column>
       <el-table-column label="发货条码" prop="sendCode">
         <template slot-scope="{ row, $index }">
-          <el-input
-            size="mini"
-            class="content_num"
-            v-model="row.extInfo.sendCode"
-            placeholder="发货条码"
-            :disabled="isDetails"
-          
-          />
+          <el-input size="mini" class="content_num" v-model="row.extInfo.sendCode" placeholder="发货条码"
+            :disabled="isDetails" />
         </template>
       </el-table-column>
-      <el-table-column
-        v-if="singleReport == 1"
-        label="物料代号"
-        prop="materielCode"
-      >
+      <el-table-column v-if="singleReport == 1" label="物料代号" prop="materielCode">
         <template slot-scope="{ row, $index }">
           <span v-if="isDetails">{{ row.extInfo.materielCode }}</span>
-          <el-input
-            v-else
-            size="mini"
-            class="content_num"
-            v-model="row.extInfo.materielCode"
-            placeholder="物料代号"
-          />
+          <el-input v-else size="mini" class="content_num" v-model="row.extInfo.materielCode" placeholder="物料代号" />
         </template>
       </el-table-column>
 
 
-      <el-table-column
-        v-if="singleReport == 1 && deviceList.length > 0"
-        width="140"
-        label="设备"
-        prop="deviceId"
-      >
+      <el-table-column v-if="singleReport == 1 && deviceList.length > 0" width="140" label="设备" prop="deviceId">
         <template slot-scope="{ row, $index }">
           <!-- <el-select
             class="content_num"
@@ -122,162 +87,77 @@
             >
             </el-option>
           </el-select> -->
-          {{   row.deviceName || row.extInfo.deviceName }}
+          {{ row.deviceName || row.extInfo.deviceName }}
         </template>
       </el-table-column>
 
-      <el-table-column
-        v-if="singleReport == 1 && deviceList.length > 0"
-        label="炉次号"
-        width="90"
-        prop="heatNumber"
-      >
+      <el-table-column v-if="singleReport == 1 && deviceList.length > 0" label="炉次号" width="90" prop="heatNumber">
         <template slot-scope="{ row, $index }">
-          <el-input
-            size="mini"
-            class="content_num"
-            v-model="row.extInfo.heatNumber"
-            placeholder="请输入炉次号"
-          />
+          <el-input size="mini" class="content_num" v-model="row.extInfo.heatNumber" placeholder="请输入炉次号" />
         </template>
       </el-table-column>
 
-      <el-table-column
-        v-if="singleReport == 1"
-        label="数量"
-        width="90"
-        prop="feedQuantity"
-      >
+      <el-table-column v-if="singleReport == 1" label="数量" width="90" prop="feedQuantity">
         <template slot-scope="{ row, $index }">
-          <el-input
-            size="mini"
-            class="content_num"
-            v-model="row.feedQuantity"
-            :disabled="isDetails"
-            placeholder="数量"
-          />
+          <el-input size="mini" class="content_num" v-model="row.feedQuantity" :disabled="isDetails" placeholder="数量" />
         </template>
       </el-table-column>
 
-      <el-table-column
-        v-if="singleReport == 1"
-        label="位置"
-        width="110"
-        prop="position"
-      >
+      <el-table-column v-if="singleReport == 1" label="位置" width="110" prop="position">
         <template slot-scope="{ row, $index }">
           <span v-if="isDetails">{{ row.extInfo.position }}</span>
-          <el-input
-            v-else
-            size="mini"
-            class="content_num"
-            v-model="row.extInfo.position"
-            placeholder="位置"
-          />
+          <el-input v-else size="mini" class="content_num" v-model="row.extInfo.position" placeholder="位置" />
         </template>
       </el-table-column>
 
-      <el-table-column
-        v-if="singleReport == 1"
-        label="上道工序重量"
-        width="150"
-        prop="weight"
-
-      >
-        <template slot-scope="{ row, $index }"         >
-          <div class="tag_box">{{ row.extInfo.newWeight ? '上' : '原' }}</div>
-          <span  v-if="Object.prototype.hasOwnProperty.call(row.extInfo, 'newWeight')">{{
-          row.extInfo.newWeight
-          }}</span>
-
-         <el-input
-          v-if="!Object.prototype.hasOwnProperty.call(row.extInfo, 'newWeight')"
-            size="mini"
-            class="content_num2"
-            style="width: 100px;"
-            v-model="row.extInfo.weight"
-            :disabled="isDetails"
-            prop="digit"
-          />
-
-
+      <el-table-column v-if="singleReport == 1" label="上道工序重量" width="180" prop="weight">
+        <template slot-scope="{ row, $index }">
+          <div style="display: flex;align-items: center">
+            <div class="tag_box">{{ row.extInfo.newWeight ? '上' : '原' }}</div>
+            <span v-if="Object.prototype.hasOwnProperty.call(row.extInfo, 'newWeight')">{{
+              row.extInfo.newWeight
+            }}</span>
+
+            <el-input v-if="!Object.prototype.hasOwnProperty.call(row.extInfo, 'newWeight')" size="mini"
+              class="content_num2" style="width: 100px;" v-model="row.extInfo.weight" :disabled="isDetails"
+              prop="digit" />
+              <div style="width: 55px;">{{ row.weightUnit }}</div>
+          </div>
         </template>
       </el-table-column>
 
-      <el-table-column
-        v-if="singleReport == 1"
-        label="报工重量"
-        width="110"
-        prop="feedQuantity"
-      >
+      <el-table-column v-if="singleReport == 1" label="报工重量" width="150" prop="feedQuantity">
         <template slot-scope="{ row, $index }">
-          <span v-if="isDetails">{{ row.extInfo.reportWeight }}</span>
-          <el-input
-            v-else
-            size="mini"
-            class="content_num"
-            v-model="row.extInfo.reportWeight"
-            placeholder="报工重量"
-            prop="digit"
-          />
+          <div style="display: flex;align-items: center">
+            <span v-if="isDetails">{{ row.extInfo.reportWeight }}</span>
+            <el-input v-else size="mini" class="content_num" type="number" v-model="row.extInfo.reportWeight"
+              placeholder="报工重量" prop="digit" @input="handleInput" />
+            <div style="width: 55px;">{{ row.weightUnit }}</div>
+          </div>
+
         </template>
       </el-table-column>
 
-      <el-table-column
-        v-if="singleReport == 1"
-        label="是否合格"
-        width="110"
-        prop="isQualified"
-      >
+      <el-table-column v-if="singleReport == 1" label="是否合格" width="110" prop="isQualified">
         <template slot-scope="{ row, $index }">
-          <el-select
-          
-            size="mini"
-            class="content_num"
-            v-model="row.extInfo.isQualified"
-            filterable
-            placeholder="请选择"
-            :disabled="isDetails"
-          >
-            <el-option
-              v-for="item in isQualifiedList"
-              :label="item.name"
-              :value="item.code"
-              :key="item.code"
-            >
+          <el-select size="mini" class="content_num" v-model="row.extInfo.isQualified" @change="handlerSelect"
+            filterable placeholder="请选择" :disabled="isDetails">
+            <el-option v-for="item in isQualifiedList" :label="item.name" :value="item.code" :key="item.code">
             </el-option>
           </el-select>
-     
+
         </template>
       </el-table-column>
 
 
-      <el-table-column
-        v-if="singleReport == 1"
-        label="不合格品处置类型"
-        width="160"
-        prop="notType"
-      >
+      <el-table-column v-if="singleReport == 1" label="不合格品处置类型" width="160" prop="notType">
         <template slot-scope="{ row, $index }">
-          <el-select
-          v-if="row.extInfo.isQualified && row.extInfo.isQualified == 2"
-            size="mini"
-            class="content_num"
-            v-model="row.extInfo.notType"
-            filterable
-            placeholder="请选择"
-            :disabled="isDetails"
-
-          >
-            <el-option
-              v-for="item in notTypeList"
-              :label="item.name"
-              :value="item.code"
-              :key="item.code"
-            >
+          <el-select v-if="row.extInfo.isQualified && row.extInfo.isQualified == 2" size="mini" class="content_num"
+            v-model="row.extInfo.notType" filterable placeholder="请选择" :disabled="isDetails">
+            <el-option v-for="item in notTypeList" :label="item.name" :value="item.code" :key="item.code">
             </el-option>
           </el-select>
-     
+
         </template>
       </el-table-column>
 
@@ -294,59 +174,42 @@
           </div>
         </template>
       </el-table-column> -->
-
-      <el-table-column label="不良原因/处置" width="130" prop="taskName">
-        <template slot-scope="{ row, $index }" >
-          <div  v-if="row.extInfo.isQualified != 1  &&  row.extInfo.notType &&  row.extInfo.notType != 5 ">
+      <!-- label="/" -->
+      <el-table-column width="130" prop="taskName">
+        <template slot="header" slot-scope="scope">
+          <div>
+            不良原因<span style="color: #f00;padding: 0 2px;">/</span>处置
+          </div>
+        </template>
+        <template slot-scope="{ row, $index }">
+          <div v-if="row.extInfo.isQualified != 1 && row.extInfo.notType && row.extInfo.notType != 5">
             <span v-if="isDetails">{{ row.extInfo.notReason }}</span>
-          <el-input
-            v-else
-            size="mini"
-            class="content_num"
-            v-model="row.extInfo.notReason"
-            placeholder="原因"
-          
-          />
+            <el-input v-else size="mini" class="content_num" v-model="row.extInfo.notReason" placeholder="原因" />
           </div>
-        <div v-if="![1,2,3,4].includes(Number(row.extInfo.notType))">
-          <span v-if="isDetails">{{ row.extInfo.taskName }}</span>
-          <el-select
-            v-else
-            size="mini"
-            class="content_num"
-            v-model="row.extInfo.taskId"
-            filterable
-            placeholder="请选择"
-            @change="(e) => selectName(e, $index)"
-          >
-            <el-option
-              v-for="item in stepsList"
-              :label="item.taskTypeName"
-              :value="item.taskId"
-              :key="item.taskId"
-            >
-            </el-option>
-          </el-select>
+          <div v-if="![1, 2, 3, 4].includes(Number(row.extInfo.notType))">
+            <span v-if="isDetails">{{ row.extInfo.taskName }}</span>
+            <el-select v-else size="mini" class="content_num" v-model="row.extInfo.taskId" filterable placeholder="请选择"
+              @change="(e) => selectName(e, $index)">
+              <el-option v-for="item in stepsList" :label="item.taskTypeName" :value="item.taskId" :key="item.taskId">
+              </el-option>
+            </el-select>
           </div>
         </template>
       </el-table-column>
 
       <el-table-column label="次数" prop="index" width="80">
         <template slot-scope="{ row, $index }">
-          <div
-            class="tag_box"
-            v-if="
-              Object.prototype.hasOwnProperty.call(row, 'extInfo') &&
-              Object.prototype.hasOwnProperty.call(
-                row.extInfo,
-                'productionTimes'
-              ) &&
-              Object.prototype.hasOwnProperty.call(
-                row.extInfo.productionTimes,
-                item.currentTaskDiagram.taskId
-              )
-            "
-          >
+          <div class="tag_box" v-if="
+            Object.prototype.hasOwnProperty.call(row, 'extInfo') &&
+            Object.prototype.hasOwnProperty.call(
+              row.extInfo,
+              'productionTimes'
+            ) &&
+            Object.prototype.hasOwnProperty.call(
+              row.extInfo.productionTimes,
+              item.currentTaskDiagram.taskId
+            )
+          ">
             {{ row.extInfo.productionTimes[item.currentTaskDiagram.taskId] }}
           </div>
 
@@ -365,12 +228,12 @@
           {{ row.specification }}
         </template>
       </el-table-column>
-    
-      <!-- <el-table-column label="牌号" prop="brandNum">
+
+      <el-table-column label="牌号" prop="brandNum">
         <template slot-scope="{ row, $index }">
           {{ row.brandNum }}
         </template>
-      </el-table-column> -->
+      </el-table-column>
 
       <!-- <el-table-column label="包装库存" prop="brandNum">
         <template slot-scope="{ row, $index }">
@@ -386,20 +249,11 @@
       </el-table-column>
     </el-table>
 
-    <el-dialog
-      title="工序计算列表"
-      :visible.sync="show"
-      :before-close="cancel"
-      :close-on-click-modal="false"
-      :close-on-press-escape="false"
-      append-to-body
-      width="800px"
-    >
+    <el-dialog title="工序计算列表" :visible.sync="show" :before-close="cancel" :close-on-click-modal="false"
+      :close-on-press-escape="false" append-to-body width="800px">
       <div class="material">
         <div class="btn_end">
-          <el-button type="primary" size="mini" @click="handAddParam"
-            >添加</el-button
-          >
+          <el-button type="primary" size="mini" @click="handAddParam">添加</el-button>
         </div>
         <div class="content_table2">
           <div class="head row rx-sc">
@@ -413,501 +267,535 @@
           <div class="table">
             <div class="tr row rx-sc" v-for="(it, idx) in paramList" :key="idx">
               <div class="item ww30">
-                <el-select
-                  size="mini"
-                  class="content_num"
-                  filterable
-                  v-model="it.taskId"
-                  placeholder="请选择"
-                >
-                  <el-option
-                    v-for="item in stepsList"
-                    :label="item.taskTypeName"
-                    :value="item.taskId"
-                    :key="item.taskId"
-                  >
+                <el-select size="mini" class="content_num" filterable v-model="it.taskId" placeholder="请选择">
+                  <el-option v-for="item in stepsList" :label="item.taskTypeName" :value="item.taskId"
+                    :key="item.taskId">
                   </el-option>
                 </el-select>
               </div>
 
               <div class="item ww20">
-                <el-input
-                  class="content_num"
-                  size="mini"
-                  v-model="it.billet"
-                  type="digit"
-                  @input="changeInp(it, idx)"
-                ></el-input>
+                <el-input class="content_num" size="mini" v-model="it.billet" type="digit"
+                  @input="changeInp(it, idx)"></el-input>
               </div>
 
               <div class="item ww20">
-                <el-input
-                  class="content_num"
-                  size="mini"
-                  v-model="it.density"
-                  type="digit"
-                  @input="changeInp(it, idx)"
-                ></el-input>
+                <el-input class="content_num" size="mini" v-model="it.density" type="digit"
+                  @input="changeInp(it, idx)"></el-input>
               </div>
 
-              <div
-                class="item ww20"
-                v-if="idx == 0 || idx != paramList.length - 1"
-              >
-                < {{ it.CVIWeight }}
-              </div>
+              <div class="item ww20" v-if="idx == 0 || idx != paramList.length - 1">
+                < {{ it.CVIWeight }} </div>
 
-              <div
-                class="item ww20"
-                v-if="paramList.length > 1 && idx == paramList.length - 1"
-              >
-                ≥ {{ it.CVIWeight }}
-              </div>
+                  <div class="item ww20" v-if="paramList.length > 1 && idx == paramList.length - 1">
+                    ≥ {{ it.CVIWeight }}
+                  </div>
 
-              <div class="item ww20 rx-cc" @click="getDelete2(idx)">
-                <el-link type="danger">删除</el-link>
+                  <div class="item ww20 rx-cc" @click="getDelete2(idx)">
+                    <el-link type="danger">删除</el-link>
+                  </div>
               </div>
             </div>
           </div>
-        </div>
 
-        <div class="formula_box">计算公式: 物料重量/坯体密度*密度系数 </div>
+          <div class="formula_box">计算公式: 物料重量/坯体密度*密度系数 </div>
 
-        <div class="reportWeight rx-sc">
-          物料重量: {{ weight }} ; 报工重量: {{ reportWeight }}
+          <div class="reportWeight rx-sc">
+            物料重量: {{ weight }} ; 报工重量: {{ reportWeight }}
+          </div>
         </div>
-      </div>
-
-      <template slot="footer">
-        <el-button size="mini" type="primary" @click="paramSave"
-          >保存并计算</el-button
-        >
-        <el-button size="mini" type="primary" @click="save">计算</el-button>
-        <el-button size="mini" @click="cancel">取消</el-button>
-      </template>
+
+        <template slot="footer">
+          <el-button size="mini" type="primary" @click="paramSave">保存并计算</el-button>
+          <el-button size="mini" type="primary" @click="save">计算</el-button>
+          <el-button size="mini" @click="cancel">取消</el-button>
+        </template>
     </el-dialog>
   </div>
 </template>
 
 <script>
-  import {
-    getTaskInstanceList,
-    getComputeParam,
-    saveParam
-  } from '@/api/produce/job';
+import {
+  getTaskInstanceList,
+  getComputeParam,
+  saveParam
+} from '@/api/produce/job';
 
 
-  export default {
-    name: 'semiProductJobBom',
+export default {
+  name: 'semiProductJobBom',
 
-    props: {
-      list: {
-        type: Array,
-        default: () => []
-      },
-      equipmentList: {
-        type: Array,
-        default: () => []
-      },
+  props: {
+    list: {
+      type: Array,
+      default: () => []
+    },
+    equipmentList: {
+      type: Array,
+      default: () => []
+    },
 
-      item: {
-        type: Object,
-        default: () => {}
-      },
-      isDetails: {
-        type: Boolean,
-        default: false
-      },
-      singleReport: {
-        default: null
+    item: {
+      type: Object,
+      default: () => { }
+    },
+    isDetails: {
+      type: Boolean,
+      default: false
+    },
+    singleReport: {
+      default: null
+    }
+  },
+
+  watch: {
+    equipmentList: {
+      immediate: true,
+      deep: true,
+      handler(newVal) {
+        this.deviceList = newVal;
+        this.changeHeatNumber();
       }
     },
+    list: {
+      immediate: true,
+      deep: true,
+      handler(newVal) {
+        if (newVal.length) {
+          console.log(newVal);
+          this.sumweight(newVal);
+          this.newList = newVal;
+          this.sunTj();
 
-    watch: {
-      equipmentList: {
-        immediate: true,
-        deep: true,
-        handler(newVal) {
-          this.deviceList = newVal;
-          this.changeHeatNumber();
         }
       }
     },
+  },
 
-    data() {
-      return {
-        deviceList: [],
-
-        stepsList: [],
-
-        weight: 0,
-        reportWeight: 0,
-
-        paramList: [],
-
-        resultObj: {},
-        resultIdx: 0,
-
-        show: false,
-
-
-        
-				isQualifiedList: [{
-						code: 1,
-						name: '合格'
-					},
-					{
-						code: 2,
-						name: '不合格'
-					}
-				],
-
-				notTypeList: [{
-						code: 1,
-						name: '返工'
-					},
-					{
-						code: 2,
-						name: '返修'
-					},
-					{
-						code: 3,
-						name: '报废'
-					},
-					{
-						code: 4,
-						name: '降级使用'
-					},
-					{
-						code: 5,
-						name: '让步接收'
-					}
-				]
-      };
-    },
+  created() {
+    this.getTaskFn();
+  },
 
-    methods: {
-      getTaskFn() {
-        getTaskInstanceList(this.item.workOrderId).then((res) => {
-          this.stepsList = res;
-        });
-      },
 
-      changeHeatNumber() {
-        this.deviceList.forEach((f) => {
-          this.list.forEach((o) => {
-            if (
-              o.deviceId &&
-              f.instanceId == o.deviceId &&
-              this.deviceList.length > 1
-            ) {
-              o.extInfo.heatNumber = f.extInfo.heatNumber;
-              this.$forceUpdate();
-            } else if (this.deviceList.length == 1) {
-              o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
-              this.$forceUpdate();
-            }
-          });
-        });
-      },
+  // item
+  data() {
+    return {
+      deviceList: [],
+      newList: [],
+      stepsList: [],
 
-      selectName(value, idx) {
-        const taskObj = this.stepsList.find((item) => item.taskId === value);
-        this.$set(this.list[idx].extInfo, 'taskName', taskObj.taskTypeName);
-        this.$forceUpdate();
-      },
+      weight: 0,
+      reportWeight: 0,
 
-      openNumerate(row, idx) {
-        if (!row.extInfo.reportWeight) {
-          this.$message({ message: '请先输入报工重量', type: 'warning' });
-          return false;
-        }
-        this.weight = row.extInfo.weight;
-        this.reportWeight = row.extInfo.reportWeight;
-        this.resultIdx = idx;
+      paramList: [],
 
-        this.show = true;
-      },
+      resultObj: {},
+      resultIdx: 0,
 
-      getCompute() {
-        getComputeParam(
-          this.item.workOrderId,
-          this.item.currentTaskDiagram.taskId
-        ).then((res) => {
-          this.paramList = [];
-          this.paramList = (res && res.paramList) || [];
-          this.paramObj = res || {};
-        });
-      },
+      show: false,
 
-      handAddParam() {
-        this.paramList.push({
-          taskId: null,
-          taskName: null
-        });
-      },
-      getDelete(idx) {
-        this.list.splice(idx, 1);
-      },
 
-      getDelete2(idx) {
-        this.paramList.splice(idx, 1);
-      },
 
-      changeInp(item, index) {
-        if (Number(item.billet) && Number(item.density)) {
-          this.paramList[index].CVIWeight = (
-            (Number(this.weight) / item.billet) *
-            item.density
-          ).toFixed(2);
-        }
+      isQualifiedList: [{
+        code: 1,
+        name: '合格'
       },
+      {
+        code: 2,
+        name: '不合格'
+      }
+      ],
 
-      cancel() {
-        this.show = false;
-        this.reportWeight = 0;
-        this.weight = 0;
+      notTypeList: [{
+        code: 1,
+        name: '返工'
       },
-
-      paramSave() {
-        if (this.paramList.length > 0) {
-          let bol;
-          let _i;
-          bol = this.paramList.every((e, i) => {
-            _i = i + 1;
-            return e.taskId && e.billet && e.density;
-          });
-
-          if (!bol) {
-            this.$message({ message: `第${_i}行数据不全`, type: 'warning' });
-
-            return false;
-          }
-
-          if (this.paramList.length < 1) {
-            this.$message({
-              message: '请输入二个以上计算数据',
-              type: 'warning'
-            });
-
-            return false;
+      {
+        code: 2,
+        name: '返修'
+      },
+      {
+        code: 3,
+        name: '报废'
+      },
+      {
+        code: 4,
+        name: '降级使用'
+      },
+      {
+        code: 5,
+        name: '让步接收'
+      }
+      ]
+    };
+  },
+
+  methods: {
+    sunTj() {
+      this.item.workReportInfo.formedNum = this.newList.filter(v => v.extInfo.isQualified == 1).length;
+      this.item.workReportInfo.notFormedNum = this.newList.filter(v => v.extInfo.isQualified !== 1).length;
+    },
+    sumweight(arr) {
+      console.log(arr, 666);
+      let formedWeight = 0;
+      let noFormedWeight = 0;
+      arr.map(s => {
+        if (s.extInfo.reportWeight) {
+          if (s.extInfo.isQualified == 1) {
+            formedWeight += s.extInfo.reportWeight * 1;
+          } else {
+            noFormedWeight += s.extInfo.reportWeight * 1;
           }
-        }
-        let param = {};
-
-        if (!Object.prototype.hasOwnProperty.call(this.paramObj, 'id')) {
-          param = {
-            paramList: this.paramList,
-            workOrderId: this.item.workOrderId,
-            taskId: this.item.currentTaskDiagram.taskId
-          };
         } else {
-          this.paramObj.paramList = this.paramList;
-          param = this.paramObj;
+          s.extInfo.reportWeight = null;
         }
+      })
 
-        saveParam(param).then((res) => {
-          this.$message({ message: '保存成功', type: 'success' });
-          this.getCompute();
+      this.item.workReportInfo.formedWeight = formedWeight;
+      this.item.workReportInfo.notFormedWeight = noFormedWeight;
+    },
 
-          this.save();
-        });
-      },
 
-      save() {
-        if (this.item.currentTaskDiagram.isFirstTask == 1) {
-          this.resultObj = {};
+    handlerSelect() {
+      this.sunTj();
+      this.sumweight(this.list);
+    },
 
-          if (Number(this.reportWeight) < Number(this.paramList[0].CVIWeight)) {
-            this.resultObj = this.paramList[0];
-            this.setDataSave();
-            return false;
-          }
+    handleInput() {
+      let arr = JSON.parse(JSON.stringify(this.list));
+      this.sumweight(arr);
+      this.sunTj();
+      this.$set(this, 'list', arr);
+    },
 
+    changeHeatNumber() {
+      if (this.deviceList.length > 0) {
+        const device = this.deviceList[0];
+        this.$emit('update:heatNumber', device.heatNumber);
+      }
+    },
+
+    getTaskFn() {
+      getTaskInstanceList(this.item.workOrderId).then((res) => {
+        this.stepsList = res;
+      });
+    },
+
+    changeHeatNumber() {
+      this.deviceList.forEach((f) => {
+        this.list.forEach((o) => {
           if (
-            Number(this.reportWeight) >=
-            this.paramList[this.paramList.length - 1].CVIWeight
+            o.deviceId &&
+            f.instanceId == o.deviceId &&
+            this.deviceList.length > 1
           ) {
-            this.resultObj = this.paramList[this.paramList.length - 1];
-            this.setDataSave();
-            return false;
+            o.extInfo.heatNumber = f.extInfo.heatNumber;
+            this.$forceUpdate();
+          } else if (this.deviceList.length == 1) {
+            o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
+            this.$forceUpdate();
           }
+        });
+      });
+    },
 
-          for (let i = 1; i < this.paramList.length; i++) {
-            console.log(
-              11,
-              Number(this.paramList[i - 1].CVIWeight),
-              Number(this.reportWeight)
-            );
-            if (
-              Number(this.paramList[i - 1].CVIWeight) <
-                Number(this.reportWeight) &&
-              Number(this.reportWeight) < Number(this.paramList[i].CVIWeight)
-            ) {
-              this.resultObj = this.paramList[i];
-              break;
-            }
-          }
-          this.setDataSave();
-        }
-      },
+    selectName(value, idx) {
+      const taskObj = this.stepsList.find((item) => item.taskId === value);
+      this.$set(this.list[idx].extInfo, 'taskName', taskObj.taskTypeName);
+      this.$forceUpdate();
+    },
 
-      setDataSave() {
-        this.$set(
-          this.list[this.resultIdx].extInfo,
-          'taskId',
-          this.resultObj.taskId
-        );
-        this.$set(
-          this.list[this.resultIdx].extInfo,
-          'density',
-          this.resultObj.density
-        );
-        this.$set(
-          this.list[this.resultIdx].extInfo,
-          'billet',
-          this.resultObj.billet
-        );
-        this.$set(
-          this.list[this.resultIdx].extInfo,
-          'taskName',
-          this.resultObj.taskName
-        );
-
-        this.cancel();
+    openNumerate(row, idx) {
+      if (!row.extInfo.reportWeight) {
+        this.$message({ message: '请先输入报工重量', type: 'warning' });
+        return false;
       }
+      this.weight = row.extInfo.weight;
+      this.reportWeight = row.extInfo.reportWeight;
+      this.resultIdx = idx;
+
+      this.show = true;
     },
 
-    created() {
-      this.getTaskFn();
-      this.getCompute();
-    }
-  };
-</script>
+    getCompute() {
+      getComputeParam(
+        this.item.workOrderId,
+        this.item.currentTaskDiagram.taskId
+      ).then((res) => {
+        this.paramList = [];
+        this.paramList = (res && res.paramList) || [];
+        this.paramObj = res || {};
+      });
+    },
 
-<style lang="scss" scoped>
-  .tag_box {
-    display: inline-block;
-    padding: 1px 6px;
-    margin-right: 6px;
-    background: #e6a23c;
-    font-size: 11px;
-    color: #fff;
-    border-radius: 2px;
-  }
+    handAddParam() {
+      this.paramList.push({
+        taskId: null,
+        taskName: null
+      });
+    },
+    getDelete(idx) {
+      this.list.splice(idx, 1);
+    },
 
-  .content_num2 {
-    --input-background-color: #f0f8f2;
-  }
+    getDelete2(idx) {
+      this.paramList.splice(idx, 1);
+    },
 
-  .numerate {
-    font-size: 22rpx;
-    color: #157a2c;
-    cursor: pointer;
-  }
+    changeInp(item, index) {
+      if (Number(item.billet) && Number(item.density)) {
+        this.paramList[index].CVIWeight = (
+          (Number(this.weight) / item.billet) *
+          item.density
+        ).toFixed(2);
+      }
+    },
 
-  .material {
-    width: 100%;
-  }
+    cancel() {
+      this.show = false;
+      this.reportWeight = 0;
+      this.weight = 0;
+    },
 
-  .btn_end {
-    text-align: right;
-    margin-bottom: 10px;
-  }
+    paramSave() {
+      if (this.paramList.length > 0) {
+        let bol;
+        let _i;
+        bol = this.paramList.every((e, i) => {
+          _i = i + 1;
+          return e.taskId && e.billet && e.density;
+        });
 
-  .content_table2 {
-    width: 100%;
+        if (!bol) {
+          this.$message({ message: `第${_i}行数据不全`, type: 'warning' });
 
-    .row {
-      width: 100%;
+          return false;
+        }
 
-      .item {
-        color: #404446;
-        font-size: 14px;
-        padding-left: 6px;
-      }
+        if (this.paramList.length < 1) {
+          this.$message({
+            message: '请输入二个以上计算数据',
+            type: 'warning'
+          });
 
-      .color157 {
-        color: #157a2c;
+          return false;
+        }
       }
-
-      .ww20 {
-        width: 20%;
+      let param = {};
+
+      if (!Object.prototype.hasOwnProperty.call(this.paramObj, 'id')) {
+        param = {
+          paramList: this.paramList,
+          workOrderId: this.item.workOrderId,
+          taskId: this.item.currentTaskDiagram.taskId
+        };
+      } else {
+        this.paramObj.paramList = this.paramList;
+        param = this.paramObj;
       }
 
-      .ww30 {
-        width: 30%;
-      }
+      saveParam(param).then((res) => {
+        this.$message({ message: '保存成功', type: 'success' });
+        this.getCompute();
 
-      .ww25 {
-        width: 25%;
-      }
+        this.save();
+      });
+    },
 
-      .ww35 {
-        width: 35%;
-      }
+    save() {
+      if (this.item.currentTaskDiagram.isFirstTask == 1) {
+        this.resultObj = {};
 
-      .ww10 {
-        width: 10%;
+        if (Number(this.reportWeight) < Number(this.paramList[0].CVIWeight)) {
+          this.resultObj = this.paramList[0];
+          this.setDataSave();
+          return false;
+        }
+
+        if (
+          Number(this.reportWeight) >=
+          this.paramList[this.paramList.length - 1].CVIWeight
+        ) {
+          this.resultObj = this.paramList[this.paramList.length - 1];
+          this.setDataSave();
+          return false;
+        }
+
+        for (let i = 1; i < this.paramList.length; i++) {
+          console.log(
+            11,
+            Number(this.paramList[i - 1].CVIWeight),
+            Number(this.reportWeight)
+          );
+          if (
+            Number(this.paramList[i - 1].CVIWeight) <
+            Number(this.reportWeight) &&
+            Number(this.reportWeight) < Number(this.paramList[i].CVIWeight)
+          ) {
+            this.resultObj = this.paramList[i];
+            break;
+          }
+        }
+        this.setDataSave();
       }
+    },
+
+    setDataSave() {
+      this.$set(
+        this.list[this.resultIdx].extInfo,
+        'taskId',
+        this.resultObj.taskId
+      );
+      this.$set(
+        this.list[this.resultIdx].extInfo,
+        'density',
+        this.resultObj.density
+      );
+      this.$set(
+        this.list[this.resultIdx].extInfo,
+        'billet',
+        this.resultObj.billet
+      );
+      this.$set(
+        this.list[this.resultIdx].extInfo,
+        'taskName',
+        this.resultObj.taskName
+      );
+
+      this.cancel();
     }
+  },
 
-    .head {
-      height: 32px;
-      background: #f7f9fa;
-      border-top: 1px solid #e3e5e5;
-      border-left: 1px solid #e3e5e5;
-
-      .item {
-        height: 32px;
-        line-height: 32px;
-        border-right: 1px solid #e3e5e5;
-        box-sizing: border-box;
-      }
+  created() {
+    this.getTaskFn();
+    this.getCompute();
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.tag_box {
+  display: inline-block;
+  padding: 1px 6px;
+  margin-right: 6px;
+  background: #e6a23c;
+  font-size: 11px;
+  color: #fff;
+  border-radius: 2px;
+}
+
+.content_num2 {
+  --input-background-color: #f0f8f2;
+}
+
+.numerate {
+  font-size: 22rpx;
+  color: #157a2c;
+  cursor: pointer;
+}
+
+.material {
+  width: 100%;
+}
+
+.btn_end {
+  text-align: right;
+  margin-bottom: 10px;
+}
+
+.content_table2 {
+  width: 100%;
+
+  .row {
+    width: 100%;
+
+    .item {
+      color: #404446;
+      font-size: 14px;
+      padding-left: 6px;
     }
 
-    .tr {
-      border-top: 1px solid #e3e5e5;
-      border-left: 1px solid #e3e5e5;
-
-      .item {
-        font-size: 12px;
-        min-height: 32px;
-        display: flex;
-        align-items: center;
-        border-right: 1px solid #e3e5e5;
-        box-sizing: border-box;
-        white-space: normal;
-        word-break: break-all;
-      }
+    .color157 {
+      color: #157a2c;
+    }
 
-      &:last-child {
-        border-bottom: 1px solid #e3e5e5;
-      }
+    .ww20 {
+      width: 20%;
     }
-  }
 
-  .formula_box {
-    font-size: 12px;
-    font-style: normal;
-    font-weight: 400;
-    margin-top: 15px;
-    color: #157a2c;
+    .ww30 {
+      width: 30%;
+    }
+
+    .ww25 {
+      width: 25%;
+    }
+
+    .ww35 {
+      width: 35%;
+    }
+
+    .ww10 {
+      width: 10%;
+    }
   }
 
-  .reportWeight {
-    font-size: 12px;
-    font-style: normal;
-    font-weight: 400;
-    margin-top: 15px;
-    color: #157a2c;
+  .head {
+    height: 32px;
+    background: #f7f9fa;
+    border-top: 1px solid #e3e5e5;
+    border-left: 1px solid #e3e5e5;
+
+    .item {
+      height: 32px;
+      line-height: 32px;
+      border-right: 1px solid #e3e5e5;
+      box-sizing: border-box;
+    }
   }
 
-  .content_num {
-    display: flex;
-    align-items: center;
-    padding: 2px;
-    --input-background-color: #f0f8f2;
-  
+  .tr {
+    border-top: 1px solid #e3e5e5;
+    border-left: 1px solid #e3e5e5;
+
+    .item {
+      font-size: 12px;
+      min-height: 32px;
+      display: flex;
+      align-items: center;
+      border-right: 1px solid #e3e5e5;
+      box-sizing: border-box;
+      white-space: normal;
+      word-break: break-all;
+    }
+
+    &:last-child {
+      border-bottom: 1px solid #e3e5e5;
+    }
   }
+}
+
+.formula_box {
+  font-size: 12px;
+  font-style: normal;
+  font-weight: 400;
+  margin-top: 15px;
+  color: #157a2c;
+}
+
+.reportWeight {
+  font-size: 12px;
+  font-style: normal;
+  font-weight: 400;
+  margin-top: 15px;
+  color: #157a2c;
+}
+
+.content_num {
+  display: flex;
+  align-items: center;
+  padding: 2px;
+  --input-background-color: #f0f8f2;
+
+}
 </style>

+ 49 - 16
src/views/produce/components/jobBooking/index.vue

@@ -1,6 +1,16 @@
 <template>
   <div>
     <div class="top_fixed">
+
+      <div style="display: flex;align-items: center;margin-right: 10px;" v-if="List.length>1">
+        <div class="rx-bc">
+          <div class="name">批量报工时间:</div>
+        </div>
+        <el-date-picker v-model="executorTime" type="datetime" value-format="yyyy-MM-dd HH:dd:ss"
+          placeholder="选择日期" @change="handleCreate">
+        </el-date-picker>
+      </div>
+
       <el-button type="primary" size="mini" @click="save(2, 'all')">一键报工</el-button>
       <el-button type="primary" size="mini" @click="removeCacheFn('all')">清空缓存</el-button>
       <el-button v-if="taskObj.type == 1" type="primary" size="mini" @click="save(1, 'all')">缓存</el-button>
@@ -22,11 +32,12 @@
         <workOrderBom :item="item"></workOrderBom>
 
         <!-- 报工时间 -->
-        <div v-if="(clientEnvironmentId == 3 || clientEnvironmentId == 5) && item.currentTaskDiagram.type == 1">
+        <div v-if="item.currentTaskDiagram.type == 1">
           <div class="title_box rx-bc">
             <div class="name">报工时间</div>
           </div>
-          <el-date-picker v-model="item.executorTime" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
+          <el-date-picker v-model="item.executorTime" type="datetime" value-format="yyyy-MM-dd HH:dd:ss"
+            placeholder="选择日期">
           </el-date-picker>
         </div>
 
@@ -36,13 +47,14 @@
         <!-- //报工信息 -->
 
         <div v-if="item.singleReport !== 1">
-          
+
           <jobBom :item="item" :notFormed="item.notFormedList" :warehouseList="warehouseList"></jobBom>
         </div>
         <div v-else>
-          
+
           <jobDdBom :item='item' ref='jobRef' :notFormed='item.notFormedList' :warehouseList="warehouseList"></jobDdBom>
         </div>
+        
 
         <!-- :item="item" :notFormed="item.notFormedList" :warehouseList="warehouseList"  @modeNum='modeNum'-->
 
@@ -84,7 +96,7 @@
           item.singleReport == 1
         " :item="item" :list="item.pickOutInList">
         </semiProductJobBom>
-     
+
 
         <oneJobQualityBomPL v-if="
           item.semiProductList &&
@@ -116,7 +128,7 @@
 
         <div v-if="item.currentTaskDiagram.type == 4">
           <semiProductJobBom :singleReport="item.singleReport" :item="item"
-            :list="item.currentTaskDiagram.type == 4? item.pickOutInList : item.semiProductList"
+            :list="item.currentTaskDiagram.type == 4 ? item.pickOutInList : item.semiProductList"
             :equipmentList="item.equipmentList"></semiProductJobBom>
         </div>
 
@@ -124,12 +136,12 @@
         <!--  <packingBom :taskId='taskObj.id' :workOrderId="item.workOrderId" :objData="item" ref="packRef"
           v-if='taskObj.type == 4 && clientEnvironmentId != 3 && item'></packingBom> -->
 
-        <packingTgBom v-if="
+        <!-- <packingTgBom v-if="
           item.pickOutInList &&
           item.pickOutInList.length != 0 &&
           taskObj.type == 4 &&
           clientEnvironmentId == 3
-        " :list="item.pickOutInList" :item="item"></packingTgBom>
+        " :list="item.pickOutInList" :item="item"></packingTgBom> -->
       </div>
 
     </div>
@@ -216,7 +228,7 @@ export default {
       List: [],
       idsList: [],
       isLoad: false,
-
+      executorTime:'',
       warehouseList: [],
 
       loading: null
@@ -251,7 +263,20 @@ export default {
     checkPack() {
       this.$refs.packagingGroupingRef[0].getData();
     },
+    handleCreate(e){
+
+      if(e){
+        const list = JSON.parse(JSON.stringify(this.List));
+        console.log(list);
+        list.map(item=>{
+          item.executorTime =e;
+        })
 
+        this.$set(this, 'List', list);
+        console.log(this.List);
+
+      }
+    },
 
     getList(ids) {
       this.idsList = ids || [];
@@ -330,18 +355,18 @@ export default {
                   a
                 };
               });
-        
+
               obj.semiProductList = JSON.parse(
                 JSON.stringify(obj.semiProductList)
               );
             }
             obj.semiProductList = obj.semiProductList.map(item => {
-                if (item['extInfo']?.reportWeight) {
-                  item['extInfo'].reportWeight = ''
-                }
-                console.log(item,'item')
-                return item
-              })
+              if (item['extInfo']?.reportWeight) {
+                item['extInfo'].reportWeight = ''
+              }
+              console.log(item, 'item')
+              return item
+            })
             obj.workReportInfo = {
               formingNum: null,
               formingWeight: null,
@@ -534,6 +559,14 @@ export default {
         });
       }
 
+      let arr = this.List.filter((L) => L.executorTime)
+
+      if (!arr.length) {
+        this.loading.close();
+        return this.$message.warning('请选择执行时间');
+      }
+
+
       console.log(this.List, 'this.List');
       jobSave(this.List)
         .then((res) => {

+ 4 - 3
src/views/produce/components/picking/index.vue

@@ -1,5 +1,6 @@
 <template>
-  <el-dialog title="新建领料单" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
+  <ele-modal title="新建领料单" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
+    :maxable="true"
     :close-on-press-escape="false" append-to-body width="80%">
     <el-form>
       <el-row :gutter="24">
@@ -99,7 +100,7 @@
                     row.demandQuantity > row.availableCountBase
                       ? (row.demandQuantity = row.availableCountBase)
                       : row.demandQuantity
-                    " size="mini">
+                    " size="mini" style="width: 150px">
                     <template slot="append">{{ row.measuringUnit }}</template>
                   </el-input>
                 </el-form-item>
@@ -151,7 +152,7 @@
     </template>
 
     <pickingList isType="pick" ref="pickingListRef" @allSelection="allSelection"></pickingList>
-  </el-dialog>
+  </ele-modal>
 </template>
 
 <script>

+ 31 - 21
src/views/produce/components/produceOrder.vue

@@ -2,12 +2,9 @@
   <div>
 
     <ele-pro-table ref="table" :columns="columns" height="calc(100vh - 280px)" width="100%" :datasource="datasource"
-      :selection.sync="selection" @selection-change="handleSelectionChange" @cell-click="cellClick" cache-key="produceOrderZ"
-      highlight-current-row @select="cellClick" :need-page="false"
-      
-      
-      
-      >
+      :selection.sync="selection" @selection-change="handleSelectionChange" @cell-click="cellClick"
+      cache-key="produceOrderZ" highlight-current-row @select="cellClick" :need-page="false"
+      @sort-change="onSortChange">
       <!-- <template v-slot:toolbar>
         <div class="rx-bc">
           <div class="c_title">工单列表 </div>
@@ -128,8 +125,8 @@ export default {
           slot: 'singleReport',
           label: '报工类型',
           align: 'center',
-          filters: [{text:'单个报工',value:1},{text:'批量报工',value:0}],
-         filterMethod: this.filterMethod,
+          filters: [{ text: '单个报工', value: 1 }, { text: '批量报工', value: 0 }],
+          filterMethod: this.filterMethod,
           width: 100
         },
 
@@ -183,13 +180,14 @@ export default {
           showOverflowTooltip: true,
           minWidth: 110
         },
-        
+
         {
           slot: 'taskName',
           prop: 'taskName',
           label: '工序进度',
           align: 'center',
           showOverflowTooltip: true,
+          sortable: 'custom',
           minWidth: 110
         },
         {
@@ -273,10 +271,10 @@ export default {
   },
   methods: {
     filterMethod(value, row, column) {
-        if (value==row.singleReport) {
-          return row;
-        }
-      },
+      if (value == row.singleReport) {
+        return row;
+      }
+    },
     sumStatus(row) {
 
       if (row.reportStatus === 1) {
@@ -287,7 +285,7 @@ export default {
       }
       // {{  row.reportStatus }}  {{  row.feedStatus }}
     },
-  
+
     /* 表格数据源 */
     datasource({ page, where }) {
       return workorderPage2({
@@ -298,13 +296,25 @@ export default {
           : null,
         taskId: this.taskObj && this.taskObj.id,
         deviceId: this.current && this.current.deviceId,
-        code: this.code,
+        keyWord: this.keyWord,
+        taskName: this.taskName,
         ...where
       });
     },
 
-    handleSearch(code) {
-      this.code = code;
+    onSortChange(e) {
+      console.log(e);
+      let sort = {
+        orderBy: e.order,
+        sortName: e.prop
+      };
+      this.where = sort;
+      this.reload();
+    },
+    handleSearch(obj) {
+      this.keyWord = obj.keyWord;
+      this.taskName = obj.taskName;
+
       this.reload()
     },
 
@@ -337,15 +347,15 @@ export default {
         return item.id;
       });
 
-      this.$emit('workSelect', {ids:ids,list:val});
+      this.$emit('workSelect', { ids: ids, list: val });
     },
 
     rowClick(e) {
       this.$emit('rowClick', e, this.taskObj.id);
     },
-    cellClick(){
-      this.$nextTick(()=>{
-        this.$emit('getTaskName',this.selection)
+    cellClick() {
+      this.$nextTick(() => {
+        this.$emit('getTaskName', this.selection)
       })
 
     },

+ 9 - 4
src/views/produce/index.vue

@@ -34,7 +34,8 @@
       <div style="width: calc(100% - 220px);">
         <div class="seek-list" style="background-color: #157A2C;">
           <div>
-            <el-input style="width: 180px" clearable v-model="code" placeholder="请输入工单号" />
+            <el-input style="width: 180px;margin-right: 5px;" clearable v-model="keyWord" placeholder="请输入关键字" />
+            <!-- <el-input style="width: 180px" clearable v-model="taskName" placeholder="请输入工序进度" /> -->
             <!--  -->
             <el-button size="mini" type="primary" style="margin: 0 5px" @click="handleSearch">查询</el-button>
           </div>
@@ -175,7 +176,8 @@ export default {
   data() {
     return {
       activeName: '0',
-      code: '',//搜索
+      taskName:'',
+      keyWord: '',//搜索
       title: '',
       type: '',
       loading: false,
@@ -242,8 +244,11 @@ export default {
 
     },
     handleSearch() {
-
-      this.$refs.produceOrder.handleSearch(this.code)
+      let obj={
+        keyWord:this.keyWord,
+        taskName:this.taskName
+      }
+      this.$refs.produceOrder.handleSearch(obj);
       //handleSearch(this.code);
     },
 

+ 124 - 16
src/views/produceOrder/index.vue

@@ -2,12 +2,12 @@
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
 
-      <!-- <seek-page :seekList="seekList"></seek-page> -->
+      <seek-page :seekList="seekList" @search="search"></seek-page>
 
 
-      <produceOrder-search @search="reload" ref="searchRef" :statusOpt="statusOpt" :planType="planType"
+      <!-- <produceOrder-search @search="reload" ref="searchRef" :statusOpt="statusOpt" :planType="planType"
         :activeName="activeName">
-      </produceOrder-search>
+      </produceOrder-search> -->
 
 
 
@@ -160,7 +160,7 @@ export default {
     return {
       activeName: 'first',
       id: '',
-
+      where:{},
       // 加载状态
       loading: false,
       pageType: 'add',
@@ -187,38 +187,116 @@ export default {
   },
   computed: {
     // 表格列配置
-    seekList (){
+    seekList() {
       return [
         {
           label: "关键字:",
-          value: "",
+          value: "keyWord",
           type: "input",
-          key: '',
           placeholder: '',
-          width: 240,
+
         },
         {
           label: "生产工单号:",
-          value: "",
+          value: 'code',
           type: "input",
-          key: '',
           placeholder: '',
-          width: 240,
+          labelWidth: 100,
+        },
+        {
+          label: "计划编码:",
+          value: 'productionPlanCode',
+          type: "input",
+
+          placeholder: '',
+
         },
         {
           label: "计划类型:",
-          value: "",
+          value: 'planType',
           type: "select",
-          key: '',
+
           placeholder: '',
           width: 240,
           // 加载状态
           planList: this.planType
-        }
+        },
+        {
+          label: "工艺路线",
+          value: "produceRoutingName",
+          type: "input",
+
+          placeholder: '',
+          width: 240,
+        },
+        {
+          label: "产品编码",
+          value: "productCode",
+          type: "input",
+
+          placeholder: '',
+          width: 240,
+        },
+        {
+          label: "产品名称:",
+          value: "productName",
+          type: "input",
+
+          placeholder: '',
+          width: 240,
+        },
+        {
+          label: "牌号",
+          value: "brandNo",
+          type: "input",
+
+          placeholder: '',
+          width: 240,
+        },
+        {
+          label: "型号",
+          value: "model",
+          type: "input",
+
+          placeholder: '',
+          width: 240,
+        },
+        {
+          label: "状态:",
+          value: 'status',
+          type: "select",
+
+          placeholder: '',
+          width: 240,
+          // 加载状态
+          planList: this.statusOpt.first
+        },
+        {
+          label: "班组:",
+          value: 'teamId',
+          type: "select",
+          multiple:false, // 是否多选
+          filterable: true, // 是否可搜索
+          placeholder: '',
+          width: 240,
+          // 加载状态
+          planList: this.statusOpt.first
+        },
+        {
+          label: "创建时间:",
+          value: 'createTime',
+          type: "date",
+          dateType: 'daterange',
+          placeholder: '',
+          width: 240,
+          // 加载状态
+          planList: this.statusOpt.first
+        },
+
       ];
-    } ,
+    },
     columns() {
-      
+
 
 
       const opt = {
@@ -416,10 +494,37 @@ export default {
       return this.$store.state.user.info.clientEnvironmentId;
     }
   },
+  watch: {
+    activeName: {
+      handler() {
+        if (this.activeName) {
+          this.where.status = this.statusOpt[this.activeName][0].value;
+          this.reload();
+        }
+      },
+      immediate: true
+    }
+  },
   created() {
     this.getFieldModel();
   },
+
+  mounted() {
+
+    this.reload()
+  },
+
   methods: {
+
+    search(e){
+      if(Array.isArray(e.createTime)&&e.createTime.length){
+        e.createTimeStart=e.createTime[0];
+        e.createTimeEnd = e.createTime[1];
+      };
+      this.reload(e)
+    },
+
+
     // 查看序列号
     toView(row) {
       this.$refs.xlhRef.open(row)
@@ -614,6 +719,7 @@ export default {
 
     /* 刷新表格 */
     reload(where = {}) {
+      console.log(where,'wwwwwwwwwww');
       this.$nextTick(() => {
         where.statusList = (
           where.status || this.statusOpt[this.activeName][0].value
@@ -712,5 +818,7 @@ export default {
       updatePriority(params).then((res) => { });
     }, 800)
   }
+
 };
+
 </script>