2213980799@qq.com před 1 rokem
rodič
revize
16c3f6bcec

+ 7 - 0
src/api/inspectionStatistics/index.js

@@ -36,4 +36,11 @@ export async function savePicture(data) {
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));
 }
 }
 
 
+export async function save(data) {
+  const res = await request.post('/qms/quality_work_order/update', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
 

+ 1 - 0
src/components/upload/WithView.vue

@@ -49,6 +49,7 @@
     },
     },
     computed: {
     computed: {
       dialogImageUrl () {
       dialogImageUrl () {
+        console.log(this.value,'this.value')
         return this.value?.storePath && getImageUrl(this.value.storePath);
         return this.value?.storePath && getImageUrl(this.value.storePath);
       }
       }
     },
     },

+ 78 - 25
src/views/inspectionStatistics/qualityControlWorkOrder/index.vue

@@ -62,12 +62,19 @@
           <footer>
           <footer>
             <aside class="left">
             <aside class="left">
               <h6 style="font-size: 12px">{{ currentRow.batchNo }}</h6>
               <h6 style="font-size: 12px">{{ currentRow.batchNo }}</h6>
-              <h6 style="letter-spacing: -1px">{{ currentRow.qualityTime }}</h6>
+              <h6 style="letter-spacing: -1px; font-size: 14px">{{
+                currentRow.qualityTime
+              }}</h6>
               <h6
               <h6
-                style="line-height: 18px; margin-top: 10px"
-                v-if="currentRow.designDrawingRemark"
+                style="
+                  line-height: 18px;
+                  margin-top: 10px;
+                  font-size: 14px;
+                  width: 140px;
+                "
+                v-if="currentRow.remark"
               >
               >
-                备注:{{ currentRow.designDrawingRemark }}
+                备注:{{ currentRow.remark }}
               </h6>
               </h6>
               <h5 style="font-family: '宋体'; font-size: 16px" class="status">
               <h5 style="font-family: '宋体'; font-size: 16px" class="status">
                 合格
                 合格
@@ -92,11 +99,31 @@
       </div>
       </div>
 
 
       <template v-slot:footer>
       <template v-slot:footer>
-        <!-- <el-button @click="print">设置备注</el-button> -->
+        <el-button @click="remarkVisible = true">设置备注</el-button>
         <el-button type="primary" @click="imgVisibleOpen">更新设计图</el-button>
         <el-button type="primary" @click="imgVisibleOpen">更新设计图</el-button>
         <el-button @click="print">打印预览</el-button>
         <el-button @click="print">打印预览</el-button>
       </template>
       </template>
     </el-dialog>
     </el-dialog>
+    <el-dialog
+      class="ele-dialog-form"
+      :visible.sync="remarkVisible"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :before-close="close"
+      width="300px"
+      append-to-body
+      title="设置备注"
+    >
+      <el-input
+        clearable
+        v-model="currentRow.remark"
+        placeholder="请输入备注"
+      />
+      <template v-slot:footer>
+        <el-button type="primary" @click="save">确认</el-button>
+        <el-button @click="close">取消</el-button>
+      </template>
+    </el-dialog>
     <el-dialog
     <el-dialog
       class="ele-dialog-form"
       class="ele-dialog-form"
       :visible.sync="imgVisible"
       :visible.sync="imgVisible"
@@ -122,7 +149,7 @@ import {
   getQualityControlWorkOrder,
   getQualityControlWorkOrder,
   queryListDetail,
   queryListDetail,
   exportList,
   exportList,
-  savePicture
+  savePicture,save
 } from '@/api/inspectionStatistics';
 } from '@/api/inspectionStatistics';
 import dictMixins from '@/mixins/dictMixins';
 import dictMixins from '@/mixins/dictMixins';
 import { printElement } from 'ele-admin';
 import { printElement } from 'ele-admin';
@@ -139,13 +166,14 @@ export default {
   data() {
   data() {
     return {
     return {
       visible: false,
       visible: false,
+      remarkVisible: false,
       text: '',
       text: '',
-      currentRow: {},
+      currentRow: {remark:""},
       selection: [],
       selection: [],
-      imgs: [],
       list: [],
       list: [],
       loading: false,
       loading: false,
       imgVisible: false,
       imgVisible: false,
+      imgs: {},
       columns: [
       columns: [
         {
         {
           width: 45,
           width: 45,
@@ -444,18 +472,28 @@ export default {
     },
     },
     imgVisibleOpen() {
     imgVisibleOpen() {
       this.imgVisible = true;
       this.imgVisible = true;
-      this.imgs = (this.currentRow.picture && this.currentRow.picture[0]) || {};
+      console.log(this.currentRow.picture, 'this.currentRow.picture');
+      this.imgs = JSON.parse(JSON.stringify(this.currentRow.picture));
     },
     },
     savePicture() {
     savePicture() {
       savePicture({
       savePicture({
         id: this.currentRow.id,
         id: this.currentRow.id,
-        picture: [this.imgs]
+        remark: this.currentRow.remark
+      });
+      this.currentRow.picture = this.imgs;
+      this.setCode();
+      this.handleClose();
+      this.$refs.search.search();
+    },
+
+    save() {
+      save({
+        id: this.currentRow.id,
+        remark: this.currentRow.remark
       });
       });
-     
-      this.currentRow.picture = [this.imgs];
-      this.openEdit(this.currentRow);
-      this.handleClose()
+      this.remarkVisible = false;
       this.$refs.search.search();
       this.$refs.search.search();
+
     },
     },
     datasource({ page, where, limit, parent }) {
     datasource({ page, where, limit, parent }) {
       this.where = where;
       this.where = where;
@@ -481,22 +519,37 @@ export default {
     print() {
     print() {
       printElement(this.$refs.printRef);
       printElement(this.$refs.printRef);
     },
     },
-    handleClose(){
-
-      this.$refs.WithViewRef.clearImg()
+    handleClose() {
+      this.$refs.WithViewRef.clearImg();
       this.imgVisible = false;
       this.imgVisible = false;
     },
     },
+    close() {
+      this.remarkVisible = false;
+      // this.currentRow.remark = '';
+    },
     openEdit(row) {
     openEdit(row) {
       this.visible = true;
       this.visible = true;
-      this.currentRow = row;
-      this.imgs = (this.currentRow.picture && this.currentRow.picture[0]) || {};
+      if (row) {
+        this.currentRow = row;
+      }
+      if (
+        Array.isArray(this.currentRow.picture) &&
+        this.currentRow.picture.length > 0
+      ) {
+        this.currentRow.picture = this.currentRow.picture[0];
+      }
+      this.setCode();
+    },
+    setCode() {
       const paramsStr = this.obj_to_str({
       const paramsStr = this.obj_to_str({
-        productName: encodeURIComponent(row.productName),
-        specification: encodeURIComponent(row.specification),
-        productCode: row.productCode,
-        batchNo: row.batchNo,
-        createTime: row.qualityTime.split(' ')[0],
-        designDrawingImg: encodeURIComponent(getImageUrl(this.imgs.storePath))
+        productName: encodeURIComponent(this.currentRow.productName),
+        specification: encodeURIComponent(this.currentRow.specification),
+        productCode: this.currentRow.productCode,
+        batchNo: this.currentRow.batchNo,
+        createTime: this.currentRow.qualityTime.split(' ')[0],
+        designDrawingImg: encodeURIComponent(
+          getImageUrl(this.currentRow.picture.storePath)
+        )
       });
       });
       this.text =
       this.text =
         window.location.origin +
         window.location.origin +