quwangxin il y a 3 ans
Parent
commit
735d85125f

+ 15 - 6
src/api/classifyManage/itemInformation.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request';
 // 物品信息列表
-export async function getList (params) {
+export async function getList(params) {
   const res = await request.get('/main/category/getList', { params });
   if (res.data.code == 0) {
     return res.data.data;
@@ -8,7 +8,7 @@ export async function getList (params) {
   return Promise.reject(new Error(res.data.message));
 }
 // 物品信息保存
-export async function informationAdd (data) {
+export async function informationAdd(data) {
   const res = await request.post('/main/category/add', data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -17,7 +17,7 @@ export async function informationAdd (data) {
 }
 
 // 物品信息编辑
-export async function informationEdit (data) {
+export async function informationEdit(data) {
   const res = await request.post('/main/category/edit', data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -26,7 +26,7 @@ export async function informationEdit (data) {
 }
 
 // 物品信息详情
-export async function getDetails (id) {
+export async function getDetails(id) {
   const res = await request.get(`/main/category/info/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -35,7 +35,7 @@ export async function getDetails (id) {
 }
 
 // 物品信息删除
-export async function removeItem (id) {
+export async function removeItem(id) {
   const res = await request.get(`/main/category/remove/${id}`, {});
   if (res.data.code == 0) {
     return res.data.data;
@@ -44,10 +44,19 @@ export async function removeItem (id) {
 }
 
 // 物品信息获取编码
-export async function getOrderNo (prefix) {
+export async function getOrderNo(prefix) {
   const res = await request.get(`/main/category/createOrderNo/${prefix}`, {});
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 实例
+export async function getByRootLevelId(levelId) {
+  const res = await request.get(`/main/asset/getByRootLevelId/${levelId}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 1 - 0
src/enum/dict.js

@@ -10,6 +10,7 @@ export default {
   金额单位: 'money_unit',
   仓库: 'warehouse',
   时间单位: 'time_unit',
+  处置仓库: 'modificatiWnarehouse',
   日期方式: 'date_method'
 };
 export const numberList = ['date_method'];

+ 117 - 0
src/views/produceOrder/components/carDialog.vue

@@ -0,0 +1,117 @@
+<template>
+  <ele-modal
+    :visible.sync="visible"
+    title="选择周转车"
+    width="65vw"
+    append-to-body
+  >
+    <div class="search-box">
+      编码/名称
+      <el-input placeholder="请输入" v-model="searchKey"></el-input>
+    </div>
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="tableRef"
+      :columns="columns"
+      @done="handleDone"
+      row-key="id"
+      cache-key="materialDialogtable"
+      :datasource="datasource"
+      :selection.sync="selection"
+      height="45vh"
+    >
+    </ele-pro-table>
+    <div class="footer" slot="footer">
+      <el-button @click="cancel">取消</el-button>
+      <el-button @click="confirm" type="primary">确定</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getByRootLevelId } from '@/api/classifyManage/itemInformation';
+  export default {
+    data() {
+      return {
+        visible: false,
+        selection: [],
+        callback: null,
+        searchKey: ''
+      };
+    },
+    computed: {
+      columns() {
+        const list = [
+          {
+            label: '编码',
+            prop: 'code'
+          },
+          {
+            label: '名称',
+            prop: 'name'
+          },
+          {
+            label: '牌号',
+            prop: 'brand'
+          },
+          {
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          }
+        ];
+        return list;
+      }
+    },
+    methods: {
+      open(memo, callback) {
+        this.memo = memo;
+        this.callback = callback;
+        this.visible = true;
+      },
+      reload() {
+        this.$refs.tableRef.reload();
+      },
+      handleDone({ data }) {
+        if (this.memo?.length) {
+          this.$nextTick(() => {
+            this.memo.forEach((itm) => {
+              this.$refs.tableRef.setCurrentRow(
+                data.find((item) => item.id == itm.id)
+              );
+            });
+          });
+        }
+      },
+
+      datasource() {
+        return getByRootLevelId(7).then((res) => ({ list: res }));
+      },
+      confirm() {
+        if (!this.selection.length) return this.$message.error('请选择数据');
+
+        this.callback && this.callback(this.selection);
+
+        this.cancel();
+      },
+      cancel() {
+        this.$refs.tableRef.setCurrentRow();
+        this.searchKey = '';
+        this.visible = false;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .search-box {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    margin-bottom: 20px;
+    .el-input {
+      width: 220px;
+      margin: 0 32px;
+    }
+  }
+</style>

+ 9 - 9
src/views/produceOrder/components/catogaryDialog.vue

@@ -1,7 +1,7 @@
 <template>
   <ele-modal
     :visible.sync="visible"
-    :title="categoryLevelId==5?'选择模具':'选择舟皿'"
+    :title="categoryLevelId == 5 ? '选择模具' : '选择舟皿'"
     width="65vw"
     append-to-body
   >
@@ -33,7 +33,7 @@
 <script>
   import { getList } from '@/api/classifyManage/itemInformation';
   export default {
-    data () {
+    data() {
       return {
         visible: false,
         current: null,
@@ -43,7 +43,7 @@
       };
     },
     computed: {
-      columns () {
+      columns() {
         const list = [
           {
             label: '编码',
@@ -62,16 +62,16 @@
       }
     },
     methods: {
-      open (categoryLevelId, memo, callback) {
+      open(categoryLevelId, memo, callback) {
         this.categoryLevelId = categoryLevelId;
         this.memo = memo;
         this.callback = callback;
         this.visible = true;
       },
-      reload () {
+      reload() {
         this.$refs.tableRef.reload();
       },
-      handleDone ({ data }) {
+      handleDone({ data }) {
         if (this.memo?.id) {
           this.$nextTick(() => {
             this.$refs.tableRef.setCurrentRow(
@@ -81,7 +81,7 @@
         }
       },
 
-      datasource ({ page, limit }) {
+      datasource({ page, limit }) {
         return getList({
           pageNum: page,
           size: limit,
@@ -90,14 +90,14 @@
           searchKey: this.searchKey
         });
       },
-      confirm () {
+      confirm() {
         if (!this.current) return this.$message.error('请选择数据');
 
         this.callback && this.callback(this.current);
 
         this.cancel();
       },
-      cancel () {
+      cancel() {
         this.$refs.tableRef.setCurrentRow();
         this.searchKey = '';
         this.current = null;

+ 131 - 10
src/views/produceOrder/components/report/Common.vue

@@ -111,7 +111,7 @@
             placeholder="请输入"
           ></el-input
         ></el-descriptions-item>
-        <el-descriptions-item label="">
+        <!-- <el-descriptions-item label="">
           <span class="label-required after" slot="label">合格品数量(PCS)</span>
           <el-form-item
             label=""
@@ -152,7 +152,7 @@
               "
               clearable
             ></el-input> </el-form-item
-        ></el-descriptions-item>
+        ></el-descriptions-item> -->
         <el-descriptions-item label="">
           <span class="label-required after" slot="label"
             >不合格品数量(PCS)</span
@@ -174,7 +174,14 @@
                     : value)
               "
               clearable
-            ></el-input>
+              ><el-button
+                type="primary"
+                slot="suffix"
+                size="mini"
+                @click="handleOpen(1)"
+                >处置</el-button
+              ></el-input
+            >
           </el-form-item>
         </el-descriptions-item>
         <el-descriptions-item label="不合格品重量(KG)"
@@ -193,7 +200,7 @@
             clearable
           ></el-input
         ></el-descriptions-item>
-        <el-descriptions-item label="副产品重量(KG)"
+        <!-- <el-descriptions-item label="副产品重量(KG)"
           ><el-input
             class="w100"
             v-model="workReport.productInfo.byProductWeight"
@@ -204,8 +211,16 @@
                   : value)
             "
             clearable
-          ></el-input
-        ></el-descriptions-item>
+            ><el-button
+              type="primary"
+              style="margin-top: 4px"
+              slot="suffix"
+              size="mini"
+              @click="handleOpen(2)"
+              >处置</el-button
+            ></el-input
+          ></el-descriptions-item
+        > -->
         <el-descriptions-item label="备注">
           <el-input v-model="workReport.remark"></el-input
         ></el-descriptions-item>
@@ -239,8 +254,40 @@
           ></el-descriptions-item
         >
       </el-descriptions>
+      <ele-pro-table
+        :columns="columns"
+        :datasource="carList"
+        :need-page="false"
+        class="mt-16"
+      >
+        <template v-slot:toolbar>
+          <el-link type="primary" @click="addCar">添加周转车</el-link>
+        </template>
+        <template v-slot:action="{ $index }">
+          <el-link type="danger" @click="handleDelete($index)">删除</el-link>
+        </template>
+        <template v-slot:standardNum="{ row }">
+          <el-input
+            v-model="row.standardNum"
+            @change="
+              () => {
+                row.standardWeight =
+                  row.standardNum === ''
+                    ? ''
+                    : multiply(
+                        row.standardNum,
+                        infoData.productUnitWeight || 1
+                      );
+              }
+            "
+            placeholder="请输入"
+          ></el-input>
+        </template>
+      </ele-pro-table>
     </el-card>
     <equipmentDailog ref="equipmentRef" :taskId="taskInfo.id" />
+    <carDialog ref="carDialogRef" />
+    <handleDialog ref="handleDialogRef" />
   </el-form>
 </template>
 
@@ -249,9 +296,16 @@
   import equipmentDailog from '@/components/EquipmentDailog/report-equipment';
   import { reportCount } from '@/api/produceOrder';
   import dayjs from 'dayjs';
+  import carDialog from '../carDialog.vue';
+  import handleDialog from './components/handleDialog';
   import { multiply } from '@/utils/math';
   export default {
-    components: { personSelectRemote, equipmentDailog },
+    components: {
+      handleDialog,
+      carDialog,
+      personSelectRemote,
+      equipmentDailog
+    },
     props: {
       infoData: {
         type: Object,
@@ -276,6 +330,34 @@
     },
     data() {
       return {
+        columns: [
+          {
+            label: '序号',
+            type: 'index',
+            width: 55
+          },
+          {
+            label: '编码',
+            prop: 'code'
+          },
+          {
+            label: '名称',
+            prop: 'name'
+          },
+          {
+            label: '合格品数量',
+            slot: 'standardNum'
+          },
+          {
+            label: '合格品重量',
+            prop: 'standardWeight'
+          },
+          {
+            label: '操作',
+            slot: 'action'
+          }
+        ],
+        carList: [],
         categoryMsg: {
           batchNo: '',
           number: '',
@@ -294,7 +376,7 @@
           executeTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
           remark: '',
           productInfo: {
-            byProductWeight: '',
+            // byProductWeight: '',
             standardNum: '',
             standardWeight: '',
             noStandardNum: '',
@@ -309,6 +391,7 @@
           rootCategoryLevelId: '',
           specification: ''
         },
+        disposeOrderList: [],
         countMsg: {}
       };
     },
@@ -365,6 +448,37 @@
     },
     methods: {
       multiply,
+      handleDelete(index) {
+        this.$confirm('确认删除当前周转车?').then(() => {
+          this.carList.splice(index, 1);
+        });
+      },
+      addCar() {
+        this.$refs.carDialogRef.open(this.carList, (list) => {
+          this.carList = list.map((item) => ({
+            ...item,
+            sourceCategoryId: item.categoryId,
+            brandNum: item.brand,
+            standardWeight: '',
+            standardNum: ''
+          }));
+        });
+      },
+      handleOpen(disposeType) {
+        this.$refs.handleDialogRef.open(disposeType, (data) => {
+          data.workOrderCode = this.infoData.code;
+          data.workOrderId = this.infoData.id;
+
+          let index = this.disposeOrderList.find(
+            (i) => i.disposeType == disposeType
+          );
+          if (index > -1) {
+            this.disposeOrderList[index] = data;
+          } else {
+            this.disposeOrderList.push(data);
+          }
+        });
+      },
       async getReportCount() {
         const res = await reportCount({
           taskCode: this.taskInfo.code,
@@ -396,7 +510,9 @@
             if (!this.workReportDeviceList.code) {
               return this.$message.error('请选择设备');
             }
-
+            if (!this.carList.length) {
+              return this.$message.error('请选择周转车');
+            }
             this.$confirm('是否确定要报工?', '提示').then(() => {
               this.categoryMsg = Object.assign(this.categoryMsg, {
                 brandNum: this.infoData.brandNo,
@@ -404,10 +520,15 @@
                 name: this.infoData.productName,
                 code: this.infoData.productCode
               });
+              const workReportDeviceList = this.carList;
+              if (this.workReportDeviceList.code) {
+                workReportDeviceList.push(this.workReportDeviceList);
+              }
               fun({
                 checkState: 1,
+                disposeOrderList: this.disposeOrderList,
                 workReport: this.workReport,
-                workReportDeviceList: [this.workReportDeviceList],
+                workReportDeviceList,
                 workReportCategoryList: [this.categoryMsg]
               }).then((res) => {
                 // this.$message.success('报工成功!');

+ 134 - 12
src/views/produceOrder/components/report/Drying.vue

@@ -128,7 +128,7 @@
             placeholder="请输入"
           ></el-input
         ></el-descriptions-item>
-        <el-descriptions-item label="">
+        <!-- <el-descriptions-item label="">
           <span class="label-required after" slot="label">合格品数量(PCS)</span>
           <el-form-item
             label=""
@@ -169,7 +169,7 @@
               "
               clearable
             ></el-input> </el-form-item
-        ></el-descriptions-item>
+        ></el-descriptions-item> -->
         <el-descriptions-item label="">
           <span class="label-required after" slot="label"
             >不合格品数量(PCS)</span
@@ -191,7 +191,15 @@
                     : value)
               "
               clearable
-            ></el-input>
+            >
+              <el-button
+                type="primary"
+                slot="suffix"
+                size="mini"
+                @click="handleOpen(1)"
+                >处置</el-button
+              ></el-input
+            >
           </el-form-item>
         </el-descriptions-item>
         <el-descriptions-item label="不合格品重量(KG)"
@@ -210,7 +218,7 @@
             clearable
           ></el-input
         ></el-descriptions-item>
-        <el-descriptions-item label="副产品重量(KG)"
+        <!-- <el-descriptions-item label="副产品重量(KG)"
           ><el-input
             class="w100"
             v-model="workReport.productInfo.byProductWeight"
@@ -221,12 +229,51 @@
                   : value)
             "
             clearable
-          ></el-input
-        ></el-descriptions-item>
+          >
+            <el-button
+              type="primary"
+              slot="suffix"
+              style="margin-top: 4px"
+              size="mini"
+              @click="handleOpen(2)"
+              >处置</el-button
+            ></el-input
+          ></el-descriptions-item
+        > -->
         <el-descriptions-item label="备注">
           <el-input v-model="workReport.remark"></el-input
         ></el-descriptions-item>
       </el-descriptions>
+      <ele-pro-table
+        :columns="columns"
+        :datasource="carList"
+        :need-page="false"
+        class="mt-16"
+      >
+        <template v-slot:toolbar>
+          <el-link type="primary" @click="addCar">添加周转车</el-link>
+        </template>
+        <template v-slot:action="{ $index }">
+          <el-link type="danger" @click="handleDelete($index)">删除</el-link>
+        </template>
+        <template v-slot:standardNum="{ row }">
+          <el-input
+            v-model="row.standardNum"
+            @change="
+              () => {
+                row.standardWeight =
+                  row.standardNum === ''
+                    ? ''
+                    : multiply(
+                        row.standardNum,
+                        infoData.productUnitWeight || 1
+                      );
+              }
+            "
+            placeholder="请输入"
+          ></el-input>
+        </template>
+      </ele-pro-table>
       <el-descriptions
         class="mt-16"
         title="干燥区域信息"
@@ -260,6 +307,7 @@
       </el-descriptions>
     </el-card>
     <workshopDailog ref="workshopRef" :taskId="taskInfo.id" />
+    <carDialog ref="carDialogRef" />
     <catogaryDialog ref="catogaryDialogRef" />
   </el-form>
 </template>
@@ -270,9 +318,15 @@
   import { reportCount } from '@/api/produceOrder';
   import catogaryDialog from '../catogaryDialog.vue';
   import dayjs from 'dayjs';
+  import carDialog from '../carDialog.vue';
   import { multiply } from '@/utils/math';
   export default {
-    components: { personSelectRemote, workshopDailog, catogaryDialog },
+    components: {
+      personSelectRemote,
+      workshopDailog,
+      carDialog,
+      catogaryDialog
+    },
     props: {
       infoData: {
         type: Object,
@@ -315,7 +369,7 @@
           executeTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
           remark: '',
           productInfo: {
-            byProductWeight: '',
+            // byProductWeight: '',
             standardNum: '',
             standardWeight: '',
             noStandardNum: '',
@@ -333,6 +387,8 @@
             dryTime: ''
           }
         },
+        carList: [],
+        disposeOrderList: [],
         countMsg: {},
         // 舟皿信息
         boatMsg: {
@@ -345,7 +401,35 @@
           extraField: {
             boatNum: ''
           }
-        }
+        },
+        columns: [
+          {
+            label: '序号',
+            type: 'index',
+            width: 55
+          },
+          {
+            label: '编码',
+            prop: 'code'
+          },
+          {
+            label: '名称',
+            prop: 'name'
+          },
+          {
+            label: '合格品数量',
+            slot: 'standardNum'
+          },
+          {
+            label: '合格品重量',
+            prop: 'standardWeight'
+          },
+          {
+            label: '操作',
+            slot: 'action'
+          }
+        ],
+        workReportDeviceList: {}
       };
     },
     created() {
@@ -401,6 +485,37 @@
     },
     methods: {
       multiply,
+      handleOpen(disposeType) {
+        this.$refs.handleDialogRef.open(disposeType, (data) => {
+          data.workOrderCode = this.infoData.code;
+          data.workOrderId = this.infoData.id;
+
+          let index = this.disposeOrderList.find(
+            (i) => i.disposeType == disposeType
+          );
+          if (index > -1) {
+            this.disposeOrderList[index] = data;
+          } else {
+            this.disposeOrderList.push(data);
+          }
+        });
+      },
+      handleDelete(index) {
+        this.$confirm('确认删除当前周转车?').then(() => {
+          this.carList.splice(index, 1);
+        });
+      },
+      addCar() {
+        this.$refs.carDialogRef.open(this.carList, (list) => {
+          this.carList = list.map((item) => ({
+            ...item,
+            sourceCategoryId: item.categoryId,
+            brandNum: item.brand,
+            standardWeight: '',
+            standardNum: ''
+          }));
+        });
+      },
       getCategory(id, memo) {
         this.$refs.catogaryDialogRef.open(id, this[memo], (res) => {
           this[memo].rootCategoryLevelId = res.categoryLevelId;
@@ -448,13 +563,20 @@
               if (this.boatMsg.code) {
                 workReportCategoryList.push(this.boatMsg);
               }
+              if (!this.carList.length) {
+                return this.$message.error('请选择周转车');
+              }
+
+              const workReportDeviceList = this.carList;
+              if (this.workReportDeviceList.code) {
+                workReportDeviceList.push(this.workReportDeviceList);
+              }
               fun({
                 checkState: 1,
+                disposeOrderList: this.disposeOrderList,
                 workReportArea: this.workReportArea,
                 workReport: this.workReport,
-                workReportDeviceList: this.workReportDeviceList
-                  ? [this.workReportDeviceList]
-                  : [],
+                workReportDeviceList,
                 workReportCategoryList
               }).then((res) => {
                 // this.$message.success('报工成功!');

+ 127 - 11
src/views/produceOrder/components/report/Extrusion.vue

@@ -131,7 +131,7 @@
             placeholder="请输入"
           ></el-input
         ></el-descriptions-item>
-        <el-descriptions-item label="">
+        <!-- <el-descriptions-item label="">
           <span class="label-required after" slot="label">合格品数量(PCS)</span>
           <el-form-item
             label=""
@@ -172,7 +172,7 @@
               "
               clearable
             ></el-input> </el-form-item
-        ></el-descriptions-item>
+        ></el-descriptions-item> -->
         <el-descriptions-item label="">
           <span class="label-required after" slot="label"
             >不合格品数量(PCS)</span
@@ -186,6 +186,7 @@
           >
             <el-input
               class="w100"
+              placeholder="请输入"
               v-model="workReport.productInfo.noStandardNum"
               @input="
                 (value) =>
@@ -194,12 +195,21 @@
                     : value)
               "
               clearable
-            ></el-input>
+            >
+              <el-button
+                type="primary"
+                slot="suffix"
+                size="mini"
+                @click="handleOpen(1)"
+                >处置</el-button
+              >
+            </el-input>
           </el-form-item>
         </el-descriptions-item>
         <el-descriptions-item label="不合格品重量(KG)"
           ><el-input
             class="w100"
+            placeholder="请输入"
             :value="
               (workReport.productInfo.noStandardWeight =
                 workReport.productInfo.noStandardNum === ''
@@ -223,8 +233,16 @@
                   : value)
             "
             clearable
-          ></el-input
-        ></el-descriptions-item>
+            ><el-button
+              type="primary"
+              style="margin-top: 4px"
+              slot="suffix"
+              size="mini"
+              @click="handleOpen(2)"
+              >处置</el-button
+            ></el-input
+          ></el-descriptions-item
+        >
         <el-descriptions-item label="备注">
           <el-input v-model="workReport.remark"></el-input
         ></el-descriptions-item>
@@ -277,7 +295,7 @@
             v-model="moduleMsg.extraField.stampingTimes"
           ></el-input
         ></el-descriptions-item>
-        <el-descriptions-item label="舟皿编码/名称"
+        <!-- <el-descriptions-item label="周转车编码/名称"
           ><el-input
             :value="`${boatMsg.code}/${boatMsg.name}`"
             @click.native="getCategory('8', 'boatMsg')"
@@ -292,8 +310,39 @@
             placeholder="请输入"
             v-model="boatMsg.extraField.boatNum"
           ></el-input
-        ></el-descriptions-item>
+        ></el-descriptions-item> -->
       </el-descriptions>
+
+      <ele-pro-table
+        :columns="columns"
+        :datasource="carList"
+        :need-page="false"
+        class="mt-16"
+      >
+        <template v-slot:toolbar>
+          <el-link type="primary" @click="addCar">添加周转车</el-link>
+        </template>
+        <template v-slot:action="{ $index }">
+          <el-link type="danger" @click="handleDelete($index)">删除</el-link>
+        </template>
+        <template v-slot:standardNum="{ row }">
+          <el-input
+            v-model="row.standardNum"
+            @change="
+              () => {
+                row.standardWeight =
+                  row.standardNum === ''
+                    ? ''
+                    : multiply(
+                        row.standardNum,
+                        infoData.productUnitWeight || 1
+                      );
+              }
+            "
+            placeholder="请输入"
+          ></el-input>
+        </template>
+      </ele-pro-table>
     </el-card>
     <equipmentDailog ref="equipmentRef" :taskId="taskInfo.id" />
     <materialDialog
@@ -305,6 +354,8 @@
     />
 
     <catogaryDialog ref="catogaryDialogRef" />
+    <carDialog ref="carDialogRef" />
+    <handleDialog ref="handleDialogRef" />
   </el-form>
 </template>
 
@@ -314,14 +365,18 @@
   import equipmentDailog from '@/components/EquipmentDailog/report-equipment';
   import materialDialog from '../materialDialog.vue';
   import catogaryDialog from '../catogaryDialog.vue';
+  import carDialog from '../carDialog.vue';
   import { reportCount, getSoltNum } from '@/api/produceOrder';
   import { multiply } from '@/utils/math';
+  import handleDialog from './components/handleDialog';
   import dayjs from 'dayjs';
   export default {
     components: {
+      handleDialog,
       personSelectRemote,
       equipmentDailog,
       materialDialog,
+      carDialog,
       catogaryDialog
     },
     props: {
@@ -348,6 +403,34 @@
     },
     data() {
       return {
+        columns: [
+          {
+            label: '序号',
+            type: 'index',
+            width: 55
+          },
+          {
+            label: '编码',
+            prop: 'code'
+          },
+          {
+            label: '名称',
+            prop: 'name'
+          },
+          {
+            label: '合格品数量',
+            slot: 'standardNum'
+          },
+          {
+            label: '合格品重量',
+            prop: 'standardWeight'
+          },
+          {
+            label: '操作',
+            slot: 'action'
+          }
+        ],
+        carList: [],
         categoryMsg: {
           batchNo: '',
           number: '',
@@ -409,6 +492,7 @@
           }
         },
         batchList: [],
+        disposeOrderList: [],
         slotNum: ''
       };
     },
@@ -465,6 +549,37 @@
     },
     methods: {
       multiply,
+      handleDelete(index) {
+        this.$confirm('确认删除当前周转车?').then(() => {
+          this.carList.splice(index, 1);
+        });
+      },
+      addCar() {
+        this.$refs.carDialogRef.open(this.carList, (list) => {
+          this.carList = list.map((item) => ({
+            ...item,
+            sourceCategoryId: item.categoryId,
+            brandNum: item.brand,
+            standardWeight: '',
+            standardNum: ''
+          }));
+        });
+      },
+      handleOpen(disposeType) {
+        this.$refs.handleDialogRef.open(disposeType, (data) => {
+          data.workOrderCode = this.infoData.code;
+          data.workOrderId = this.infoData.id;
+
+          let index = this.disposeOrderList.find(
+            (i) => i.disposeType == disposeType
+          );
+          if (index > -1) {
+            this.disposeOrderList[index] = data;
+          } else {
+            this.disposeOrderList.push(data);
+          }
+        });
+      },
       getCategory(id, memo) {
         this.$refs.catogaryDialogRef.open(id, this[memo], (res) => {
           if (id == '8') {
@@ -543,23 +658,24 @@
             if (!this.workReportDeviceList.code) {
               return this.$message.error('请选择设备');
             }
+            if (!this.carList.length) {
+              return this.$message.error('请选择周转车');
+            }
 
             this.$confirm('是否确定要报工?', '提示').then(() => {
-              const workReportDeviceList = [];
+              const workReportDeviceList = this.carList;
               if (this.workReportDeviceList.code) {
                 workReportDeviceList.push(this.workReportDeviceList);
               }
               if (this.moduleMsg.code) {
                 workReportDeviceList.push(this.moduleMsg);
               }
-              if (this.boatMsg.code) {
-                workReportDeviceList.push(this.boatMsg);
-              }
 
               // this.categoryMsg.totalWeight = this.categoryMsg.number;
               fun({
                 checkState: 1,
                 isSapReportState: 1,
+                disposeOrderList: this.disposeOrderList,
                 workReport: this.workReport,
                 workReportCategoryList: [this.categoryMsg],
                 workReportDeviceList

+ 134 - 10
src/views/produceOrder/components/report/HalfAdded.vue

@@ -123,7 +123,7 @@
             placeholder="请输入"
           ></el-input
         ></el-descriptions-item>
-        <el-descriptions-item label="">
+        <!-- <el-descriptions-item label="">
           <span class="label-required after" slot="label">合格品数量(PCS)</span>
           <el-form-item
             label=""
@@ -164,7 +164,7 @@
               "
               clearable
             ></el-input> </el-form-item
-        ></el-descriptions-item>
+        ></el-descriptions-item> -->
         <el-descriptions-item label="">
           <span class="label-required after" slot="label"
             >不合格品数量(PCS)</span
@@ -186,7 +186,14 @@
                     : value)
               "
               clearable
-            ></el-input>
+              ><el-button
+                type="primary"
+                slot="suffix"
+                size="mini"
+                @click="handleOpen(1)"
+                >处置</el-button
+              ></el-input
+            >
           </el-form-item>
         </el-descriptions-item>
         <el-descriptions-item label="不合格品重量(KG)"
@@ -205,7 +212,7 @@
             clearable
           ></el-input
         ></el-descriptions-item>
-        <el-descriptions-item label="副产品重量(KG)"
+        <!-- <el-descriptions-item label="副产品重量(KG)"
           ><el-input
             class="w100"
             v-model="workReport.productInfo.byProductWeight"
@@ -216,8 +223,16 @@
                   : value)
             "
             clearable
-          ></el-input
-        ></el-descriptions-item>
+            ><el-button
+              type="primary"
+              style="margin-top: 4px"
+              slot="suffix"
+              size="mini"
+              @click="handleOpen(2)"
+              >处置</el-button
+            ></el-input
+          ></el-descriptions-item
+        > -->
         <el-descriptions-item label="备注">
           <el-input v-model="workReport.remark"></el-input
         ></el-descriptions-item>
@@ -251,9 +266,41 @@
           ></el-descriptions-item
         >
       </el-descriptions>
+      <ele-pro-table
+        :columns="columns"
+        :datasource="carList"
+        :need-page="false"
+        class="mt-16"
+      >
+        <template v-slot:toolbar>
+          <el-link type="primary" @click="addCar">添加周转车</el-link>
+        </template>
+        <template v-slot:action="{ $index }">
+          <el-link type="danger" @click="handleDelete($index)">删除</el-link>
+        </template>
+        <template v-slot:standardNum="{ row }">
+          <el-input
+            v-model="row.standardNum"
+            @change="
+              () => {
+                row.standardWeight =
+                  row.standardNum === ''
+                    ? ''
+                    : multiply(
+                        row.standardNum,
+                        infoData.productUnitWeight || 1
+                      );
+              }
+            "
+            placeholder="请输入"
+          ></el-input>
+        </template>
+      </ele-pro-table>
     </el-card>
     <equipmentDailog ref="equipmentRef" :taskId="taskInfo.id" />
     <catogaryDialog ref="catogaryDialogRef" />
+    <carDialog ref="carDialogRef" />
+    <handleDialog ref="handleDialogRef" />
   </el-form>
 </template>
 
@@ -262,10 +309,18 @@
   import equipmentDailog from '@/components/EquipmentDailog/report-equipment';
   import { reportCount } from '@/api/produceOrder';
   import catogaryDialog from '../catogaryDialog.vue';
+  import carDialog from '../carDialog.vue';
+  import handleDialog from './components/handleDialog';
   import dayjs from 'dayjs';
   import { multiply } from '@/utils/math';
   export default {
-    components: { personSelectRemote, equipmentDailog, catogaryDialog },
+    components: {
+      personSelectRemote,
+      handleDialog,
+      carDialog,
+      equipmentDailog,
+      catogaryDialog
+    },
     props: {
       infoData: {
         type: Object,
@@ -290,6 +345,34 @@
     },
     data() {
       return {
+        columns: [
+          {
+            label: '序号',
+            type: 'index',
+            width: 55
+          },
+          {
+            label: '编码',
+            prop: 'code'
+          },
+          {
+            label: '名称',
+            prop: 'name'
+          },
+          {
+            label: '合格品数量',
+            slot: 'standardNum'
+          },
+          {
+            label: '合格品重量',
+            prop: 'standardWeight'
+          },
+          {
+            label: '操作',
+            slot: 'action'
+          }
+        ],
+        carList: [],
         categoryMsg: {
           batchNo: '',
           number: '',
@@ -308,7 +391,7 @@
           executeTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
           remark: '',
           productInfo: {
-            byProductWeight: '',
+            // byProductWeight: '',
             standardNum: '',
             standardWeight: '',
             noStandardNum: '',
@@ -335,7 +418,8 @@
           extraField: {
             boatNum: ''
           }
-        }
+        },
+        disposeOrderList: []
       };
     },
     watch: {
@@ -391,6 +475,37 @@
     },
     methods: {
       multiply,
+      handleDelete(index) {
+        this.$confirm('确认删除当前周转车?').then(() => {
+          this.carList.splice(index, 1);
+        });
+      },
+      addCar() {
+        this.$refs.carDialogRef.open(this.carList, (list) => {
+          this.carList = list.map((item) => ({
+            ...item,
+            sourceCategoryId: item.categoryId,
+            brandNum: item.brand,
+            standardWeight: '',
+            standardNum: ''
+          }));
+        });
+      },
+      handleOpen(disposeType) {
+        this.$refs.handleDialogRef.open(disposeType, (data) => {
+          data.workOrderCode = this.infoData.code;
+          data.workOrderId = this.infoData.id;
+
+          let index = this.disposeOrderList.find(
+            (i) => i.disposeType == disposeType
+          );
+          if (index > -1) {
+            this.disposeOrderList[index] = data;
+          } else {
+            this.disposeOrderList.push(data);
+          }
+        });
+      },
       getCategory(id, memo) {
         this.$refs.catogaryDialogRef.open(id, this[memo], (res) => {
           this[memo].rootCategoryLevelId = res.categoryLevelId;
@@ -437,6 +552,10 @@
             if (!this.workReportDeviceList.code) {
               return this.$message.error('请选择设备');
             }
+            if (!this.carList.length) {
+              return this.$message.error('请选择周转车');
+            }
+
             this.$confirm('是否确定要报工?', '提示').then(() => {
               this.categoryMsg = Object.assign(this.categoryMsg, {
                 brandNum: this.infoData.brandNo,
@@ -448,10 +567,15 @@
               if (this.boatMsg.code) {
                 workReportCategoryList.push(this.boatMsg);
               }
+
+              const workReportDeviceList = this.carList;
+              if (this.workReportDeviceList.code) {
+                workReportDeviceList.push(this.workReportDeviceList);
+              }
               fun({
                 checkState: 1,
                 workReport: this.workReport,
-                workReportDeviceList: [this.workReportDeviceList],
+                workReportDeviceList: workReportDeviceList,
                 workReportCategoryList
               }).then((res) => {
                 // this.$message.success('报工成功!');

+ 137 - 12
src/views/produceOrder/components/report/Heating.vue

@@ -123,7 +123,7 @@
             placeholder="请输入"
           ></el-input
         ></el-descriptions-item>
-        <el-descriptions-item label="">
+        <!-- <el-descriptions-item label="">
           <span class="label-required after" slot="label">合格品数量(PCS)</span>
           <el-form-item
             label=""
@@ -164,7 +164,7 @@
               "
               clearable
             ></el-input> </el-form-item
-        ></el-descriptions-item>
+        ></el-descriptions-item> -->
         <el-descriptions-item label="">
           <span class="label-required after" slot="label"
             >不合格品数量(PCS)</span
@@ -186,7 +186,14 @@
                     : value)
               "
               clearable
-            ></el-input>
+              ><el-button
+                type="primary"
+                slot="suffix"
+                size="mini"
+                @click="handleOpen(1)"
+                >处置</el-button
+              ></el-input
+            >
           </el-form-item>
         </el-descriptions-item>
         <el-descriptions-item label="不合格品重量(KG)"
@@ -205,7 +212,7 @@
             clearable
           ></el-input
         ></el-descriptions-item>
-        <el-descriptions-item label="副产品重量(KG)"
+        <!-- <el-descriptions-item label="副产品重量(KG)"
           ><el-input
             class="w100"
             v-model="workReport.productInfo.byProductWeight"
@@ -216,12 +223,51 @@
                   : value)
             "
             clearable
-          ></el-input
-        ></el-descriptions-item>
+            ><el-button
+              type="primary"
+              style="margin-top: 4px"
+              slot="suffix"
+              size="mini"
+              @click="handleOpen(2)"
+              >处置</el-button
+            ></el-input
+          ></el-descriptions-item
+        > -->
         <el-descriptions-item label="备注">
           <el-input v-model="workReport.remark"></el-input
         ></el-descriptions-item>
       </el-descriptions>
+
+      <ele-pro-table
+        :columns="columns"
+        :datasource="carList"
+        :need-page="false"
+        class="mt-16"
+      >
+        <template v-slot:toolbar>
+          <el-link type="primary" @click="addCar">添加周转车</el-link>
+        </template>
+        <template v-slot:action="{ $index }">
+          <el-link type="danger" @click="handleDelete($index)">删除</el-link>
+        </template>
+        <template v-slot:standardNum="{ row }">
+          <el-input
+            v-model="row.standardNum"
+            @change="
+              () => {
+                row.standardWeight =
+                  row.standardNum === ''
+                    ? ''
+                    : multiply(
+                        row.standardNum,
+                        infoData.productUnitWeight || 1
+                      );
+              }
+            "
+            placeholder="请输入"
+          ></el-input>
+        </template>
+      </ele-pro-table>
       <el-descriptions
         title="设备信息"
         class="mt-16"
@@ -260,6 +306,8 @@
     </el-card>
     <equipmentDailog ref="equipmentRef" :taskId="taskInfo.id" />
     <catogaryDialog ref="catogaryDialogRef" />
+    <carDialog ref="carDialogRef" />
+    <handleDialog ref="handleDialogRef" />
   </el-form>
 </template>
 
@@ -268,10 +316,18 @@
   import equipmentDailog from '@/components/EquipmentDailog/report-equipment';
   import { reportCount } from '@/api/produceOrder';
   import catogaryDialog from '../catogaryDialog.vue';
+  import handleDialog from './components/handleDialog';
   import dayjs from 'dayjs';
   import { multiply } from '@/utils/math';
+  import carDialog from '../carDialog.vue';
   export default {
-    components: { personSelectRemote, equipmentDailog, catogaryDialog },
+    components: {
+      handleDialog,
+      personSelectRemote,
+      equipmentDailog,
+      carDialog,
+      catogaryDialog
+    },
     props: {
       infoData: {
         type: Object,
@@ -296,6 +352,33 @@
     },
     data() {
       return {
+        columns: [
+          {
+            label: '序号',
+            type: 'index',
+            width: 55
+          },
+          {
+            label: '编码',
+            prop: 'code'
+          },
+          {
+            label: '名称',
+            prop: 'name'
+          },
+          {
+            label: '合格品数量',
+            slot: 'standardNum'
+          },
+          {
+            label: '合格品重量',
+            prop: 'standardWeight'
+          },
+          {
+            label: '操作',
+            slot: 'action'
+          }
+        ],
         categoryMsg: {
           batchNo: '',
           number: '',
@@ -306,6 +389,8 @@
           name: '',
           code: ''
         },
+        carList: [],
+        disposeOrderList: [],
         workReport: {
           qualityItem: '',
           qualityStandard: '',
@@ -314,7 +399,7 @@
           executeTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
           remark: '',
           productInfo: {
-            byProductWeight: '',
+            // byProductWeight: '',
             standardNum: '',
             standardWeight: '',
             noStandardNum: '',
@@ -400,6 +485,37 @@
     },
     methods: {
       multiply,
+      handleDelete(index) {
+        this.$confirm('确认删除当前周转车?').then(() => {
+          this.carList.splice(index, 1);
+        });
+      },
+      addCar() {
+        this.$refs.carDialogRef.open(this.carList, (list) => {
+          this.carList = list.map((item) => ({
+            ...item,
+            sourceCategoryId: item.categoryId,
+            brandNum: item.brand,
+            standardWeight: '',
+            standardNum: ''
+          }));
+        });
+      },
+      handleOpen(disposeType) {
+        this.$refs.handleDialogRef.open(disposeType, (data) => {
+          data.workOrderCode = this.infoData.code;
+          data.workOrderId = this.infoData.id;
+
+          let index = this.disposeOrderList.find(
+            (i) => i.disposeType == disposeType
+          );
+          if (index > -1) {
+            this.disposeOrderList[index] = data;
+          } else {
+            this.disposeOrderList.push(data);
+          }
+        });
+      },
       getCategory(id, memo) {
         this.$refs.catogaryDialogRef.open(id, this[memo], (res) => {
           this[memo].rootCategoryLevelId = res.categoryLevelId;
@@ -446,6 +562,10 @@
             if (!this.workReportDeviceList.code) {
               return this.$message.error('请选择设备');
             }
+            if (!this.carList.length) {
+              return this.$message.error('请选择周转车');
+            }
+
             this.$confirm('是否确定要报工?', '提示').then(() => {
               this.categoryMsg = Object.assign(this.categoryMsg, {
                 brandNum: this.infoData.brandNo,
@@ -454,15 +574,20 @@
                 code: this.infoData.productCode
               });
 
-              const workReportCategoryList = [this.categoryMsg];
+              const workReportDeviceList = this.carList;
+              if (this.workReportDeviceList.code) {
+                workReportDeviceList.push(this.workReportDeviceList);
+              }
+
               if (this.boatMsg.code) {
-                workReportCategoryList.push(this.boatMsg);
+                workReportDeviceList.push(this.boatMsg);
               }
               fun({
                 checkState: 1,
+                disposeOrderList: this.disposeOrderList,
                 workReport: this.workReport,
-                workReportDeviceList: [this.workReportDeviceList],
-                workReportCategoryList
+                workReportDeviceList,
+                workReportCategoryList: [this.categoryMsg]
               }).then((res) => {
                 // this.$message.success('报工成功!');
                 // this.getReportCount();

+ 61 - 0
src/views/produceOrder/components/report/components/handleDialog.vue

@@ -0,0 +1,61 @@
+<template>
+  <ele-modal :visible.sync="visible" title="处置" width="400px">
+    <el-form :model="formData" :rules="rules" ref="formRef">
+      <el-form-item label="处置方式" props="a">
+        <el-input value="改型" readonly></el-input>
+      </el-form-item>
+      <el-form-item label="仓库" props="warehouseCode">
+        <DictSelection dictName="处置仓库" v-model="formData.warehouseCode" />
+      </el-form-item>
+      <el-form-item label="数量" props="disposeWeight">
+        <el-input v-model="formData.disposeWeight" placeholder="请输入">
+          <span slot="suffix"> PCS</span>
+        </el-input>
+      </el-form-item>
+    </el-form>
+    <div slot="footer">
+      <el-button @click="cancel">取消</el-button>
+      <el-button type="primary" @click="confirm">确认</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  export default {
+    data() {
+      return {
+        visible: false,
+        formData: {
+          warehouseCode: '',
+          warehouse: '',
+          disposeWeight: ''
+        },
+        callback: null,
+        rules: {
+          warehouseCode: [{ required: true, message: '请输入' }],
+          disposeWeight: [{ required: true, message: '请输入' }]
+        }
+      };
+    },
+    methods: {
+      open(disposeType, callback) {
+        this.visible = true;
+        this.formData.disposeType = disposeType;
+        this.callback = callback;
+      },
+      confirm() {
+        this.$refs.formRef.validate((value) => {
+          if (value) {
+            this.$emit('confirm', this.formData);
+            this.callback && this.callback(this.formData);
+            this.cancel();
+          }
+        });
+      },
+      cancel() {
+        this.formData = {};
+        this.visible = false;
+      }
+    }
+  };
+</script>