Przeglądaj źródła

feat(bpm): 新增质检标准相关组件和接口,调整取样记录详情页字段显示

yusheng 6 miesięcy temu
rodzic
commit
92814d43c0

+ 62 - 0
src/api/bpm/components/inspectionStandard/index.js

@@ -0,0 +1,62 @@
+import request from '@/utils/request';
+
+
+// 列表
+
+export async function getList(data) {
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/qms/qualitystandard/page?` + par, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 新增
+export async function save(data) {
+  const res = await request.post(`/qms/qualitystandard/save`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 编辑
+export async function update(data) {
+  const res = await request.put(`/qms/qualitystandard/update`, data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+
+export async function getById(id) {
+  const res = await request.get(`/qms/qualitystandard/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+// 删除
+export async function removeItem(data) {
+  const res = await request.delete('/qms/qualitystandard/delete', {
+    data
+  });
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//列表
+export async function parameterList(params) {
+  const res = await request.get('/main/produceparam/page', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}

+ 4 - 1
src/enum/dict.js

@@ -102,7 +102,9 @@ export default {
   冲差范围: 'adjust_range',
   调整类型: 'adjust_price_type',
   取样类型: 'quality_method_code',
-  质检计划类型: 'inspection_plan_type'
+  质检计划类型: 'inspection_plan_type',
+  质检标准类型: 'quality_testing_code',
+
 };
 
 export const numberList = [
@@ -110,6 +112,7 @@ export const numberList = [
   'target_unit',
   'capacity_status',
   // 'date_unit',
+  'quality_testing_code',
   'quality_assurance',
   'schedule_type',
   'leadtime_unit',

+ 156 - 0
src/views/bpm/handleTask/components/inspectionStandard/edit.vue

@@ -0,0 +1,156 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+    <el-row>
+      <el-col :span="12" style="padding: 0">
+        <el-form-item label="标准类型:" prop="type">
+          <DictSelection
+            dictName="质检标准类型"
+            v-model="form.type"
+            disabled
+          ></DictSelection>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12" style="padding: 0">
+        <el-form-item label="标准名称:" prop="name">
+          <el-input
+            clearable
+            v-model="form.name"
+            placeholder="请输入"
+            disabled
+          />
+        </el-form-item>
+      </el-col>
+      <el-col :span="12" style="padding: 0">
+        <el-form-item label="标准代码:" prop="standardCode">
+          <el-input v-model="form.standardCode" disabled></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12" style="padding: 0">
+        <el-form-item label="版本号:" prop="version">
+          <el-input v-model="form.version" disabled></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12" style="padding: 0">
+        <el-form-item prop="sort" label="排序">
+          <el-input v-model="form.sort" type="number" disabled></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12" style="padding: 0">
+        <el-form-item prop="imgUrl" label="附件">
+          <fileMain v-model="form.imgUrl" type="view" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  import { getById } from '@/api/bpm/components/inspectionStandard';
+
+  import dictMixins from '@/mixins/dictMixins';
+
+  export default {
+    components: {},
+    mixins: [dictMixins],
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      }
+    },
+    data() {
+      const defaultForm = function () {
+        return {
+          id: '',
+          name: '',
+          status: '',
+          type: '',
+          version: '1.0',
+          standardCode: '',
+          inspectionId: '',
+          singleWeightDivision: '',
+          tolerance: '',
+          parameterStandards: [],
+          linePoints: [],
+          parameterType: '',
+          imgUrl: [],
+          sort: 0
+        };
+      };
+      return {
+        // 表单数据
+        form: { ...defaultForm() },
+
+        rules: {
+          name: [{ required: true, message: '请输入', trigger: 'blur' }],
+          version: [{ required: true, message: '请输入', trigger: 'blur' }],
+          type: {
+            required: true,
+            message: '请选择',
+            trigger: 'change'
+          },
+
+          status: {
+            required: true,
+            message: '请选择',
+            trigger: 'change'
+          }
+        }
+      };
+    },
+
+    created() {
+      this.init();
+    },
+    methods: {
+      async init(id) {
+        this.form = await getById(this.businessId);
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .location-warp {
+    display: flex;
+
+    .detail {
+      margin-left: 10px;
+    }
+  }
+
+  :deep(
+      .el-dialog:not(.ele-dialog-form)
+        .el-dialog__body
+        .el-form
+        .el-form-item:last-child
+    ) {
+    margin-bottom: 22px;
+  }
+
+  :deep(
+      .el-dialog:not(.ele-dialog-form)
+        .el-dialog__body
+        .el-form
+        .el-table__body
+        .el-table__row
+        .el-form-item:last-child
+    ) {
+    margin-bottom: 0 !important;
+  }
+
+  .add-product {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    font-size: 30px;
+    color: #1890ff;
+    margin: 10px 0;
+    cursor: pointer;
+  }
+</style>

+ 146 - 0
src/views/bpm/handleTask/components/inspectionStandard/submit.vue

@@ -0,0 +1,146 @@
+<template>
+  <el-col :span="16" :offset="6">
+    <el-form label-width="100px" ref="formRef" :model="form">
+      <el-form-item
+        label="审批建议"
+        style="margin-bottom: 20px"
+        :rules="{
+          required: true,
+          message: '请选择',
+          trigger: 'change'
+        }"
+      >
+        <el-input
+          type="textarea"
+          v-model="form.reason"
+          placeholder="请输入审批建议"
+        />
+      </el-form-item>
+    </el-form>
+    <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        @click="handleAudit(1)"
+        >通过
+      </el-button>
+
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="rejectTask(0)"
+        >驳回
+      </el-button>
+    </div>
+  </el-col>
+</template>
+
+<script>
+  import {
+    approveTaskWithVariables,
+    rejectTask,
+    cancelTask
+  } from '@/api/bpm/task';
+
+  // 流程实例的详情页,可用于审批
+  export default {
+    name: '',
+
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        form: {
+          reason: ''
+        }
+      };
+    },
+    created() {},
+    methods: {
+      /** 处理转办审批人 */
+      handleUpdateAssignee() {
+        this.$emit('handleUpdateAssignee');
+      },
+      /** 退回 */
+      handleBackList() {
+        this.$emit('handleBackList');
+      },
+
+      async handleAudit(status) {
+        let API = !!status ? approveTaskWithVariables : rejectTask;
+        API({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables: {
+            pass: !!status
+          }
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
+        });
+      },
+      rejectTask(status) {
+        rejectTask({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables: {
+            pass: !!status
+          }
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: '驳回'
+            });
+          }
+        });
+      },
+
+      //更多
+      handleCommand(command) {
+        if (command === 'cancel') {
+          this.$confirm('是否确认作废?', {
+            type: 'warning',
+            cancelButtonText: '取消',
+            confirmButtonText: '确定'
+          })
+            .then(() => {
+              cancelTask({
+                id: this.id,
+                taskId: this.taskId,
+                reason: this.form.reason,
+                businessId: this.businessId
+              })
+                .then(() => {
+                  this.$emit('handleClose');
+                })
+                .catch(() => {
+                  this.$message.error('流程作废失败');
+                });
+            })
+            .catch(() => {});
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 12 - 39
src/views/bpm/handleTask/components/sampleRecord/detailDialog.vue

@@ -30,7 +30,11 @@
 
         <el-col :span="8">
           <el-form-item label="来源单号:" prop="qualityWorkOrderCode">
-            <el-input disabled v-model="form.qualityWorkOrderCode" placeholder=" " />
+            <el-input
+              disabled
+              v-model="form.qualityWorkOrderCode"
+              placeholder=" "
+            />
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -92,9 +96,6 @@
         height="300px"
         full-height="calc(100vh - 120px)"
       >
-        <template v-slot:toolbar>
-          累计取样数量:{{ form.sampleQuantity }}{{ form.unit }}
-        </template>
       </ele-pro-table>
       <header-title title="请样信息"> </header-title>
       <el-row>
@@ -107,35 +108,6 @@
             ></el-input>
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row>
-        <el-col :span="8">
-          <el-form-item label="请样数量:" prop="pleaseQuantity">
-            <el-input
-              v-model="form.pleaseQuantity"
-              placeholder="请输入"
-              disabled
-            >
-              <template slot="append">
-                {{ form.pleaseUnit }}
-              </template>
-            </el-input>
-          </el-form-item>
-        </el-col>
-        <!-- <el-col :span="4">
-          <el-form-item label="单位:" prop="pleaseUnit">
-            <DictSelection
-              dictName="计量单位"
-              clearable
-              v-model="form.pleaseUnit"
-              filter-placeholder="请输入计量单位搜索"
-              @change="changeSamUnit"
-            ></DictSelection>
-          </el-form-item>
-        </el-col> -->
-      </el-row>
-      <header-title title="取样信息"> </header-title>
-      <el-row>
         <el-col :span="8">
           <el-form-item label="质检方式:" prop="qualityMode">
             <DictSelection
@@ -163,9 +135,10 @@
           </el-form-item>
         </el-col>
       </el-row>
+
       <el-row v-if="form.qualityMode == '2'">
         <el-col :span="8">
-          <el-form-item label="取样:" prop="sampleNumber">
+          <el-form-item label="请样类型:" prop="sampleNumber">
             <el-select
               style="width: 100%"
               v-model="form.conditionType"
@@ -296,12 +269,12 @@
           code: [{ required: true, message: '编码不能为空', trigger: 'change' }]
         },
         sampleQuantityList: [
-          { label: '批样', value: 1 },
-          { label: '单样全部', value: 2 }
+          { label: '按质检项检', value: 1 },
+          { label: '按样品检', value: 2 }
         ],
         sampleNumberList: [
-          { label: '整样', value: 1 },
-          { label: '小样', value: 2 }
+          { label: '整样', value: 1 },
+          { label: '小样', value: 2 }
         ],
         tableColumns1: [
           {
@@ -530,7 +503,7 @@
 
           if (res.qualityWorkOrderVO.conditionType == 1) {
             this.$set(this.form, 'portion', res.quantity);
-            console.log(this.form,'(this.form')
+            console.log(this.form, '(this.form');
           } else {
             this.$set(this.form, 'portion', res.copies);
           }