Przeglądaj źródła

批记录入库单API修改

lucw 8 miesięcy temu
rodzic
commit
93d2639944

+ 10 - 0
src/api/wms/index.js

@@ -8,3 +8,13 @@ export async function getPages(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+
+// /wms/outintwo/batchRecordPage post
+export async function getBatchRecordPage(params) {
+  const res = await request.post(`/wms/outintwo/batchRecordPage`, params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 89 - 74
src/views/batchRecord/components/editModal.vue

@@ -110,80 +110,6 @@
           >
         </el-row>
 
-        <header-title
-          v-if="form.executeMethod == 2 && ruleDetails"
-          title="检查项目"
-          style="margin-top: 20px"
-        ></header-title>
-        <!-- 记录规则 -->
-        <div v-if="form.executeMethod == 2 && ruleDetails">
-          <el-table :data="ruleDetails" style="width: 100%">
-            <el-table-column type="index" label="序号" width="50">
-            </el-table-column>
-            <el-table-column label="检查内容">
-              <template slot-scope="scope">
-                <div>
-                  {{ scope.row.paramValue || scope.row.productName }}
-                </div>
-              </template>
-            </el-table-column>
-
-            <el-table-column label="检查工具">
-              <template slot-scope="scope">
-                <div>
-                  {{ scope.row.tools.map((i) => i.toolName).join(',') || '无' }}
-                </div>
-              </template>
-            </el-table-column>
-
-            <el-table-column label="检查情况">
-              <template slot-scope="scope">
-                <div>
-                  <div>
-                    <el-radio-group v-model="scope.row.checkStatus" disabled>
-                      <el-radio :label="1">已检查</el-radio>
-                      <el-radio :label="0">未检查</el-radio>
-                    </el-radio-group>
-                  </div>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="检查结果">
-              <template slot-scope="scope">
-                <div>
-                  <el-radio-group v-model="scope.row.checkResult" disabled>
-                    <el-radio :label="1">合格</el-radio>
-                    <el-radio :label="0">不合格</el-radio>
-                  </el-radio-group>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="描述">
-              <template slot-scope="scope">
-                <div>
-                  <el-input
-                    type="textarea"
-                    :rows="1"
-                    placeholder="请输入"
-                    v-model="scope.row.errorMsg"
-                    disabled
-                  >
-                  </el-input>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="备注">
-              <template slot-scope="scope">
-                <div
-                  style="display: flex; align-items: center; cursor: pointer"
-                >
-                  <div>{{ scope.row.remark || '无' }}</div>
-                </div>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-
         <header-title title="关联产品" style="margin-top: 20px"></header-title>
         <el-row style="margin-bottom: 20px">
           <el-col :span="8">
@@ -295,6 +221,95 @@
             </el-form-item>
           </el-col>
         </el-row>
+
+        <header-title
+          v-if="form.executeMethod == 2 && ruleDetails"
+          title="检查项目"
+          style="margin-top: 20px"
+        ></header-title>
+        <!-- 记录规则 -->
+        <div v-if="form.executeMethod == 2 && ruleDetails">
+          <el-table :data="ruleDetails" style="width: 100%">
+            <el-table-column type="index" label="序号" width="50">
+            </el-table-column>
+            <el-table-column label="检查内容">
+              <template slot-scope="scope">
+                <div>
+                  {{ scope.row.paramValue || scope.row.productName }}
+                </div>
+              </template>
+            </el-table-column>
+
+            <el-table-column label="检查工具">
+              <template slot-scope="scope">
+                <div>
+                  {{ scope.row.tools.map((i) => i.toolName).join(',') || '无' }}
+                </div>
+              </template>
+            </el-table-column>
+
+            <el-table-column label="检查人">
+              <template>
+                <div
+                  style="
+                    display: flex;
+                    align-items: center;
+                    cursor: pointer;
+                    color: #c0c4cc;
+                  "
+                >
+                  <div>选择检查人</div>
+                </div>
+              </template>
+            </el-table-column>
+
+            <el-table-column label="检查情况">
+              <template slot-scope="scope">
+                <div>
+                  <div>
+                    <el-radio-group v-model="scope.row.checkStatus" disabled>
+                      <el-radio :label="1">已检查</el-radio>
+                      <el-radio :label="0">未检查</el-radio>
+                    </el-radio-group>
+                  </div>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="检查结果">
+              <template slot-scope="scope">
+                <div>
+                  <el-radio-group v-model="scope.row.checkResult" disabled>
+                    <el-radio :label="1">合格</el-radio>
+                    <el-radio :label="0">不合格</el-radio>
+                  </el-radio-group>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="描述">
+              <template slot-scope="scope">
+                <div>
+                  <el-input
+                    type="textarea"
+                    :rows="1"
+                    placeholder="请输入"
+                    v-model="scope.row.errorMsg"
+                    disabled
+                  >
+                  </el-input>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="备注">
+              <template slot-scope="scope">
+                <div
+                  style="display: flex; align-items: center; cursor: pointer"
+                >
+                  <div>{{ scope.row.remark || '无' }}</div>
+                </div>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
       </el-form>
     </div>
 

+ 5 - 2
src/views/batchRecord/components/tables/wmsOutInt.vue

@@ -30,6 +30,7 @@
   import tableColumnsMixin from '@/mixins/tableColumnsMixin';
   import { getPages } from '@/api/wms/index';
   import { sceneState } from '@/utils/dict/index';
+  import { getBatchRecordPage } from '@/api/wms/index';
 
   export default {
     mixins: [dictMixins, tableColumnsMixin],
@@ -177,9 +178,11 @@
           ...order,
           pageNum: page,
           size: limit,
-          ...this.tableQuery
+          ...this.tableQuery,
+          // type  "1=入库 2=出库" 默认1
+          type: 1
         };
-        return getPages(body);
+        return getBatchRecordPage(body);
       },
       search(where) {
         console.log('where', where);

+ 2 - 2
src/views/checklistManagement/components/selectWorkOrder.vue

@@ -32,8 +32,8 @@
         </template>
 
         <template v-slot:QRcode="{ row }">
-          <el-link type="primary" :underline="false" @click="handleQRcode(row)"
-            >生成二维码
+          <el-link type="primary" :underline="false" @click="handleQRcode(row)">
+            生成二维码
           </el-link>
         </template>
 

+ 16 - 4
src/views/produce/components/prenatalExamination/index.vue

@@ -2,7 +2,7 @@
   <el-dialog
     title="报工"
     :visible.sync="dialogVisible"
-    width="30%"
+    width="500px"
     :before-close="handleClose"
   >
     <div>
@@ -21,7 +21,7 @@
           @click="openMaintenancePlan(item)"
         >
           <div class="circle">{{ index + 1 }}</div>
-          <div class="desc">{{ item.ruleName }}</div>
+          <div class="desc">{{ item.ruleName || item.itemTaskName }}</div>
           <el-button
             :type="item.executeStatus == 0 ? 'primary' : 'default'"
             class="status-btn"
@@ -47,6 +47,8 @@
     />
 
     <releaseRulesDialog ref="releaseRulesDialogRef" @reload="getData" />
+
+    <taskDialog ref="taskDialogRef" @reload="getData" />
   </el-dialog>
 </template>
 
@@ -55,9 +57,10 @@
   import programRulesDialog from './programRulesDialog.vue';
   import { getLastRuleRecords } from '@/api/producetaskrulerecord/index.js';
   import { getDate } from '@/utils/dateUtils';
+  import taskDialog from './taskDialog.vue';
 
   export default {
-    components: { programRulesDialog, releaseRulesDialog },
+    components: { programRulesDialog, releaseRulesDialog, taskDialog },
     data() {
       return {
         dialogVisible: false,
@@ -139,12 +142,19 @@
             this.workOrderInfo,
             this.produceTaskInfo
           );
-        } else {
+        } else if (item.executeMethod == 2) {
           this.$refs.releaseRulesDialogRef.open(
             item,
             this.workOrderInfo,
             this.produceTaskInfo
           );
+        } else {
+          // 任务确认
+          this.$refs.taskDialogRef.open(
+            item,
+            this.workOrderInfo,
+            this.produceTaskInfo
+          );
         }
       }
     }
@@ -161,6 +171,7 @@
 
   .step-item {
     display: flex;
+    flex-flow: row wrap;
     align-items: center;
     gap: 32px;
 
@@ -175,6 +186,7 @@
       justify-content: center;
       font-size: 16px;
       font-weight: bold;
+      flex-shrink: 0;
     }
 
     .desc {

+ 2 - 1
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -300,7 +300,8 @@
         reportWorkType: 0,
         specification: '',
         workOrderCode: '',
-        workOrderId: 0
+        workOrderId: 0,
+        itemTaskName: ''
       };
 
       return {

+ 229 - 0
src/views/produce/components/prenatalExamination/taskDialog.vue

@@ -0,0 +1,229 @@
+<template>
+  <ele-modal
+    width="80%"
+    :visible="visible"
+    append-to-body
+    custom-class="ele-dialog-form"
+    :title="title"
+    :close-on-click-modal="false"
+    :before-close="handleBeforeClose"
+    maxable
+  >
+    <header-title title="基本信息"></header-title>
+    <el-form
+      :model="addForm"
+      :rules="formRules"
+      ref="ruleFormRef"
+      label-width="150px"
+      v-loading="loading"
+    >
+      <el-row> </el-row>
+    </el-form>
+
+    <!-- 底部按钮 -->
+    <template #footer>
+      <div class="modal-footer">
+        <el-button
+          :loading="butLoading"
+          type="primary"
+          @click="submit('submit')"
+          :disabled="productionInfo && productionInfo.executeStatus == 2"
+        >
+          一键报工
+        </el-button>
+
+        <el-button
+          v-if="productionInfo && productionInfo.executeStatus == 2"
+          @click="handleBeforeClose"
+        >
+          关闭
+        </el-button>
+      </div>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  import { submit } from '@/api/entrust';
+  import {
+    recordRulesDetailPage,
+    getRecordRulesDetail
+  } from '@/api/recordRules/index.js';
+  import DictSelection from '@/components/Dict/DictSelection.vue';
+  import SelectUser from '@/components/select/SelectUser/index.vue';
+  import { saveRuleRecord } from '@/api/producetaskrulerecord/index.js';
+
+  export default {
+    components: { SelectUser },
+    emits: ['reload'],
+    props: {
+      isTempRecord: {
+        type: Number,
+        default: 0
+      }
+    },
+    data() {
+      const formDate = {
+        id: null,
+        workshopArea: '',
+        checkFinishTime: '',
+        checkValidity: null,
+        checkValidityUnit: '',
+        conclution: null,
+        isTempRecord: this.isTempRecord,
+        details: [],
+        planList: [],
+        deviceId: 0,
+        deviceName: '',
+        batchNo: '',
+        executeMethod: 0,
+        formingNum: 0,
+        itemType: 0,
+        produceRoutingId: 0,
+        produceRoutingName: '',
+        produceTaskConfigId: 0,
+        produceTaskId: 0,
+        produceTaskName: '',
+        productCode: '',
+        productModel: '',
+        productName: '',
+        recordRulesClassify: null,
+        ruleId: 0,
+        ruleName: '',
+        reportWorkType: 0,
+        specification: '',
+        workOrderCode: '',
+        workOrderId: 0
+      };
+
+      return {
+        visible: false,
+        formDate,
+        addForm: JSON.parse(JSON.stringify(formDate)),
+        formRules: {
+          checkFinishTime: [
+            { required: true, message: '请选择检查完成时间', trigger: 'blur' },
+            { required: true, message: '请选择检查完成时间', trigger: 'change' }
+          ],
+          conclution: [
+            { required: true, message: '请选择结论', trigger: 'blur' },
+            { required: true, message: '请选择结论', trigger: 'change' }
+          ],
+          checkValidity: [
+            { required: true, message: '请输入检查有效期', trigger: 'blur' },
+            { required: true, message: '请输入检查有效期', trigger: 'change' }
+          ],
+          checkValidityUnit: [
+            {
+              required: true,
+              message: '请选择检查有效期单位',
+              trigger: 'blur'
+            },
+            {
+              required: true,
+              message: '请选择检查有效期单位',
+              trigger: 'change'
+            }
+          ]
+        },
+        productionInfo: null,
+        list: [],
+        ruleInfo: null,
+        showSelectUser: false,
+        currentRow: null,
+        butLoading: false,
+        // 工艺路线
+        workOrderInfo: null,
+        // 加载中 loading
+        loading: false,
+        title: '任务确认'
+      };
+    },
+    computed: {},
+    methods: {
+      open(productionInfo, workOrderInfo) {
+        console.log(
+          'productionInfo, workOrderInfo',
+          productionInfo,
+          workOrderInfo
+        );
+        this.visible = true;
+        this.productionInfo = productionInfo;
+        this.workOrderInfo = workOrderInfo;
+
+        this.addForm.batchNo = workOrderInfo.batchNo;
+        this.addForm.executeMethod = productionInfo.executeMethod;
+        this.addForm.formingNum = workOrderInfo.formingNum;
+        this.addForm.itemType = productionInfo.itemType;
+        this.addForm.produceRoutingId = workOrderInfo.produceRoutingId;
+        this.addForm.produceRoutingName = workOrderInfo.produceRoutingName;
+        this.addForm.produceTaskConfigId = productionInfo.produceTaskConfigId;
+        this.addForm.produceTaskId = productionInfo.produceTaskId;
+        this.addForm.produceTaskName = productionInfo.produceTaskName;
+        this.addForm.productCode = workOrderInfo.productCode;
+        this.addForm.productModel = workOrderInfo.model;
+        this.addForm.productName = workOrderInfo.productName;
+        this.addForm.reportWorkType = productionInfo.reportWorkType;
+        this.addForm.specification = workOrderInfo.specification;
+        this.addForm.workOrderCode = workOrderInfo.code;
+        this.addForm.workOrderId = workOrderInfo.id;
+        this.itemTaskName = productionInfo.itemTaskName;
+
+        console.log('this.productionInfo', this.productionInfo);
+        console.log('this.addForm', this.addForm);
+      },
+      handleBeforeClose() {
+        this.addForm = JSON.parse(JSON.stringify(this.formDate));
+        console.log('this.$refs.ruleFormRef', this.addForm);
+        this.$refs.ruleFormRef?.clearValidate();
+        this.$nextTick(() => {
+          this.visible = false;
+        });
+      },
+      // 提交
+      submit(type) {
+        console.log('this.addForm', this.addForm);
+
+        // 验证表单
+        this.$refs.ruleFormRef.validate(async (valid) => {
+          if (!valid) {
+            return;
+          }
+
+          // 提交
+          this.butLoading = true;
+          try {
+            await saveRuleRecord(this.addForm);
+            this.$message.success('报工成功!');
+
+            this.butLoading = false;
+
+            // 返回
+            this.$emit('reload');
+
+            this.handleBeforeClose();
+          } catch (error) {
+            this.butLoading = false;
+          }
+        });
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  .modal-body {
+    padding: 16px;
+    min-height: 100px;
+  }
+  .modal-footer {
+    display: flex;
+    align-items: center;
+    gap: 10px;
+    justify-content: flex-end;
+  }
+
+  .el-form-item .el-form-item {
+    margin-bottom: -5px;
+  }
+</style>

+ 3 - 2
vue.config.js

@@ -34,8 +34,8 @@ module.exports = {
       '/api': {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.251:18086',
-        // target: 'http://192.168.1.116:18086', // 赵沙金
-        target: 'http://192.168.1.251:18086', // 开发环境
+        target: 'http://192.168.1.116:18086', // 赵沙金
+        // target: 'http://192.168.1.251:18086', // 开发环境
         // target: 'http://192.168.1.103:18086',192.168.1.116
         // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.30:18086',
@@ -43,6 +43,7 @@ module.exports = {
         // target: 'http://192.168.1.33:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18087',
+        // target: 'http://116.163.22.90:86/api', // 嘉实生产
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''