quwangxin 2 лет назад
Родитель
Сommit
8653774011

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

@@ -37,3 +37,11 @@ export async function bomSubListByVersionId (params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+// 工位
+export async function factoryworkstation (params) {
+  const res = await request.get(`/main/factoryworkstation/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 180 - 0
src/components/WorkshopDailog/workshop-dailog.vue

@@ -0,0 +1,180 @@
+<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>
+    <!-- 数据表格 -->
+    <!-- :highlight-current-row="isSingle" -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      @done="handleDone"
+      row-key="id"
+      :selection.sync="selectionList"
+      :datasource="datasource"
+      :current.sync="current"
+      highlight-current-row
+      height="45vh"
+      @row-click="choose"
+    >
+      <template v-slot:select="{ row }">
+        <el-radio class="radio" v-model="radio" :label="row.id"
+          ><i></i
+        ></el-radio>
+      </template>
+    </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 { factoryworkstation } from '@/api/mainData/index';
+  export default {
+    props: {
+      produceVersionId: {
+        type: String,
+        default: ''
+      },
+      isPlan: {
+        type: Boolean,
+        default: false
+      }
+    },
+    data () {
+      return {
+        visible: false,
+        current: null,
+        searchKey: '',
+        selectionList: [],
+        memoList: [],
+        isSingle: false,
+        callback: null,
+        radio: ''
+      };
+    },
+    computed: {
+      columns () {
+        const list = [
+          {
+            prop: 'code',
+            label: '工位编码'
+          },
+          {
+            label: '工位名称',
+            prop: 'name'
+          },
+          {
+            label: '责任人',
+            prop: 'leaderName',
+            slot: 'factory'
+          },
+          {
+            label: '所属车间',
+            prop: 'workshopName'
+          },
+          {
+            label: '所属产线',
+            prop: 'productionLineName'
+          }
+        ];
+
+        if (!this.isSingle) {
+          list.push({
+            slot: 'select',
+            prop: 'select',
+            label: '选择',
+            align: 'center'
+          });
+        }
+        return list;
+      }
+    },
+    methods: {
+      open (list = []) {
+        this.memoList = list;
+        this.isSingle = false;
+        this.visible = true;
+      },
+      openSingle (list = [], callback) {
+        this.memoList = list;
+        this.callback = callback;
+        this.isSingle = true;
+        this.visible = true;
+      },
+      handleDone ({ data }) {
+        if (this.memoList.length) {
+          this.$nextTick(() => {
+            if (this.isSingle) {
+              this.$refs.table.setCurrentRow(
+                data.find(
+                  (item) =>
+                    item.id ==
+                    (this.memoList[0].deviceId ||
+                      this.memoList[0].sourceInstanceId)
+                )
+              );
+            } else {
+              this.memoList.length &&
+                this.$refs.table.setSelectedRowKeys(
+                  this.memoList.map((i) => i.deviceId)
+                );
+            }
+          });
+        }
+      },
+      datasource ({ page, limit }) {
+        return factoryworkstation({
+          pageNum: page,
+          size: limit,
+          code: this.searchKey
+        });
+      },
+      confirm () {
+        if (this.isSingle) {
+          if (!this.current) return this.$message.error('请选择数据');
+
+          this.callback && this.callback(this.current);
+        } else {
+          if (!this.current) return this.$message.error('请选择数据');
+          this.$emit('success', [this.current]);
+        }
+
+        this.cancel();
+      },
+      cancel () {
+        this.$refs.table.setCurrentRow();
+        this.$refs.table.clearSelection();
+        this.radio = '';
+        this.current = null;
+        this.visible = false;
+      },
+      // 单击获取id
+      choose (row) {
+        this.current = row;
+        this.radio = row.id;
+      }
+    }
+  };
+</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>

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

@@ -1,61 +1,180 @@
 <template>
-  <el-form :inline="true">
+  <el-form
+    class="form-no-message"
+    ref="formRef"
+    :show-message="false"
+    label-position="left"
+    :model="{
+      workReportArea,
+      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 }}KG</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
         class="mt-16"
@@ -64,32 +183,46 @@
         :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="区域编码">{{
+          workReportArea.code
+        }}</el-descriptions-item>
+        <el-descriptions-item label="区域名称">{{
+          workReportArea.name
+        }}</el-descriptions-item>
+        <el-descriptions-item label="">
+          <span slot="label" class="label-required after">干燥时长(分钟)</span>
+          <el-form-item prop="workReportArea.extraField.dryTime" required>
+            <el-input
+              placeholder="请输入"
+              v-model="workReportArea.extraField.dryTime"
+            ></el-input>
+          </el-form-item>
+        </el-descriptions-item>
+        <el-descriptions-item label="区域位置">{{
+          workReportArea.path
+        }}</el-descriptions-item>
         <el-descriptions-item label="操作"
-          ><el-link>更改信息</el-link></el-descriptions-item
+          ><el-link type="primary" @click="getEquip"
+            >更改信息</el-link
+          ></el-descriptions-item
         >
       </el-descriptions>
     </el-card>
+    <workshopDailog
+      ref="workshopRef"
+      :produceVersionId="infoData.produceVersionId"
+    />
+    <catogaryDialog ref="catogaryDialogRef" />
   </el-form>
 </template>
 
 <script>
+  import workshopDailog from '@/components/WorkshopDailog/workshop-dailog';
   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, workshopDailog, catogaryDialog },
     props: {
       infoData: {
         type: Object,
@@ -102,14 +235,21 @@
     },
     data () {
       return {
+        categoryMsg: {
+          batchNo: '',
+          number: '',
+          totalWeight: '',
+          brandNum: '',
+          sourceCategoryId: '',
+          rootCategoryLevelId: '9',
+          name: '',
+          code: ''
+        },
         workReport: {
           executorId: '',
           executorJobNum: '',
           executorTime: '',
-          packInfo: {
-            packNum: '',
-            netWeight: ''
-          },
+          remark: '',
           productInfo: {
             standardNum: '',
             standardWeight: '',
@@ -117,26 +257,49 @@
             noStandardWeight: ''
           }
         },
-        workReportDeviceList: {
+        workReportArea: {
+          areaType: '',
           code: '',
           name: '',
           path: '',
-          specification: ''
+          sourceAreaId: '',
+          specification: '',
+          extraField: {
+            dryTime: ''
+          }
         },
-        countMsg: {}
-      };
-    },
-    watch: {
-      taskInfo: {
-        immediate: true,
-        handler () {
-          if (this.taskInfo.code) {
-            this.getReportCount();
+        countMsg: {},
+        // 舟皿信息
+        boatMsg: {
+          code: '',
+          name: '',
+          path: '',
+          model: '',
+          rootCategoryLevelId: '',
+          specification: '',
+          extraField: {
+            num: ''
           }
         }
-      }
+      };
     },
+    watch: {},
     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,
@@ -146,26 +309,30 @@
         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;
-          }
-        );
+        this.$refs.workshopRef.openSingle([this.workReportArea], (res) => {
+          this.workReportArea.code = res.code;
+          this.workReportArea.name = res.name;
+          this.workReportArea.path = res.workshopName;
+          this.workReportArea.sourceAreaId = res.id;
+          this.workReportArea.id = res.id;
+        });
       },
-      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();
             });
           }
         });
@@ -179,6 +346,10 @@
     display: flex;
     justify-content: space-between;
     align-items: center;
+    margin-bottom: 16px;
+    .label {
+      margin-right: 5px;
+    }
     ul {
       list-style: none;
       display: flex;
@@ -194,6 +365,9 @@
       padding-top: 22px;
       display: flex;
       align-items: center;
+      .el-form-item {
+        margin-left: 10px;
+      }
     }
   }
 </style>

+ 3 - 3
src/views/produceOrder/components/report/Extrusion.vue

@@ -5,15 +5,15 @@
         <li> <span class="label">报工次数</span> {{ countMsg.reportNum }}</li>
         <li>
           <span class="label">累计合格品数量</span>
-          {{ countMsg.standardTotalNum }}</li
+          {{ countMsg.standardTotalNum }}PCS</li
         >
         <li>
           <span class="label">累计合格品重量</span>
-          {{ countMsg.standardTotalWeight }}</li
+          {{ countMsg.standardTotalWeight }}KG</li
         >
         <li>
           <span class="label">累计投料重量</span>
-          {{ countMsg.feedMaterielWeight }}</li
+          {{ countMsg.feedMaterielWeight }}KG</li
         >
       </ul>
       <div class="right">

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

@@ -12,7 +12,7 @@
       <ul>
         <li> <span class="label">报工次数</span> {{ countMsg.reportNum }}</li>
         <li>
-          <span class="label">累计实际数量</span>{{ countMsg.joinTotalNum }}
+          <span class="label">累计实际数量</span>{{ countMsg.joinTotalNum }}PCS
         </li>
       </ul>
       <div class="right">

+ 3 - 3
src/views/produceOrder/components/report/HalfAdded.vue

@@ -14,15 +14,15 @@
         <li> <span class="label">报工次数</span>{{ countMsg.reportNum }}</li>
         <li>
           <span class="label">累计合格品数量</span
-          >{{ countMsg.standardTotalNum }}</li
+          >{{ countMsg.standardTotalNum }}PCS</li
         >
         <li>
           <span class="label">累计合格品重量</span
-          >{{ countMsg.standardTotalWeight }}</li
+          >{{ countMsg.standardTotalWeight }}KG</li
         >
         <li>
           <span class="label">累计投料产品数量</span
-          >{{ countMsg.feedProductWeight }}</li
+          >{{ countMsg.feedProductWeight }}PCS</li
         >
       </ul>
       <div class="right">

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

@@ -18,7 +18,7 @@
         >
         <li>
           <span class="label">累计合格品重量</span
-          >{{ countMsg.standardTotalWeight }}</li
+          >{{ countMsg.standardTotalWeight }}KG</li
         >
         <li>
           <span class="label">累计投料产品数量</span

+ 3 - 3
src/views/produceOrder/components/report/Package.vue

@@ -13,15 +13,15 @@
         <li> <span class="label">报工次数</span>{{ countMsg.reportNum }}</li>
         <li>
           <span class="label">累计合格品数量</span
-          >{{ countMsg.standardTotalNum }}</li
+          >{{ countMsg.standardTotalNum }}PCS</li
         >
         <li>
           <span class="label">累计合格品重量</span
-          >{{ countMsg.standardTotalWeight }}</li
+          >{{ countMsg.standardTotalWeight }}KG</li
         >
         <li>
           <span class="label">累计投料产品数量</span
-          >{{ countMsg.feedProductWeight }}</li
+          >{{ countMsg.feedProductWeight }}PCS</li
         >
       </ul>
       <div class="right">

+ 4 - 2
src/views/produceOrder/components/report/Warehousing.vue

@@ -10,10 +10,12 @@
       <ul>
         <li> <span class="label">报工次数</span>{{ countMsg.reportNum }}</li>
         <li>
-          <span class="label">批次数量</span>{{ countMsg.inStoreBatchNum }}</li
+          <span class="label">批次数量</span
+          >{{ countMsg.inStoreBatchNum }}PCS</li
         >
         <li>
-          <span class="label">累计入库数量</span>{{ countMsg.inStoreNum }}</li
+          <span class="label">累计入库数量</span
+          >{{ countMsg.inStoreNum }}PCS</li
         >
       </ul>
       <div class="right">

+ 1 - 1
src/views/produceOrder/report.vue

@@ -218,7 +218,7 @@
         // 获取工序
         const res1 = await getTaskListById(res.produceVersionId);
 
-        this.tabList = res1;
+        this.tabList = [...res1, { name: '自然干燥' }, { name: '升温干燥' }];
         this.activeName = '0';
       }
     }