quwangxin 2 ani în urmă
părinte
comite
dedb9e4446

+ 11 - 3
src/api/produceOrder/index.js

@@ -92,7 +92,7 @@ export async function reportCount (params) {
 
 // 详情页-tab列表
 export async function reportPage (data) {
-  const res = await request.post('/mes/workreport/page', data );
+  const res = await request.post('/mes/workreport/page', data);
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -108,11 +108,19 @@ export async function getInfoById (id) {
   return Promise.reject(new Error(res.data.message));
 }
 
-// 冲销接口 
+// 冲销接口
 export async function writeOffWork (data) {
   const res = await request.post(`/mes/workreport/writeOff`, data);
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}
+//包装要求
+export async function getPackageList (code) {
+  const res = await request.get(`/aps/workorder/getPackageList/${code} `);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 7 - 1
src/components/EquipmentDailog/equipment-dailog.vue

@@ -139,7 +139,12 @@
           this.$nextTick(() => {
             if (this.isSingle) {
               this.$refs.table.setCurrentRow(
-                data.find((item) => item.id == this.memoList[0].deviceId)
+                data.find(
+                  (item) =>
+                    item.id ==
+                    (this.memoList[0].deviceId ||
+                      this.memoList[0].sourceInstanceId)
+                )
               );
             } else {
               this.memoList.length &&
@@ -171,6 +176,7 @@
         this.cancel();
       },
       cancel () {
+        this.$refs.table.setCurrentRow();
         this.$refs.table.clearSelection();
         this.radio = '';
         this.current = null;

+ 36 - 15
src/views/produceOrder/components/report/Common.vue

@@ -5,6 +5,7 @@
     :show-message="false"
     label-position="left"
     :model="{
+      categoryMsg,
       ...workReport
     }"
   >
@@ -56,12 +57,12 @@
             label=""
             label-width="0"
             class="w100"
-            prop="packInfo.packNum"
+            prop="categoryMsg.number"
           >
             <el-input-number
               class="w100"
               :controls="false"
-              v-model="workReport.packInfo.packNum"
+              v-model="categoryMsg.number"
               :min="0"
               clearable
             ></el-input-number>
@@ -73,14 +74,13 @@
             label=""
             label-width="0"
             class="w100"
-            prop="packInfo.netWeight"
+            prop="categoryMsg.totalWeight"
             ><el-input
               readonly
               class="w100"
               :value="
-                (workReport.packInfo.netWeight =
-                  workReport.packInfo.packNum *
-                  (infoData.productUnitWeight || 1))
+                (categoryMsg.totalWeight =
+                  categoryMsg.number * (infoData.productUnitWeight || 1))
               "
               :min="0"
               clearable
@@ -216,15 +216,21 @@
     },
     data () {
       return {
+        categoryMsg: {
+          batchNo: '',
+          number: '',
+          totalWeight: '',
+          brandNum: '',
+          sourceCategoryId: '',
+          rootCategoryLevelId: '9',
+          name: '',
+          code: ''
+        },
         workReport: {
           executorId: '',
           executorJobNum: '',
           executorTime: '',
           remark: '',
-          packInfo: {
-            packNum: '',
-            netWeight: ''
-          },
           productInfo: {
             standardNum: '',
             standardWeight: '',
@@ -236,6 +242,8 @@
           code: '',
           name: '',
           path: '',
+          model: '',
+          rootCategoryLevelId: '',
           specification: ''
         },
         countMsg: {}
@@ -266,21 +274,31 @@
           (res) => {
             this.workReportDeviceList.code = res.code;
             this.workReportDeviceList.name = res.name;
-            this.workReportDeviceList.path = res.id;
+            this.workReportDeviceList.model = res.modelType;
+            this.workReportDeviceList.specification = res.specification;
+            this.workReportDeviceList.sourceInstanceId = res.id;
+            this.workReportDeviceList.rootCategoryLevelId =
+              res.rootCategoryLevelId;
+            this.workReportDeviceList.path = res.positionList[0]?.pathName;
           }
         );
       },
-      getMsg () {},
       report (fun) {
         this.$refs.formRef.validate((value) => {
           if (value) {
+            this.categoryMsg = Object.assign(this.categoryMsg, {
+              brandNum: this.infoData.brandNo,
+              sourceCategoryId: this.infoData.categoryId,
+              name: this.infoData.productName,
+              code: this.infoData.productCode
+            });
             fun({
               checkState: 1,
               workReport: this.workReport,
-              workReportDeviceList: [this.workReportDeviceList]
+              workReportDeviceList: [this.workReportDeviceList],
+              workReportCategoryList: [this.categoryMsg]
             }).then((res) => {
-              console.log(res);
-              this.getMsg();
+              this.getReportCount();
             });
           }
         });
@@ -302,6 +320,9 @@
     justify-content: space-between;
     align-items: center;
     margin-bottom: 16px;
+    .label {
+      margin-right: 5px;
+    }
     ul {
       list-style: none;
       display: flex;

+ 102 - 32
src/views/produceOrder/components/report/Furnace.vue

@@ -1,41 +1,85 @@
 <template>
-  <el-form :inline="true">
+  <el-form
+    class="form-no-message"
+    ref="formRef"
+    :show-message="false"
+    label-position="left"
+    :model="{
+      ...workReport
+    }"
+  >
     <div class="message-box">
       <ul>
-        <li> <span class="label">报工次数</span>2 </li>
-        <li> <span class="label">累计实际数量</span>2 </li>
+        <li> <span class="label">报工次数</span> {{ countMsg.reportNum }}</li>
+        <li>
+          <span class="label">累计实际数量</span>{{ countMsg.joinTotalNum }}
+        </li>
       </ul>
       <div class="right">
-        <el-form-item label="执行人工号"><el-input></el-input></el-form-item>
-        <el-form-item label="执行日期"><el-input></el-input></el-form-item>
+        <el-form-item
+          label="执行人工号"
+          prop="executorJobNum"
+          required
+          label-width="100px"
+          ><personSelectRemote
+            v-model="workReport.executorId"
+            placeholder="请输入"
+            @selfChange="
+              (val, item) => (workReport.executorJobNum = item.jobNumber)
+            "
+        /></el-form-item>
+        <el-form-item label="执行日期" prop="executorTime" label-width="100px"
+          ><el-date-picker
+            v-model="workReport.executorTime"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            type="datetime"
+            format="yyyy-MM-dd HH:mm"
+            placeholder="请选择"
+          ></el-date-picker
+        ></el-form-item>
       </div>
     </div>
     <el-card>
       <el-descriptions title="交接" direction="vertical" :column="7" border>
-        <el-descriptions-item label="待交接数量" :span="2"
-          >kooriookami</el-descriptions-item
-        >
+        <el-descriptions-item label="待交接数量" :span="2">{{
+          countMsg.surplusStandardNum
+        }}</el-descriptions-item>
         <el-descriptions-item label="实际数量(PCS)"
-          >kooriookami</el-descriptions-item
-        >
+          ><el-input v-model="categoryMsg.number"></el-input
+        ></el-descriptions-item>
       </el-descriptions>
-      <el-descriptions title="设备信息" direction="vertical" :column="7" border>
-        <el-descriptions-item label="设备编码"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="设备名称"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="规格">kooriookami</el-descriptions-item>
-        <el-descriptions-item label="型号">kooriookami</el-descriptions-item>
-        <el-descriptions-item label="设备位置"
-          >kooriookami</el-descriptions-item
-        >
+      <el-descriptions
+        title="设备信息"
+        class="mt-16"
+        direction="vertical"
+        :column="7"
+        border
+      >
+        <el-descriptions-item label="设备编码">{{
+          workReportDeviceList.code
+        }}</el-descriptions-item>
+        <el-descriptions-item label="设备名称">{{
+          workReportDeviceList.name
+        }}</el-descriptions-item>
+        <el-descriptions-item label="规格">{{
+          workReportDeviceList.specification
+        }}</el-descriptions-item>
+        <el-descriptions-item label="型号">{{
+          workReportDeviceList.model
+        }}</el-descriptions-item>
+
+        <el-descriptions-item label="设备位置">{{
+          workReportDeviceList.path
+        }}</el-descriptions-item>
         <el-descriptions-item label="操作"
-          ><el-link>更改设备</el-link></el-descriptions-item
+          ><el-link @click="getEquip">更改设备</el-link></el-descriptions-item
         >
       </el-descriptions>
     </el-card>
+    <equipmentDailog
+      ref="equipmentRef"
+      :produceVersionId="infoData.produceVersionId"
+    />
   </el-form>
 </template>
 
@@ -57,14 +101,20 @@
     },
     data () {
       return {
+        categoryMsg: {
+          batchNo: '',
+          number: '',
+          totalWeight: '',
+          brandNum: '',
+          sourceCategoryId: '',
+          rootCategoryLevelId: '9',
+          name: '',
+          code: ''
+        },
         workReport: {
           executorId: '',
           executorJobNum: '',
           executorTime: '',
-          packInfo: {
-            packNum: '',
-            netWeight: ''
-          },
           productInfo: {
             standardNum: '',
             standardWeight: '',
@@ -76,6 +126,8 @@
           code: '',
           name: '',
           path: '',
+          model: '',
+          rootCategoryLevelId: '',
           specification: ''
         },
         countMsg: {}
@@ -95,6 +147,7 @@
       async getReportCount () {
         const res = await reportCount({
           taskCode: this.taskInfo.code,
+          lastTaskCode: this.taskInfo.lastTaskCode,
           workOrderId: this.infoData.id
         });
 
@@ -106,21 +159,31 @@
           (res) => {
             this.workReportDeviceList.code = res.code;
             this.workReportDeviceList.name = res.name;
-            this.workReportDeviceList.path = res.id;
+            this.workReportDeviceList.model = res.modelType;
+            this.workReportDeviceList.specification = res.specification;
+            this.workReportDeviceList.sourceInstanceId = res.id;
+            this.workReportDeviceList.rootCategoryLevelId =
+              res.rootCategoryLevelId;
+            this.workReportDeviceList.path = res.positionList[0]?.pathName;
           }
         );
       },
-      getMsg () {},
       report (fun) {
         this.$refs.formRef.validate((value) => {
           if (value) {
+            this.categoryMsg = Object.assign(this.categoryMsg, {
+              brandNum: this.infoData.brandNo,
+              sourceCategoryId: this.infoData.categoryId,
+              name: this.infoData.productName,
+              code: this.infoData.productCode
+            });
             fun({
               checkState: 1,
               workReport: this.workReport,
-              workReportDeviceList: [this.workReportDeviceList]
+              workReportDeviceList: [this.workReportDeviceList],
+              workReportCategoryList: [this.categoryMsg]
             }).then((res) => {
-              console.log(res);
-              this.getMsg();
+              this.getReportCount();
             });
           }
         });
@@ -134,6 +197,10 @@
     display: flex;
     justify-content: space-between;
     align-items: center;
+    margin-bottom: 16px;
+    .label {
+      margin-right: 5px;
+    }
     ul {
       list-style: none;
       display: flex;
@@ -149,6 +216,9 @@
       padding-top: 22px;
       display: flex;
       align-items: center;
+      .el-form-item {
+        margin-left: 10px;
+      }
     }
   }
 </style>

+ 260 - 74
src/views/produceOrder/components/report/HalfAdded.vue

@@ -1,89 +1,213 @@
 <template>
-  <el-form :inline="true">
+  <el-form
+    class="form-no-message"
+    ref="formRef"
+    :show-message="false"
+    label-position="left"
+    :model="{
+      categoryMsg,
+      ...workReport
+    }"
+  >
     <div class="message-box">
       <ul>
-        <li> <span class="label">报工次数</span>2 </li>
-        <li> <span class="label">累计合格品数量</span>2 </li>
-        <li> <span class="label">累计合格品重量</span>2 </li>
-        <li> <span class="label">累计投料产品数量</span>2 </li>
+        <li> <span class="label">报工次数</span>{{ countMsg.reportNum }}</li>
+        <li>
+          <span class="label">累计合格品数量</span
+          >{{ countMsg.standardTotalNum }}</li
+        >
+        <li>
+          <span class="label">累计合格品重量</span
+          >{{ countMsg.standardTotalWeight }}</li
+        >
+        <li>
+          <span class="label">累计投料产品数量</span
+          >{{ countMsg.feedProductWeight }}</li
+        >
       </ul>
       <div class="right">
-        <el-form-item label="执行人工号"><el-input></el-input></el-form-item>
-        <el-form-item label="执行日期"><el-input></el-input></el-form-item>
+        <el-form-item
+          label="执行人工号"
+          prop="executorJobNum"
+          required
+          label-width="100px"
+          ><personSelectRemote
+            v-model="workReport.executorId"
+            placeholder="请输入"
+            @selfChange="
+              (val, item) => (workReport.executorJobNum = item.jobNumber)
+            "
+        /></el-form-item>
+        <el-form-item label="执行日期" prop="executorTime" label-width="100px"
+          ><el-date-picker
+            v-model="workReport.executorTime"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            type="datetime"
+            format="yyyy-MM-dd HH:mm"
+            placeholder="请选择"
+          ></el-date-picker
+        ></el-form-item>
       </div>
     </div>
     <el-card>
       <el-descriptions title="报工信息" direction="vertical" :column="7" border>
-        <el-descriptions-item label="投料数量(PCS)" :span="2"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="投料重量(KG)"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="舟皿编号/名称"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="舟皿数量"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="质检项">kooriookami</el-descriptions-item>
-        <el-descriptions-item label="质检标准"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="合格品数量(PCS)"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="合格品重量(KG)"
-          >kooriookami</el-descriptions-item
-        >
+        <el-descriptions-item label="">
+          <span class="label-required after" slot="label">投料数量(PCS)</span>
+          <el-form-item
+            label=""
+            label-width="0"
+            class="w100"
+            prop="categoryMsg.number"
+          >
+            <el-input-number
+              class="w100"
+              :controls="false"
+              v-model="categoryMsg.number"
+              :min="0"
+              clearable
+            ></el-input-number>
+          </el-form-item>
+        </el-descriptions-item>
+        <el-descriptions-item label="">
+          <span class="label-required after" slot="label">投料重量(KG)</span>
+          <el-form-item
+            label=""
+            label-width="0"
+            class="w100"
+            prop="categoryMsg.totalWeight"
+            ><el-input
+              readonly
+              class="w100"
+              :value="
+                (categoryMsg.totalWeight =
+                  categoryMsg.number * (infoData.productUnitWeight || 1))
+              "
+              :min="0"
+              clearable
+            ></el-input>
+          </el-form-item>
+        </el-descriptions-item>
+        <el-descriptions-item label="舟皿编号/名称" :span="2"
+          ><el-input
+            :value="`${boatMsg.code}/${boatMsg.name}`"
+            @click.native="getCategory('8', 'boatMsg')"
+          ></el-input
+        ></el-descriptions-item>
+        <el-descriptions-item label="舟皿数量" :span="3"
+          ><el-input
+            placeholder="请输入"
+            v-model="boatMsg.extraField.num"
+          ></el-input
+        ></el-descriptions-item>
+        <el-descriptions-item label="质检项" :span="2">{{
+          infoData.qualityItem
+        }}</el-descriptions-item>
+        <el-descriptions-item label="质检标准" :span="3">{{
+          infoData.qualityStandard
+        }}</el-descriptions-item>
+        <el-descriptions-item label="">
+          <span class="label-required after" slot="label">合格品数量(PCS)</span>
+          <el-form-item
+            label=""
+            label-width="0"
+            class="w100"
+            prop="productInfo.standardNum"
+            ><el-input-number
+              class="w100"
+              :controls="false"
+              v-model="workReport.productInfo.standardNum"
+              :min="0"
+              clearable
+            ></el-input-number> </el-form-item
+        ></el-descriptions-item>
+        <el-descriptions-item label=""
+          ><span class="label-required after" slot="label">合格品重量(KG)</span>
+          <el-form-item
+            label=""
+            label-width="0"
+            class="w100"
+            prop="productInfo.standardWeight"
+            ><el-input-number
+              readonly
+              class="w100"
+              :controls="false"
+              :value="
+                (workReport.productInfo.standardWeight =
+                  workReport.productInfo.standardNum *
+                  (infoData.productUnitWeight || 1))
+              "
+              :min="0"
+              clearable
+            ></el-input-number> </el-form-item
+        ></el-descriptions-item>
         <el-descriptions-item label="不合格品数量(PCS)">
-          <el-input>
-            <template slot="append">
-              <el-button type="primary">处置</el-button>
-            </template>
-          </el-input></el-descriptions-item
-        >
+          <el-input-number
+            class="w100"
+            :controls="false"
+            v-model="workReport.productInfo.noStandardNum"
+            :min="0"
+            clearable
+          ></el-input-number>
+        </el-descriptions-item>
         <el-descriptions-item label="不合格品重量(KG)"
-          ><el-input>
-            <template slot="append">
-              <el-button type="primary">处置</el-button>
-            </template>
-          </el-input></el-descriptions-item
-        >
+          ><el-input-number
+            class="w100"
+            readonly
+            :controls="false"
+            :value="
+              (workReport.productInfo.noStandardWeight =
+                workReport.noStandardNum * (infoData.productUnitWeight || 1))
+            "
+            :min="0"
+            clearable
+          ></el-input-number
+        ></el-descriptions-item>
         <el-descriptions-item label="副产品重量(KG)"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="备注" :span="2"
-          >kooriookami</el-descriptions-item
-        >
+          ><el-input-number
+            class="w100"
+            :controls="false"
+            v-model="workReport.productInfo.netWeight"
+            :min="0"
+            clearable
+          ></el-input-number
+        ></el-descriptions-item>
+        <el-descriptions-item label="备注">
+          <el-input v-model="workReport.remark"></el-input
+        ></el-descriptions-item>
       </el-descriptions>
       <el-descriptions
         title="设备信息"
+        class="mt-16"
         direction="vertical"
         :column="7"
         border
-        class="mt-16"
       >
-        <el-descriptions-item label="设备编码"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="设备名称"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="规格">kooriookami</el-descriptions-item>
-        <el-descriptions-item label="型号">kooriookami</el-descriptions-item>
-        <el-descriptions-item label="升温曲线"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="设备位置"
-          >kooriookami</el-descriptions-item
-        >
+        <el-descriptions-item label="设备编码">{{
+          workReportDeviceList.code
+        }}</el-descriptions-item>
+        <el-descriptions-item label="设备名称">{{
+          workReportDeviceList.name
+        }}</el-descriptions-item>
+        <el-descriptions-item label="规格">{{
+          workReportDeviceList.specification
+        }}</el-descriptions-item>
+        <el-descriptions-item label="型号">{{
+          workReportDeviceList.model
+        }}</el-descriptions-item>
 
+        <el-descriptions-item label="设备位置">{{
+          workReportDeviceList.path
+        }}</el-descriptions-item>
         <el-descriptions-item label="操作"
-          ><el-link type="primary">更改设备</el-link>
-        </el-descriptions-item>
+          ><el-link @click="getEquip">更改设备</el-link></el-descriptions-item
+        >
       </el-descriptions>
     </el-card>
+    <equipmentDailog
+      ref="equipmentRef"
+      :produceVersionId="infoData.produceVersionId"
+    />
+    <catogaryDialog ref="catogaryDialogRef" />
   </el-form>
 </template>
 
@@ -91,8 +215,9 @@
   import personSelectRemote from '@/components/CommomSelect/person-select-remote';
   import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
   import { reportCount } from '@/api/produceOrder';
+  import catogaryDialog from '../catogaryDialog.vue';
   export default {
-    components: { personSelectRemote, equipmentDailog },
+    components: { personSelectRemote, equipmentDailog, catogaryDialog },
     props: {
       infoData: {
         type: Object,
@@ -105,14 +230,21 @@
     },
     data () {
       return {
+        categoryMsg: {
+          batchNo: '',
+          number: '',
+          totalWeight: '',
+          brandNum: '',
+          sourceCategoryId: '',
+          rootCategoryLevelId: '9',
+          name: '',
+          code: ''
+        },
         workReport: {
           executorId: '',
           executorJobNum: '',
           executorTime: '',
-          packInfo: {
-            packNum: '',
-            netWeight: ''
-          },
+          remark: '',
           productInfo: {
             standardNum: '',
             standardWeight: '',
@@ -124,9 +256,23 @@
           code: '',
           name: '',
           path: '',
+          model: '',
+          rootCategoryLevelId: '',
           specification: ''
         },
-        countMsg: {}
+        countMsg: {},
+        // 舟皿信息
+        boatMsg: {
+          code: '',
+          name: '',
+          path: '',
+          model: '',
+          rootCategoryLevelId: '',
+          specification: '',
+          extraField: {
+            num: ''
+          }
+        }
       };
     },
     watch: {
@@ -140,6 +286,21 @@
       }
     },
     methods: {
+      getCategory (id, memo) {
+        this.$refs.catogaryDialogRef.open(id, this[memo], (res) => {
+          this[memo].rootCategoryLevelId = res.categoryLevelId;
+          this[memo].code = res.code;
+          this[memo].name = res.name;
+          this[memo].specification = res.specification;
+          this[memo].sourceInstanceId = res.id;
+          if (memo === 'moduleMsg') {
+            this[memo].model = res.modelType;
+            this[memo].extraField.stampingTimes = '';
+          } else {
+            this[memo].extraField.num = '';
+          }
+        });
+      },
       async getReportCount () {
         const res = await reportCount({
           taskCode: this.taskInfo.code,
@@ -154,21 +315,31 @@
           (res) => {
             this.workReportDeviceList.code = res.code;
             this.workReportDeviceList.name = res.name;
-            this.workReportDeviceList.path = res.id;
+            this.workReportDeviceList.model = res.modelType;
+            this.workReportDeviceList.specification = res.specification;
+            this.workReportDeviceList.sourceInstanceId = res.id;
+            this.workReportDeviceList.rootCategoryLevelId =
+              res.rootCategoryLevelId;
+            this.workReportDeviceList.path = res.positionList[0]?.pathName;
           }
         );
       },
-      getMsg () {},
       report (fun) {
         this.$refs.formRef.validate((value) => {
           if (value) {
+            this.categoryMsg = Object.assign(this.categoryMsg, {
+              brandNum: this.infoData.brandNo,
+              sourceCategoryId: this.infoData.categoryId,
+              name: this.infoData.productName,
+              code: this.infoData.productCode
+            });
             fun({
               checkState: 1,
               workReport: this.workReport,
-              workReportDeviceList: [this.workReportDeviceList]
+              workReportDeviceList: [this.workReportDeviceList],
+              workReportCategoryList: [this.categoryMsg]
             }).then((res) => {
-              console.log(res);
-              this.getMsg();
+              this.getReportCount();
             });
           }
         });
@@ -178,10 +349,21 @@
 </script>
 
 <style lang="scss" scoped>
+  .form-no-message {
+    :deep(.el-input-number) {
+      .el-input__inner {
+        text-align: left !important;
+      }
+    }
+  }
   .message-box {
     display: flex;
     justify-content: space-between;
     align-items: center;
+    margin-bottom: 16px;
+    .label {
+      margin-right: 5px;
+    }
     ul {
       list-style: none;
       display: flex;
@@ -197,6 +379,10 @@
       padding-top: 22px;
       display: flex;
       align-items: center;
+
+      .el-form-item {
+        margin-left: 10px;
+      }
     }
   }
 </style>

+ 270 - 75
src/views/produceOrder/components/report/Heating.vue

@@ -1,89 +1,219 @@
 <template>
-  <el-form :inline="true">
+  <el-form
+    class="form-no-message"
+    ref="formRef"
+    :show-message="false"
+    label-position="left"
+    :model="{
+      categoryMsg,
+      ...workReport
+    }"
+  >
     <div class="message-box">
       <ul>
-        <li> <span class="label">报工次数</span>2 </li>
-        <li> <span class="label">累计合格品数量</span>2 </li>
-        <li> <span class="label">累计合格品重量</span>2 </li>
-        <li> <span class="label">累计投料产品数量</span>2 </li>
+        <li> <span class="label">报工次数</span>{{ countMsg.reportNum }}</li>
+        <li>
+          <span class="label">累计合格品数量</span
+          >{{ countMsg.standardTotalNum }}</li
+        >
+        <li>
+          <span class="label">累计合格品重量</span
+          >{{ countMsg.standardTotalWeight }}</li
+        >
+        <li>
+          <span class="label">累计投料产品数量</span
+          >{{ countMsg.feedProductWeight }}</li
+        >
       </ul>
       <div class="right">
-        <el-form-item label="执行人工号"><el-input></el-input></el-form-item>
-        <el-form-item label="执行日期"><el-input></el-input></el-form-item>
+        <el-form-item
+          label="执行人工号"
+          prop="executorJobNum"
+          required
+          label-width="100px"
+          ><personSelectRemote
+            v-model="workReport.executorId"
+            placeholder="请输入"
+            @selfChange="
+              (val, item) => (workReport.executorJobNum = item.jobNumber)
+            "
+        /></el-form-item>
+        <el-form-item label="执行日期" prop="executorTime" label-width="100px"
+          ><el-date-picker
+            v-model="workReport.executorTime"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            type="datetime"
+            format="yyyy-MM-dd HH:mm"
+            placeholder="请选择"
+          ></el-date-picker
+        ></el-form-item>
       </div>
     </div>
     <el-card>
       <el-descriptions title="报工信息" direction="vertical" :column="7" border>
-        <el-descriptions-item label="投料数量(PCS)" :span="2"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="投料重量(KG)"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="舟皿编号/名称"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="舟皿数量"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="质检项">kooriookami</el-descriptions-item>
-        <el-descriptions-item label="质检标准"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="合格品数量(PCS)"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="合格品重量(KG)"
-          >kooriookami</el-descriptions-item
-        >
+        <el-descriptions-item label="">
+          <span class="label-required after" slot="label">投料数量(PCS)</span>
+          <el-form-item
+            label=""
+            label-width="0"
+            class="w100"
+            prop="categoryMsg.number"
+          >
+            <el-input-number
+              class="w100"
+              :controls="false"
+              v-model="categoryMsg.number"
+              :min="0"
+              clearable
+            ></el-input-number>
+          </el-form-item>
+        </el-descriptions-item>
+        <el-descriptions-item label="">
+          <span class="label-required after" slot="label">投料重量(KG)</span>
+          <el-form-item
+            label=""
+            label-width="0"
+            class="w100"
+            prop="categoryMsg.totalWeight"
+            ><el-input
+              readonly
+              class="w100"
+              :value="
+                (categoryMsg.totalWeight =
+                  categoryMsg.number * (infoData.productUnitWeight || 1))
+              "
+              :min="0"
+              clearable
+            ></el-input>
+          </el-form-item>
+        </el-descriptions-item>
+        <el-descriptions-item label="舟皿编号/名称" :span="2"
+          ><el-input
+            :value="`${boatMsg.code}/${boatMsg.name}`"
+            @click.native="getCategory('8', 'boatMsg')"
+          ></el-input
+        ></el-descriptions-item>
+        <el-descriptions-item label="舟皿数量" :span="3"
+          ><el-input
+            placeholder="请输入"
+            v-model="boatMsg.extraField.num"
+          ></el-input
+        ></el-descriptions-item>
+        <el-descriptions-item label="质检项" :span="2">{{
+          infoData.qualityItem
+        }}</el-descriptions-item>
+        <el-descriptions-item label="质检标准" :span="3">{{
+          infoData.qualityStandard
+        }}</el-descriptions-item>
+        <el-descriptions-item label="">
+          <span class="label-required after" slot="label">合格品数量(PCS)</span>
+          <el-form-item
+            label=""
+            label-width="0"
+            class="w100"
+            prop="productInfo.standardNum"
+            ><el-input-number
+              class="w100"
+              :controls="false"
+              v-model="workReport.productInfo.standardNum"
+              :min="0"
+              clearable
+            ></el-input-number> </el-form-item
+        ></el-descriptions-item>
+        <el-descriptions-item label=""
+          ><span class="label-required after" slot="label">合格品重量(KG)</span>
+          <el-form-item
+            label=""
+            label-width="0"
+            class="w100"
+            prop="productInfo.standardWeight"
+            ><el-input-number
+              readonly
+              class="w100"
+              :controls="false"
+              :value="
+                (workReport.productInfo.standardWeight =
+                  workReport.productInfo.standardNum *
+                  (infoData.productUnitWeight || 1))
+              "
+              :min="0"
+              clearable
+            ></el-input-number> </el-form-item
+        ></el-descriptions-item>
         <el-descriptions-item label="不合格品数量(PCS)">
-          <el-input>
-            <template slot="append">
-              <el-button type="primary">处置</el-button>
-            </template>
-          </el-input></el-descriptions-item
-        >
+          <el-input-number
+            class="w100"
+            :controls="false"
+            v-model="workReport.productInfo.noStandardNum"
+            :min="0"
+            clearable
+          ></el-input-number>
+        </el-descriptions-item>
         <el-descriptions-item label="不合格品重量(KG)"
-          ><el-input>
-            <template slot="append">
-              <el-button type="primary">处置</el-button>
-            </template>
-          </el-input></el-descriptions-item
-        >
+          ><el-input-number
+            class="w100"
+            readonly
+            :controls="false"
+            :value="
+              (workReport.productInfo.noStandardWeight =
+                workReport.noStandardNum * (infoData.productUnitWeight || 1))
+            "
+            :min="0"
+            clearable
+          ></el-input-number
+        ></el-descriptions-item>
         <el-descriptions-item label="副产品重量(KG)"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="备注" :span="2"
-          >kooriookami</el-descriptions-item
-        >
+          ><el-input-number
+            class="w100"
+            :controls="false"
+            v-model="workReport.productInfo.netWeight"
+            :min="0"
+            clearable
+          ></el-input-number
+        ></el-descriptions-item>
+        <el-descriptions-item label="备注">
+          <el-input v-model="workReport.remark"></el-input
+        ></el-descriptions-item>
       </el-descriptions>
       <el-descriptions
         title="设备信息"
+        class="mt-16"
         direction="vertical"
         :column="7"
         border
-        class="mt-16"
       >
-        <el-descriptions-item label="设备编码"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="设备名称"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="规格">kooriookami</el-descriptions-item>
-        <el-descriptions-item label="型号">kooriookami</el-descriptions-item>
-        <el-descriptions-item label="升温曲线"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="设备位置"
-          >kooriookami</el-descriptions-item
-        >
+        <el-descriptions-item label="设备编码">{{
+          workReportDeviceList.code
+        }}</el-descriptions-item>
+        <el-descriptions-item label="设备名称">{{
+          workReportDeviceList.name
+        }}</el-descriptions-item>
+        <el-descriptions-item label="规格">{{
+          workReportDeviceList.specification
+        }}</el-descriptions-item>
+        <el-descriptions-item label="型号">{{
+          workReportDeviceList.model
+        }}</el-descriptions-item>
+        <el-descriptions-item label="升温曲线">
+          <el-input
+            placeholder="请输入"
+            v-model="workReportDeviceList.extraField.temperatureCurve"
+          ></el-input>
+        </el-descriptions-item>
 
+        <el-descriptions-item label="设备位置">{{
+          workReportDeviceList.path
+        }}</el-descriptions-item>
         <el-descriptions-item label="操作"
-          ><el-link type="primary">更改设备</el-link>
-        </el-descriptions-item>
+          ><el-link @click="getEquip">更改设备</el-link></el-descriptions-item
+        >
       </el-descriptions>
     </el-card>
+    <equipmentDailog
+      ref="equipmentRef"
+      :produceVersionId="infoData.produceVersionId"
+    />
+    <catogaryDialog ref="catogaryDialogRef" />
   </el-form>
 </template>
 
@@ -91,8 +221,9 @@
   import personSelectRemote from '@/components/CommomSelect/person-select-remote';
   import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
   import { reportCount } from '@/api/produceOrder';
+  import catogaryDialog from '../catogaryDialog.vue';
   export default {
-    components: { personSelectRemote, equipmentDailog },
+    components: { personSelectRemote, equipmentDailog, catogaryDialog },
     props: {
       infoData: {
         type: Object,
@@ -105,14 +236,21 @@
     },
     data () {
       return {
+        categoryMsg: {
+          batchNo: '',
+          number: '',
+          totalWeight: '',
+          brandNum: '',
+          sourceCategoryId: '',
+          rootCategoryLevelId: '9',
+          name: '',
+          code: ''
+        },
         workReport: {
           executorId: '',
           executorJobNum: '',
           executorTime: '',
-          packInfo: {
-            packNum: '',
-            netWeight: ''
-          },
+          remark: '',
           productInfo: {
             standardNum: '',
             standardWeight: '',
@@ -124,9 +262,26 @@
           code: '',
           name: '',
           path: '',
-          specification: ''
+          model: '',
+          rootCategoryLevelId: '',
+          specification: '',
+          extraField: {
+            temperatureCurve: ''
+          }
         },
-        countMsg: {}
+        countMsg: {},
+        // 舟皿信息
+        boatMsg: {
+          code: '',
+          name: '',
+          path: '',
+          model: '',
+          rootCategoryLevelId: '',
+          specification: '',
+          extraField: {
+            num: ''
+          }
+        }
       };
     },
     watch: {
@@ -140,6 +295,21 @@
       }
     },
     methods: {
+      getCategory (id, memo) {
+        this.$refs.catogaryDialogRef.open(id, this[memo], (res) => {
+          this[memo].rootCategoryLevelId = res.categoryLevelId;
+          this[memo].code = res.code;
+          this[memo].name = res.name;
+          this[memo].specification = res.specification;
+          this[memo].sourceInstanceId = res.id;
+          if (memo === 'moduleMsg') {
+            this[memo].model = res.modelType;
+            this[memo].extraField.stampingTimes = '';
+          } else {
+            this[memo].extraField.num = '';
+          }
+        });
+      },
       async getReportCount () {
         const res = await reportCount({
           taskCode: this.taskInfo.code,
@@ -154,21 +324,31 @@
           (res) => {
             this.workReportDeviceList.code = res.code;
             this.workReportDeviceList.name = res.name;
-            this.workReportDeviceList.path = res.id;
+            this.workReportDeviceList.model = res.modelType;
+            this.workReportDeviceList.specification = res.specification;
+            this.workReportDeviceList.sourceInstanceId = res.id;
+            this.workReportDeviceList.rootCategoryLevelId =
+              res.rootCategoryLevelId;
+            this.workReportDeviceList.path = res.positionList[0]?.pathName;
           }
         );
       },
-      getMsg () {},
       report (fun) {
         this.$refs.formRef.validate((value) => {
           if (value) {
+            this.categoryMsg = Object.assign(this.categoryMsg, {
+              brandNum: this.infoData.brandNo,
+              sourceCategoryId: this.infoData.categoryId,
+              name: this.infoData.productName,
+              code: this.infoData.productCode
+            });
             fun({
               checkState: 1,
               workReport: this.workReport,
-              workReportDeviceList: [this.workReportDeviceList]
+              workReportDeviceList: [this.workReportDeviceList],
+              workReportCategoryList: [this.categoryMsg]
             }).then((res) => {
-              console.log(res);
-              this.getMsg();
+              this.getReportCount();
             });
           }
         });
@@ -178,10 +358,21 @@
 </script>
 
 <style lang="scss" scoped>
+  .form-no-message {
+    :deep(.el-input-number) {
+      .el-input__inner {
+        text-align: left !important;
+      }
+    }
+  }
   .message-box {
     display: flex;
     justify-content: space-between;
     align-items: center;
+    margin-bottom: 16px;
+    .label {
+      margin-right: 5px;
+    }
     ul {
       list-style: none;
       display: flex;
@@ -197,6 +388,10 @@
       padding-top: 22px;
       display: flex;
       align-items: center;
+
+      .el-form-item {
+        margin-left: 10px;
+      }
     }
   }
 </style>

+ 150 - 45
src/views/produceOrder/components/report/Package.vue

@@ -50,64 +50,109 @@
     </div>
     <el-card>
       <el-descriptions title="报工信息" direction="vertical" :column="5" border>
-        <el-descriptions-item label="待交接数量"
-          >kooriookami</el-descriptions-item
-        >
+        <el-descriptions-item label="待交接数量">{{
+          countMsg.surplusPackNum
+        }}</el-descriptions-item>
         <el-descriptions-item label="实际数量(PCS)"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="选择包装要求"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="" :span="2"
-          >kooriookami</el-descriptions-item
-        >
+          ><el-input
+            v-model="categoryMsg.number"
+            placeholder="请输入"
+          ></el-input
+        ></el-descriptions-item>
+        <el-descriptions-item label="选择包装要求">
+          <el-select v-model="workReport.packInfo.packDemand">
+            <el-option
+              v-for="item in packageList"
+              :key="item.code"
+              :label="item.code"
+              :value="item.code"
+              @click.native="
+                (item) => (packageRequirements = item.packageRequirements)
+              "
+            ></el-option>
+          </el-select>
+        </el-descriptions-item>
+        <el-descriptions-item label="" :span="2">{{
+          packageRequirements
+        }}</el-descriptions-item>
         <el-descriptions-item label="包装数量"
-          >kooriookami</el-descriptions-item
-        >
+          ><el-input
+            v-model="workReport.packInfo.packNum"
+            placeholder="请输入"
+          ></el-input
+        ></el-descriptions-item>
+        <el-descriptions-item label="单位"
+          ><el-input
+            v-model="workReport.packInfo.packUnit"
+            placeholder="请输入"
+          ></el-input
+        ></el-descriptions-item>
         <el-descriptions-item label="最小包装单元"
-          >kooriookami</el-descriptions-item
+          ><el-input
+            v-model="workReport.packInfo.minPackNum"
+            placeholder="请输入"
+          >
+            <div class="suffix" slot="suffix"
+              >PCS/{{ workReport.packInfo.packUnit }}</div
+            >
+          </el-input></el-descriptions-item
         >
-        <el-descriptions-item label="尾数(PCS)">杀杀杀</el-descriptions-item>
-        <el-descriptions-item label="净重(KG)">s大苏打</el-descriptions-item>
+        <el-descriptions-item label="尾数(PCS)"
+          ><el-input
+            v-model="workReport.packInfo.surplusNum"
+            placeholder="请输入"
+          ></el-input
+        ></el-descriptions-item>
+        <el-descriptions-item label="净重(KG)"
+          ><el-input
+            v-model="workReport.packInfo.netWeight"
+            placeholder="请输入"
+          ></el-input
+        ></el-descriptions-item>
         <el-descriptions-item label="毛重(KG)"
-          >kooriookami</el-descriptions-item
-        >
+          ><el-input
+            v-model="workReport.packInfo.roughWeight"
+            placeholder="请输入"
+          ></el-input
+        ></el-descriptions-item>
       </el-descriptions>
       <ele-pro-table
         :columns="columns"
-        :datasource="[]"
+        :datasource="workReportCategoryList"
         :need-page="false"
         class="mt-16"
       >
         <template v-slot:toolbar>
-          <el-link type="primary">添加物料</el-link>
+          <el-link type="primary" @click="addMaterial">添加物料</el-link>
         </template>
-        <template v-slot:action="{ row }">
-          <el-link type="danger">删除</el-link>
+        <template v-slot:action="{ $index }">
+          <el-link type="danger" @click="handleDelete($index)">删除</el-link>
         </template>
         <template v-slot:num="{ row }">
-          <el-input></el-input>
+          <el-input v-model="row.number" placeholder="请输入"></el-input>
         </template>
       </ele-pro-table>
-      <el-descriptions title="交接" direction="vertical" :column="5" border>
+      <!-- <el-descriptions title="交接" direction="vertical" :column="5" border>
         <el-descriptions-item label="待交接数量"
           >kooriookami</el-descriptions-item
         >
         <el-descriptions-item label="实际数量(PCS)"
           >kooriookami</el-descriptions-item
         >
-      </el-descriptions>
+      </el-descriptions> -->
     </el-card>
     <ChooseMaterial ref="ChooseMaterialRef" @success="materialSuccess" />
   </el-form>
 </template>
 
 <script>
+  import personSelectRemote from '@/components/CommomSelect/person-select-remote';
   import ChooseMaterial from '@/components/material/ChooseMaterial';
+  import { reportCount, getPackageList } from '@/api/produceOrder';
   export default {
     components: {
-      ChooseMaterial
+      ChooseMaterial,
+      personSelectRemote
     },
     props: {
       infoData: {
@@ -121,6 +166,7 @@
     },
     data () {
       return {
+        packageRequirements: '',
         columns: [
           {
             label: '序号',
@@ -129,35 +175,37 @@
           },
           {
             label: '编码',
-            prop: 'index'
+            prop: 'code'
           },
           {
             label: '名称',
-            prop: 'index'
-          },
-          {
-            label: '类型',
-            prop: 'index'
+            prop: 'name'
           },
+          // {
+          //   label: '类型',
+          //   prop: 'index'
+          // },
           {
             label: '型号',
-            prop: 'index'
+            prop: 'model'
           },
           {
             label: '规格',
-            prop: 'index'
+            prop: 'specification'
           },
           {
             label: '批次号',
-            prop: 'index'
-          },
-          {
-            label: '包装编码',
-            prop: 'index'
+            prop: 'batchNo'
           },
+          // {
+          //   label: '包装编码',
+          //   prop: 'index'
+          // },
           {
             label: '最小包装单元',
-            prop: 'index'
+            prop: 'index',
+            formatter: (row) =>
+              `${row.netWeightUnit}${row.measuringUnit}/${row.packingUnit}`
           },
           {
             label: '数量',
@@ -165,18 +213,33 @@
           },
           {
             label: '单位',
-            prop: 'index'
+            prop: 'measuringUnit'
           },
           {
             label: '操作',
             slot: 'action'
           }
         ],
+        categoryMsg: {
+          batchNo: '',
+          number: '',
+          totalWeight: '',
+          brandNum: '',
+          sourceCategoryId: '',
+          rootCategoryLevelId: '9',
+          name: '',
+          code: ''
+        },
         workReport: {
           executorId: '',
           executorJobNum: '',
           executorTime: '',
           packInfo: {
+            packUnit: '',
+            minPackNum: '',
+            surplusNum: '',
+            netWeight: '',
+            roughWeight: '',
             packNum: '',
             netWeight: ''
           },
@@ -187,6 +250,7 @@
             noStandardWeight: ''
           }
         },
+        packageList: [],
         workReportCategoryList: [],
         countMsg: {}
       };
@@ -199,9 +263,27 @@
             this.getReportCount();
           }
         }
+      },
+      infoData: {
+        immediate: true,
+        handler () {
+          if (this.infoData.code) {
+            this._getPackageList();
+          }
+        }
       }
     },
     methods: {
+      async _getPackageList () {
+        const res = await getPackageList(this.infoData.code);
+
+        this.packageList = res;
+      },
+      handleDelete (index) {
+        this.$confirm('确定删除?', '提示').then(() => {
+          this.workReportCategoryList.splice(index, 1);
+        });
+      },
       addMaterial () {
         this.$refs.ChooseMaterialRef.open(this.workReportCategoryList.slice(0));
       },
@@ -222,7 +304,8 @@
               model: pre.modelType,
               specifications: pre.specification,
               unit: pre.measuringUnit,
-              number: ''
+              number: '',
+              ...pre
             });
           }
           return next;
@@ -231,6 +314,7 @@
       async getReportCount () {
         const res = await reportCount({
           taskCode: this.taskInfo.code,
+          lastTaskCode: this.taskInfo.lastTaskCode,
           workOrderId: this.infoData.id
         });
 
@@ -240,12 +324,24 @@
       report (fun) {
         this.$refs.formRef.validate((value) => {
           if (value) {
+            if (!this.workReportCategoryList?.length) {
+              return this.$message.error('请添加物料');
+            }
+            this.categoryMsg = Object.assign(this.categoryMsg, {
+              brandNum: this.infoData.brandNo,
+              sourceCategoryId: this.infoData.categoryId,
+              name: this.infoData.productName,
+              code: this.infoData.productCode
+            });
             fun({
               checkState: 1,
-              workReport: this.workReport
+              workReport: this.workReport,
+              workReportCategoryList: [
+                ...this.workReportCategoryList,
+                this.categoryMsg
+              ]
             }).then((res) => {
-              console.log(res);
-              this.getMsg();
+              this.getReportCount();
             });
           }
         });
@@ -255,10 +351,19 @@
 </script>
 
 <style lang="scss" scoped>
+  .suffix {
+    height: 100%;
+    display: flex;
+    align-items: center;
+  }
   .message-box {
     display: flex;
     justify-content: space-between;
     align-items: center;
+    margin-bottom: 16px;
+    .label {
+      margin-right: 5px;
+    }
     ul {
       list-style: none;
       display: flex;

+ 162 - 28
src/views/produceOrder/components/report/Warehousing.vue

@@ -1,24 +1,56 @@
 <template>
-  <el-form :inline="true">
+  <el-form
+    class="form-no-message"
+    ref="formRef"
+    :show-message="false"
+    label-position="left"
+    :model="{ workReport }"
+  >
     <div class="message-box">
       <ul>
-        <li> <span class="label">报工次数</span>2 </li>
-        <li> <span class="label">批次数量</span>2 </li>
-        <li> <span class="label">累计入库数量</span>2 </li>
+        <li> <span class="label">报工次数</span>{{ countMsg.reportNum }}</li>
+        <li>
+          <span class="label">批次数量</span>{{ countMsg.inStoreBatchNum }}</li
+        >
+        <li>
+          <span class="label">累计入库数量</span>{{ countMsg.inStoreNum }}</li
+        >
       </ul>
       <div class="right">
-        <el-form-item label="执行人工号"><el-input></el-input></el-form-item>
-        <el-form-item label="执行日期"><el-input></el-input></el-form-item>
+        <el-form-item
+          label="执行人工号"
+          prop="workReport.executorJobNum"
+          required
+          label-width="100px"
+          ><personSelectRemote
+            v-model="workReport.executorId"
+            placeholder="请输入"
+            @selfChange="
+              (val, item) => (workReport.executorJobNum = item.jobNumber)
+            "
+        /></el-form-item>
+        <el-form-item label="执行日期" prop="executorTime" label-width="100px"
+          ><el-date-picker
+            v-model="workReport.executorTime"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            type="datetime"
+            format="yyyy-MM-dd HH:mm"
+            placeholder="请选择"
+          ></el-date-picker
+        ></el-form-item>
       </div>
     </div>
     <el-card>
       <el-descriptions title="交接" direction="vertical" :column="7" border>
-        <el-descriptions-item label="待交接数量" :span="2"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="实际数量(PCS)"
-          >kooriookami</el-descriptions-item
-        >
+        <el-descriptions-item label="待交接数量">{{
+          countMsg.surplusStandardNum
+        }}</el-descriptions-item>
+        <el-descriptions-item label="">
+          <span slot="label" class="label-required after">实际数量(PCS)</span>
+          <el-form-item label="" label-width="0" class="w100" required
+            ><el-input v-model="categoryMsg.number"></el-input
+          ></el-form-item>
+        </el-descriptions-item>
       </el-descriptions>
       <el-descriptions
         title="入库"
@@ -27,38 +59,136 @@
         border
         class="mt-16"
       >
-        <template slot="extra">
+        <!-- <template slot="extra">
           <el-button type="primary" size="small" @click="handleAddBatch"
             >添加</el-button
           >
-        </template>
-        <el-descriptions-item label="交货仓库"
-          >kooriookami</el-descriptions-item
-        >
-        <el-descriptions-item label="批次号">kooriookami</el-descriptions-item>
-        <template v-for="(item, index) in batchList">
-          <el-descriptions-item label="入库数量(PCS)"
-            >kooriookami</el-descriptions-item
-          >
-          <el-descriptions-item label="批次号"
-            >kooriookami</el-descriptions-item
+        </template> -->
+        <el-descriptions-item label="交货仓库">
+          <span slot="label" class="label-required after">交货仓库</span>
+          <el-form-item
+            label=""
+            label-width="0"
+            class="w100"
+            prop="workReport.storageInfo.storageCode"
           >
-        </template>
+            <DictSelection
+              v-model="workReport.storageInfo.storageCode"
+              dict-name="仓库"
+              @itemChange="
+                (item) => (workReport.storageInfo.storageName = item.dictValue)
+              "
+            ></DictSelection>
+          </el-form-item>
+        </el-descriptions-item>
+        <!-- <template v-for="(item, index) in batchList"> -->
+        <el-descriptions-item label="批次号">
+          <span slot="label" class="label-required after">批次号</span>
+          <el-form-item
+            label=""
+            label-width="0"
+            class="w100"
+            prop="workReport.storageInfo.batchNum"
+            ><el-input
+              v-model="workReport.storageInfo.batchNum"
+            ></el-input></el-form-item
+        ></el-descriptions-item>
+        <el-descriptions-item label="入库数量(PCS)">
+          <span slot="label" class="label-required after">入库数量(PCS)</span
+          ><el-form-item
+            label=""
+            label-width="0"
+            class="w100"
+            prop="workReport.storageInfo.storageCode"
+            ><el-input
+              v-model="workReport.storageInfo.inStorageNum"
+            ></el-input></el-form-item
+        ></el-descriptions-item>
+        <!-- </template> -->
       </el-descriptions>
     </el-card>
   </el-form>
 </template>
 
 <script>
+  import personSelectRemote from '@/components/CommomSelect/person-select-remote';
+  import { reportCount } from '@/api/produceOrder';
   export default {
+    components: { personSelectRemote },
+    props: {
+      infoData: {
+        type: Object,
+        default: () => ({})
+      },
+      taskInfo: {
+        type: Object,
+        default: () => ({})
+      }
+    },
     data () {
       return {
-        batchList: [{}]
+        workReport: {
+          executorId: '',
+          executorJobNum: '',
+          executorTime: '',
+          storageInfo: {
+            batchNum: '',
+            inStorageNum: '',
+            storageCode: '',
+            storageName: ''
+          }
+        },
+        categoryMsg: {
+          batchNo: '',
+          number: '',
+          totalWeight: '',
+          brandNum: '',
+          sourceCategoryId: '',
+          rootCategoryLevelId: '9',
+          name: '',
+          code: ''
+        },
+        countMsg: {}
       };
     },
+    watch: {
+      taskInfo: {
+        immediate: true,
+        handler () {
+          if (this.taskInfo.code) {
+            this.getReportCount();
+          }
+        }
+      }
+    },
     methods: {
-      handleAddBatch () {
-        this.batchList.push({});
+      async getReportCount () {
+        const res = await reportCount({
+          taskCode: this.taskInfo.code,
+          lastTaskCode: this.taskInfo.lastTaskCode,
+          workOrderId: this.infoData.id
+        });
+
+        this.countMsg = res;
+      },
+      report (fun) {
+        this.$refs.formRef.validate((value) => {
+          if (value) {
+            this.categoryMsg = Object.assign(this.categoryMsg, {
+              brandNum: this.infoData.brandNo,
+              sourceCategoryId: this.infoData.categoryId,
+              name: this.infoData.productName,
+              code: this.infoData.productCode
+            });
+            fun({
+              checkState: 1,
+              workReport: this.workReport,
+              workReportCategoryList: [this.categoryMsg]
+            }).then((res) => {
+              this.getReportCount();
+            });
+          }
+        });
       }
     }
   };
@@ -69,6 +199,10 @@
     display: flex;
     justify-content: space-between;
     align-items: center;
+    margin-bottom: 16px;
+    .label {
+      margin-right: 5px;
+    }
     ul {
       list-style: none;
       display: flex;

+ 15 - 11
src/views/produceOrder/report.vue

@@ -122,7 +122,11 @@
         :is="componentsList[tabList[activeName].name] || 'Common'"
         :key="activeName"
         :infoData="infoData"
-        :taskInfo="tabList[activeName]"
+        :taskInfo="{
+          ...tabList[activeName],
+          lastTaskCode:
+            tabList[activeName > 0 ? activeName - 1 : activeName].code
+        }"
       ></components>
       <div class="footer">
         <el-button type="primary" @click="handleReport">一键报工</el-button>
@@ -167,7 +171,7 @@
           升温干燥: 'Heating',
           半加定长: 'HalfAdded',
           备炉: 'Furnace',
-          烧结: 'Sinter',
+          烧结: 'Common', //'Sinter',
           深加工: 'Common',
           包装: 'Package',
           入库: 'Warehousing'
@@ -180,15 +184,15 @@
     methods: {
       handleReport () {
         this.$refs.reportRef.report(async (data) => {
-          data.workReportCategoryList = data.workReportCategoryList || [
-            {
-              code: this.infoData.productCode,
-              name: this.infoData.productName,
-              rootCategoryLevelId: '1',
-              batchNo: '',
-              brandNum: this.infoData.brandNo
-            }
-          ];
+          // data.workReportCategoryList = data.workReportCategoryList || [
+          //   {
+          //     code: this.infoData.productCode,
+          //     name: this.infoData.productName,
+          //     rootCategoryLevelId: '1',
+          //     batchNo: '',
+          //     brandNum: this.infoData.brandNo
+          //   }
+          // ];
           if (data.workReport) {
             data.workReport.taskCode = this.tabList[this.activeName].code;
             data.workReport.taskName = this.tabList[this.activeName].name;

+ 2 - 2
vue.config.js

@@ -33,10 +33,10 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.3.51:18086', // 测试
 
-        target: 'http://192.168.3.35:8080', // kang杨威
+        // target: 'http://192.168.3.35:8080', // kang杨威
         // target: 'http://192.168.3.25:8080', // 黄峥嵘
         // target: 'http://192.168.3.41:8080', // 何江鹏
-        // target: 'http://192.168.3.33:8080', // 谢一平
+        target: 'http://192.168.3.33:8080', // 谢一平
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {