quwangxin 3 سال پیش
والد
کامیت
e80cf636c3

+ 8 - 0
src/api/produceOrder/index.js

@@ -81,3 +81,11 @@ export async function report (params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+// 报工 统计数据
+export async function reportCount (params) {
+  const res = await request.get(`/mes/workreport/count`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 18 - 0
src/styles/transition/common.scss

@@ -64,3 +64,21 @@
 .mb-16 {
   margin-bottom: 16px;
 }
+
+.label-required {
+  &.after::after {
+    content: '*';
+    color: var(--color-danger);
+    font-size: 1.2em;
+  }
+  &.before::before {
+    content: '*';
+    color: var(--color-danger);
+    font-size: 1.2em;
+  }
+}
+.form-no-message {
+  .el-form-item {
+    margin-bottom: 0 !important;
+  }
+}

+ 254 - 58
src/views/produceOrder/components/report/Common.vue

@@ -1,99 +1,283 @@
 <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>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-form-item
+          label="执行人工号"
+          prop="executorJobNum"
+          required
+          label-width="100px"
           ><personSelectRemote
-            v-model="formData.executorJobNum"
+            v-model="workReport.executorId"
             placeholder="请输入"
             @selfChange="
-              (val, item) => (formData.executorJobNum = item.jobNumber)
+              (val, item) => (workReport.executorJobNum = item.jobNumber)
             "
         /></el-form-item>
-        <el-form-item label="执行日期"><el-input></el-input></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="合格品数量(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="packInfo.packNum"
+          >
+            <el-input-number
+              class="w100"
+              :controls="false"
+              v-model="workReport.packInfo.packNum"
+              :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="packInfo.netWeight"
+            ><el-input
+              readonly
+              class="w100"
+              :value="
+                (workReport.packInfo.netWeight =
+                  workReport.packInfo.packNum *
+                  (infoData.productUnitWeight || 1))
+              "
+              :min="0"
+              clearable
+            ></el-input>
+          </el-form-item>
+        </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></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
+        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="设备位置"
-          >kooriookami</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>
 
 <script>
   import personSelectRemote from '@/components/CommomSelect/person-select-remote';
+  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import { reportCount } from '@/api/produceOrder';
   export default {
-    components: { personSelectRemote },
+    components: { personSelectRemote, equipmentDailog },
+    props: {
+      infoData: {
+        type: Object,
+        default: () => ({})
+      },
+      taskInfo: {
+        type: Object,
+        default: () => ({})
+      }
+    },
     data () {
       return {
-        formData: {}
+        workReport: {
+          executorId: '',
+          executorJobNum: '',
+          executorTime: '',
+          packInfo: {
+            packNum: '',
+            netWeight: ''
+          },
+          productInfo: {
+            standardNum: '',
+            standardWeight: '',
+            noStandardNum: '',
+            noStandardWeight: ''
+          }
+        },
+        workReportDeviceList: {
+          code: '',
+          name: '',
+          path: '',
+          specification: ''
+        },
+        countMsg: {}
       };
     },
+    watch: {
+      taskInfo: {
+        immediate: true,
+        handler () {
+          if (this.taskInfo.code) {
+            this.getReportCount();
+          }
+        }
+      }
+    },
     methods: {
+      async getReportCount () {
+        const res = await reportCount({
+          taskCode: this.taskInfo.code,
+          workOrderId: this.infoData.id
+        });
+
+        this.countMsg = res;
+      },
+      getEquip () {
+        this.$refs.equipmentRef.openSingle(
+          [this.workReportDeviceList],
+          (res) => {
+            this.workReportDeviceList.code = res.code;
+            this.workReportDeviceList.name = res.name;
+            this.workReportDeviceList.path = res.id;
+          }
+        );
+      },
       getMsg () {},
       report (fun) {
         this.$refs.formRef.validate((value) => {
           if (value) {
-            fun(this.formData).then((res) => {
+            fun({
+              checkState: 1,
+              workReport: this.workReport,
+              workReportDeviceList: [this.workReportDeviceList]
+            }).then((res) => {
               console.log(res);
               this.getMsg();
             });
@@ -105,10 +289,18 @@
 </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;
     ul {
       list-style: none;
       display: flex;
@@ -124,6 +316,10 @@
       padding-top: 22px;
       display: flex;
       align-items: center;
+
+      .el-form-item {
+        margin-left: 10px;
+      }
     }
   }
 </style>

+ 89 - 1
src/views/produceOrder/components/report/Drying.vue

@@ -84,7 +84,95 @@
   </el-form>
 </template>
 
-<script></script>
+<script>
+  import personSelectRemote from '@/components/CommomSelect/person-select-remote';
+  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import { reportCount } from '@/api/produceOrder';
+  export default {
+    components: { personSelectRemote, equipmentDailog },
+    props: {
+      infoData: {
+        type: Object,
+        default: () => ({})
+      },
+      taskInfo: {
+        type: Object,
+        default: () => ({})
+      }
+    },
+    data () {
+      return {
+        workReport: {
+          executorId: '',
+          executorJobNum: '',
+          executorTime: '',
+          packInfo: {
+            packNum: '',
+            netWeight: ''
+          },
+          productInfo: {
+            standardNum: '',
+            standardWeight: '',
+            noStandardNum: '',
+            noStandardWeight: ''
+          }
+        },
+        workReportDeviceList: {
+          code: '',
+          name: '',
+          path: '',
+          specification: ''
+        },
+        countMsg: {}
+      };
+    },
+    watch: {
+      taskInfo: {
+        immediate: true,
+        handler () {
+          if (this.taskInfo.code) {
+            this.getReportCount();
+          }
+        }
+      }
+    },
+    methods: {
+      async getReportCount () {
+        const res = await reportCount({
+          taskCode: this.taskInfo.code,
+          workOrderId: this.infoData.id
+        });
+
+        this.countMsg = res;
+      },
+      getEquip () {
+        this.$refs.equipmentRef.openSingle(
+          [this.workReportDeviceList],
+          (res) => {
+            this.workReportDeviceList.code = res.code;
+            this.workReportDeviceList.name = res.name;
+            this.workReportDeviceList.path = res.id;
+          }
+        );
+      },
+      getMsg () {},
+      report (fun) {
+        this.$refs.formRef.validate((value) => {
+          if (value) {
+            fun({
+              checkState: 1,
+              workReport: this.workReport,
+              workReportDeviceList: [this.workReportDeviceList]
+            }).then((res) => {
+              console.log(res);
+              this.getMsg();
+            });
+          }
+        });
+      }
+    }
+  };
+</script>
 
 <style lang="scss" scoped>
   .message-box {

+ 113 - 8
src/views/produceOrder/components/report/Extrusion.vue

@@ -2,10 +2,19 @@
   <el-form :inline="true">
     <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>
@@ -14,9 +23,17 @@
     </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">
+          <span class="label-required after" slot="label">原料编码/名称</span>
+          <el-form-item
+            label=""
+            label-width="0"
+            class="w100"
+            prop="packInfo.packNum"
+          >
+            <el-input v-model="workReport.packInfo.packNum"></el-input>
+          </el-form-item>
+        </el-descriptions-item>
         <el-descriptions-item label="原料牌号"
           >kooriookami</el-descriptions-item
         >
@@ -93,7 +110,95 @@
   </el-form>
 </template>
 
-<script></script>
+<script>
+  import personSelectRemote from '@/components/CommomSelect/person-select-remote';
+  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import { reportCount } from '@/api/produceOrder';
+  export default {
+    components: { personSelectRemote, equipmentDailog },
+    props: {
+      infoData: {
+        type: Object,
+        default: () => ({})
+      },
+      taskInfo: {
+        type: Object,
+        default: () => ({})
+      }
+    },
+    data () {
+      return {
+        workReport: {
+          executorId: '',
+          executorJobNum: '',
+          executorTime: '',
+          packInfo: {
+            packNum: '',
+            netWeight: ''
+          },
+          productInfo: {
+            standardNum: '',
+            standardWeight: '',
+            noStandardNum: '',
+            noStandardWeight: ''
+          }
+        },
+        workReportDeviceList: {
+          code: '',
+          name: '',
+          path: '',
+          specification: ''
+        },
+        countMsg: {}
+      };
+    },
+    watch: {
+      taskInfo: {
+        immediate: true,
+        handler () {
+          if (this.taskInfo.code) {
+            this.getReportCount();
+          }
+        }
+      }
+    },
+    methods: {
+      async getReportCount () {
+        const res = await reportCount({
+          taskCode: this.taskInfo.code,
+          workOrderId: this.infoData.id
+        });
+
+        this.countMsg = res;
+      },
+      getEquip () {
+        this.$refs.equipmentRef.openSingle(
+          [this.workReportDeviceList],
+          (res) => {
+            this.workReportDeviceList.code = res.code;
+            this.workReportDeviceList.name = res.name;
+            this.workReportDeviceList.path = res.id;
+          }
+        );
+      },
+      getMsg () {},
+      report (fun) {
+        this.$refs.formRef.validate((value) => {
+          if (value) {
+            fun({
+              checkState: 1,
+              workReport: this.workReport,
+              workReportDeviceList: [this.workReportDeviceList]
+            }).then((res) => {
+              console.log(res);
+              this.getMsg();
+            });
+          }
+        });
+      }
+    }
+  };
+</script>
 
 <style lang="scss" scoped>
   .message-box {

+ 89 - 1
src/views/produceOrder/components/report/Furnace.vue

@@ -39,7 +39,95 @@
   </el-form>
 </template>
 
-<script></script>
+<script>
+  import personSelectRemote from '@/components/CommomSelect/person-select-remote';
+  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import { reportCount } from '@/api/produceOrder';
+  export default {
+    components: { personSelectRemote, equipmentDailog },
+    props: {
+      infoData: {
+        type: Object,
+        default: () => ({})
+      },
+      taskInfo: {
+        type: Object,
+        default: () => ({})
+      }
+    },
+    data () {
+      return {
+        workReport: {
+          executorId: '',
+          executorJobNum: '',
+          executorTime: '',
+          packInfo: {
+            packNum: '',
+            netWeight: ''
+          },
+          productInfo: {
+            standardNum: '',
+            standardWeight: '',
+            noStandardNum: '',
+            noStandardWeight: ''
+          }
+        },
+        workReportDeviceList: {
+          code: '',
+          name: '',
+          path: '',
+          specification: ''
+        },
+        countMsg: {}
+      };
+    },
+    watch: {
+      taskInfo: {
+        immediate: true,
+        handler () {
+          if (this.taskInfo.code) {
+            this.getReportCount();
+          }
+        }
+      }
+    },
+    methods: {
+      async getReportCount () {
+        const res = await reportCount({
+          taskCode: this.taskInfo.code,
+          workOrderId: this.infoData.id
+        });
+
+        this.countMsg = res;
+      },
+      getEquip () {
+        this.$refs.equipmentRef.openSingle(
+          [this.workReportDeviceList],
+          (res) => {
+            this.workReportDeviceList.code = res.code;
+            this.workReportDeviceList.name = res.name;
+            this.workReportDeviceList.path = res.id;
+          }
+        );
+      },
+      getMsg () {},
+      report (fun) {
+        this.$refs.formRef.validate((value) => {
+          if (value) {
+            fun({
+              checkState: 1,
+              workReport: this.workReport,
+              workReportDeviceList: [this.workReportDeviceList]
+            }).then((res) => {
+              console.log(res);
+              this.getMsg();
+            });
+          }
+        });
+      }
+    }
+  };
+</script>
 
 <style lang="scss" scoped>
   .message-box {

+ 89 - 1
src/views/produceOrder/components/report/HalfAdded.vue

@@ -87,7 +87,95 @@
   </el-form>
 </template>
 
-<script></script>
+<script>
+  import personSelectRemote from '@/components/CommomSelect/person-select-remote';
+  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import { reportCount } from '@/api/produceOrder';
+  export default {
+    components: { personSelectRemote, equipmentDailog },
+    props: {
+      infoData: {
+        type: Object,
+        default: () => ({})
+      },
+      taskInfo: {
+        type: Object,
+        default: () => ({})
+      }
+    },
+    data () {
+      return {
+        workReport: {
+          executorId: '',
+          executorJobNum: '',
+          executorTime: '',
+          packInfo: {
+            packNum: '',
+            netWeight: ''
+          },
+          productInfo: {
+            standardNum: '',
+            standardWeight: '',
+            noStandardNum: '',
+            noStandardWeight: ''
+          }
+        },
+        workReportDeviceList: {
+          code: '',
+          name: '',
+          path: '',
+          specification: ''
+        },
+        countMsg: {}
+      };
+    },
+    watch: {
+      taskInfo: {
+        immediate: true,
+        handler () {
+          if (this.taskInfo.code) {
+            this.getReportCount();
+          }
+        }
+      }
+    },
+    methods: {
+      async getReportCount () {
+        const res = await reportCount({
+          taskCode: this.taskInfo.code,
+          workOrderId: this.infoData.id
+        });
+
+        this.countMsg = res;
+      },
+      getEquip () {
+        this.$refs.equipmentRef.openSingle(
+          [this.workReportDeviceList],
+          (res) => {
+            this.workReportDeviceList.code = res.code;
+            this.workReportDeviceList.name = res.name;
+            this.workReportDeviceList.path = res.id;
+          }
+        );
+      },
+      getMsg () {},
+      report (fun) {
+        this.$refs.formRef.validate((value) => {
+          if (value) {
+            fun({
+              checkState: 1,
+              workReport: this.workReport,
+              workReportDeviceList: [this.workReportDeviceList]
+            }).then((res) => {
+              console.log(res);
+              this.getMsg();
+            });
+          }
+        });
+      }
+    }
+  };
+</script>
 
 <style lang="scss" scoped>
   .message-box {

+ 89 - 1
src/views/produceOrder/components/report/Heating.vue

@@ -87,7 +87,95 @@
   </el-form>
 </template>
 
-<script></script>
+<script>
+  import personSelectRemote from '@/components/CommomSelect/person-select-remote';
+  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import { reportCount } from '@/api/produceOrder';
+  export default {
+    components: { personSelectRemote, equipmentDailog },
+    props: {
+      infoData: {
+        type: Object,
+        default: () => ({})
+      },
+      taskInfo: {
+        type: Object,
+        default: () => ({})
+      }
+    },
+    data () {
+      return {
+        workReport: {
+          executorId: '',
+          executorJobNum: '',
+          executorTime: '',
+          packInfo: {
+            packNum: '',
+            netWeight: ''
+          },
+          productInfo: {
+            standardNum: '',
+            standardWeight: '',
+            noStandardNum: '',
+            noStandardWeight: ''
+          }
+        },
+        workReportDeviceList: {
+          code: '',
+          name: '',
+          path: '',
+          specification: ''
+        },
+        countMsg: {}
+      };
+    },
+    watch: {
+      taskInfo: {
+        immediate: true,
+        handler () {
+          if (this.taskInfo.code) {
+            this.getReportCount();
+          }
+        }
+      }
+    },
+    methods: {
+      async getReportCount () {
+        const res = await reportCount({
+          taskCode: this.taskInfo.code,
+          workOrderId: this.infoData.id
+        });
+
+        this.countMsg = res;
+      },
+      getEquip () {
+        this.$refs.equipmentRef.openSingle(
+          [this.workReportDeviceList],
+          (res) => {
+            this.workReportDeviceList.code = res.code;
+            this.workReportDeviceList.name = res.name;
+            this.workReportDeviceList.path = res.id;
+          }
+        );
+      },
+      getMsg () {},
+      report (fun) {
+        this.$refs.formRef.validate((value) => {
+          if (value) {
+            fun({
+              checkState: 1,
+              workReport: this.workReport,
+              workReportDeviceList: [this.workReportDeviceList]
+            }).then((res) => {
+              console.log(res);
+              this.getMsg();
+            });
+          }
+        });
+      }
+    }
+  };
+</script>
 
 <style lang="scss" scoped>
   .message-box {

+ 136 - 8
src/views/produceOrder/components/report/Package.vue

@@ -1,15 +1,51 @@
 <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>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>
@@ -63,11 +99,26 @@
         >
       </el-descriptions>
     </el-card>
+    <ChooseMaterial ref="ChooseMaterialRef" @success="materialSuccess" />
   </el-form>
 </template>
 
 <script>
+  import ChooseMaterial from '@/components/material/ChooseMaterial';
   export default {
+    components: {
+      ChooseMaterial
+    },
+    props: {
+      infoData: {
+        type: Object,
+        default: () => ({})
+      },
+      taskInfo: {
+        type: Object,
+        default: () => ({})
+      }
+    },
     data () {
       return {
         columns: [
@@ -120,8 +171,85 @@
             label: '操作',
             slot: 'action'
           }
-        ]
+        ],
+        workReport: {
+          executorId: '',
+          executorJobNum: '',
+          executorTime: '',
+          packInfo: {
+            packNum: '',
+            netWeight: ''
+          },
+          productInfo: {
+            standardNum: '',
+            standardWeight: '',
+            noStandardNum: '',
+            noStandardWeight: ''
+          }
+        },
+        workReportCategoryList: [],
+        countMsg: {}
       };
+    },
+    watch: {
+      taskInfo: {
+        immediate: true,
+        handler () {
+          if (this.taskInfo.code) {
+            this.getReportCount();
+          }
+        }
+      }
+    },
+    methods: {
+      addMaterial () {
+        this.$refs.ChooseMaterialRef.open(this.workReportCategoryList.slice(0));
+      },
+      materialSuccess (list) {
+        const obj = {};
+        this.workReportCategoryList = [
+          ...this.workReportCategoryList,
+          ...list
+        ].reduce((next, pre) => {
+          if (!obj[pre.id]) {
+            obj[pre.id] = true;
+
+            next.push({
+              brandNo: pre.brandNum,
+              code: pre.code,
+              sourceCategoryId: pre.id,
+              name: pre.name,
+              model: pre.modelType,
+              specifications: pre.specification,
+              unit: pre.measuringUnit,
+              number: ''
+            });
+          }
+          return next;
+        }, []);
+      },
+      async getReportCount () {
+        const res = await reportCount({
+          taskCode: this.taskInfo.code,
+          workOrderId: this.infoData.id
+        });
+
+        this.countMsg = res;
+      },
+      getMsg () {},
+      report (fun) {
+        this.$refs.formRef.validate((value) => {
+          if (value) {
+            fun({
+              checkState: 1,
+              workReport: this.workReport
+            }).then((res) => {
+              console.log(res);
+              this.getMsg();
+            });
+          }
+        });
+      }
     }
   };
 </script>

+ 89 - 1
src/views/produceOrder/components/report/Sinter.vue

@@ -80,7 +80,95 @@
   </el-form>
 </template>
 
-<script></script>
+<script>
+  import personSelectRemote from '@/components/CommomSelect/person-select-remote';
+  import equipmentDailog from '@/components/EquipmentDailog/equipment-dailog';
+  import { reportCount } from '@/api/produceOrder';
+  export default {
+    components: { personSelectRemote, equipmentDailog },
+    props: {
+      infoData: {
+        type: Object,
+        default: () => ({})
+      },
+      taskInfo: {
+        type: Object,
+        default: () => ({})
+      }
+    },
+    data () {
+      return {
+        workReport: {
+          executorId: '',
+          executorJobNum: '',
+          executorTime: '',
+          packInfo: {
+            packNum: '',
+            netWeight: ''
+          },
+          productInfo: {
+            standardNum: '',
+            standardWeight: '',
+            noStandardNum: '',
+            noStandardWeight: ''
+          }
+        },
+        workReportDeviceList: {
+          code: '',
+          name: '',
+          path: '',
+          specification: ''
+        },
+        countMsg: {}
+      };
+    },
+    watch: {
+      taskInfo: {
+        immediate: true,
+        handler () {
+          if (this.taskInfo.code) {
+            this.getReportCount();
+          }
+        }
+      }
+    },
+    methods: {
+      async getReportCount () {
+        const res = await reportCount({
+          taskCode: this.taskInfo.code,
+          workOrderId: this.infoData.id
+        });
+
+        this.countMsg = res;
+      },
+      getEquip () {
+        this.$refs.equipmentRef.openSingle(
+          [this.workReportDeviceList],
+          (res) => {
+            this.workReportDeviceList.code = res.code;
+            this.workReportDeviceList.name = res.name;
+            this.workReportDeviceList.path = res.id;
+          }
+        );
+      },
+      getMsg () {},
+      report (fun) {
+        this.$refs.formRef.validate((value) => {
+          if (value) {
+            fun({
+              checkState: 1,
+              workReport: this.workReport,
+              workReportDeviceList: [this.workReportDeviceList]
+            }).then((res) => {
+              console.log(res);
+              this.getMsg();
+            });
+          }
+        });
+      }
+    }
+  };
+</script>
 
 <style lang="scss" scoped>
   .message-box {

+ 19 - 8
src/views/produceOrder/report.vue

@@ -44,12 +44,12 @@
           <el-descriptions-item label="产品名称">{{
             infoData.productName
           }}</el-descriptions-item>
-          <el-descriptions-item label="牌号 | 型号">{{
-            infoData.code
-          }}</el-descriptions-item>
-          <el-descriptions-item label="要求成型数量(PCS)"
+          <el-descriptions-item label="牌号 | 型号"
             >{{ infoData.brandNo }}|{{ infoData.model }}</el-descriptions-item
           >
+          <el-descriptions-item label="要求成型数量(PCS)">{{
+            infoData.number
+          }}</el-descriptions-item>
           <el-descriptions-item label="要求成型重量(KG)">{{
             infoData.formingWeight
           }}</el-descriptions-item>
@@ -104,10 +104,10 @@
           :label="item.name"
           :name="item.name"
           v-for="item in tabList"
-          :key="item.key"
+          :key="item.id"
         ></el-tab-pane>
-        <!-- <el-tab-pane label="挤压成型" name="挤压成型"></el-tab-pane>
-        <el-tab-pane label="自然干燥" name="自然干燥"></el-tab-pane>
+        <el-tab-pane label="挤压成型" name="挤压成型"></el-tab-pane>
+        <!--<el-tab-pane label="自然干燥" name="自然干燥"></el-tab-pane>
         <el-tab-pane label="升温干燥" name="升温干燥"></el-tab-pane>
         <el-tab-pane label="半加定长" name="半加定长"></el-tab-pane>
         <el-tab-pane label="备炉" name="备炉"></el-tab-pane>
@@ -120,6 +120,8 @@
         ref="reportRef"
         :is="componentsList[activeName] || 'Common'"
         :key="activeName"
+        :infoData="infoData"
+        :taskInfo="tabList.find((item) => item.name === activeName)"
       ></components>
       <div class="footer">
         <el-button type="primary" @click="handleReport">一键报工</el-button>
@@ -180,6 +182,15 @@
           const curIndex = this.tabList.findIndex(
             (item) => item.name === this.activeName
           );
+
+          data.workReportCategoryList = data.workReportCategoryList || [
+            {
+              code: this.infoData.productCode,
+              name: this.infoData.productName,
+              batchNo: '',
+              brandNum: this.infoData.brandNo
+            }
+          ];
           const params = {
             lastTaskCode:
               this.tabList[curIndex > 0 ? curIndex - 1 : curIndex].code,
@@ -196,7 +207,7 @@
         const res1 = await getTaskListById(res.produceVersionId);
 
         this.tabList = res1;
-
+        console.log(this.tabList);
         this.activeName = res1[0]?.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: {