Explorar el Código

按代码规范调整

chris hace 1 año
padre
commit
f9888cfc29

+ 8 - 8
src/api/material.js

@@ -1,18 +1,18 @@
-import request from "@/utils/httpRequest";
+import request from '@/utils/httpRequest'
 
 // 查询物料列表
-export function getMaterialList(params) {
+export function getMaterialList (params) {
   return request({
     url: request.adornUrl(`/biz-service/product/material/list`),
-    method: "get",
-    params: params,
-  });
+    method: 'get',
+    params: params
+  })
 }
 
 // 查询物料工艺方案详情
-export function getMaterialTechDetail(id) {
+export function getMaterialTechDetail (id) {
   return request({
     url: request.adornUrl(`/biz-service/pro-technology-option/info/${id}`),
-    method: "get",
-  });
+    method: 'get'
+  })
 }

+ 64 - 64
src/views/modules/common/upload-component-v2.vue

@@ -47,104 +47,104 @@
 </template>
 
 <script>
-import { uploadUrl, downloadUrl, uploadFiles } from "@/api/file";
-import { getFileExt } from "@/api/util";
+import { uploadUrl, downloadUrl, uploadFiles } from '@/api/file'
+import { getFileExt } from '@/api/util'
 export default {
-  name: "upload-component-v2",
+  name: 'upload-component-v2',
   props: {
     title: {
       type: String,
-      default: "附件",
+      default: '附件'
     },
     accept: {
       type: String,
-      default: "",
+      default: ''
     },
     multiple: {
       type: Boolean,
-      default: false,
+      default: false
     },
     limit: {
       type: Number,
-      default: 5,
+      default: 5
     },
     display: {
       type: Boolean,
-      default: false,
+      default: false
     },
     fileObjList: {
       type: Array,
-      default: () => [],
+      default: () => []
     },
     displayTitle: {
       type: Boolean,
-      default: true,
+      default: true
     },
     displayStar: {
       type: Boolean,
-      default: true,
+      default: true
     },
     value: {
       type: Array,
-      default: () => [],
-    },
+      default: () => []
+    }
   },
   watch: {
-    fileList(newVal) {
-      this.$emit("uploadSuccess", newVal);
-    },
-    fileObjList(newVal) {
-      this.fileList = newVal;
+    fileList (newVal) {
+      this.$emit('uploadSuccess', newVal)
     },
+    fileObjList (newVal) {
+      this.fileList = newVal
+    }
   },
-  data() {
+  data () {
     return {
       fileList: [],
       uploadUrl: uploadUrl,
-      previewPath: "",
-      previewName: "",
+      previewPath: '',
+      previewName: '',
       previewVisible: false,
-      uploadFileList: [], //已经上传过的文件列表
-    };
+      uploadFileList: [] // 已经上传过的文件列表
+    }
   },
   methods: {
-    handleUpload(file) {
-      function getBase64(file) {
+    handleUpload (file) {
+      function getBase64 (file) {
         return new Promise((resolve, reject) => {
-          const reader = new FileReader();
-          reader.readAsDataURL(file);
-          reader.onload = () => resolve(reader.result);
-          reader.onerror = (error) => reject(error);
-        });
+          const reader = new FileReader()
+          reader.readAsDataURL(file)
+          reader.onload = () => resolve(reader.result)
+          reader.onerror = (error) => reject(error)
+        })
       }
 
       return getBase64(file.file).then((res) => {
-        //需要return才会显示上传成功状态,不加return不好使
+        // 需要return才会显示上传成功状态,不加return不好使
         // 开始上传
-        const formData = new FormData();
-        formData.append("file", file.file);
+        const formData = new FormData()
+        formData.append('file', file.file)
         uploadFiles(formData).then(({ data }) => {
-          if (data && data.code === "200") {
+          if (data && data.code === '200') {
             data.data.forEach((item) => {
               let fileData = this.fileList.find(
                 (file) => file.name === item.originFileName
-              );
-              fileData.fileName = item.originFileName;
-              fileData.url = item.fileUrl;
-              this.uploadFileList.push(fileData);
-            });
+              )
+              fileData.fileName = item.originFileName
+              fileData.url = item.fileUrl
+              this.uploadFileList.push(fileData)
+            })
 
-            this.$emit("input", this.uploadFileList);
-            this.$message.success("上传成功");
+            this.$emit('input', this.uploadFileList)
+            this.$message.success('上传成功')
           } else {
-            this.$message.error("上传失败");
+            this.$message.error('上传失败')
           }
-        });
-      });
+        })
+      })
     },
     // 上传
-    submitUpload() {
-      this.$refs.upload.submit();
+    submitUpload () {
+      this.$refs.upload.submit()
       // // 判断是否有文件
       // if (this.fileList.length === 0) {
       //   return this.$message.warning("请选取文件后再上传");
@@ -175,39 +175,39 @@ export default {
       // });
     },
     // 移除
-    handleRemove(file, fileList) {
-      this.fileList = fileList;
+    handleRemove (file, fileList) {
+      this.fileList = fileList
     },
     // 预览
-    handlePreview(file) {
+    handlePreview (file) {
       if (!file || !file.name || !file.url) {
-        this.$message.error("没有可预览的文件!");
-        return;
+        this.$message.error('没有可预览的文件!')
+        return
       }
-      let ext = getFileExt(file.name);
-      if (ext === "jpg" || ext === "jpeg" || ext === "png" || ext === "gif") {
-        this.previewPath = downloadUrl + file.url;
-        this.previewName = file.name;
-        this.previewVisible = true;
+      let ext = getFileExt(file.name)
+      if (ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif') {
+        this.previewPath = downloadUrl + file.url
+        this.previewName = file.name
+        this.previewVisible = true
       } else {
         // 弹出新页面显示下载文件
-        window.open(downloadUrl + file.url, "_blank");
+        window.open(downloadUrl + file.url, '_blank')
       }
     },
     // 改变上传内容
-    handleChange(file, fileList) {
-      this.fileList = fileList;
+    handleChange (file, fileList) {
+      this.fileList = fileList
     },
     // 超限
-    handleExceed(files, fileList) {
+    handleExceed (files, fileList) {
       this.$message.warning(
         `当前限制选择 ${this.limit} 个文件,本次选择了 ${
           files.length
         } 个文件,共选择了 ${files.length + fileList.length} 个文件`
-      );
-    },
-  },
-};
+      )
+    }
+  }
+}
 </script>
 
 <style scoped></style>

+ 60 - 60
src/views/modules/common/upload-component.vue

@@ -51,96 +51,96 @@
 </template>
 
 <script>
-import { uploadUrl, downloadUrl, uploadFiles } from "@/api/file";
-import { getFileExt } from "@/api/util";
+import { uploadUrl, downloadUrl, uploadFiles } from '@/api/file'
+import { getFileExt } from '@/api/util'
 export default {
-  name: "upload-component",
+  name: 'upload-component',
   props: {
     title: {
       type: String,
-      default: "附件",
+      default: '附件'
     },
     accept: {
       type: String,
-      default: "",
+      default: ''
     },
     multiple: {
       type: Boolean,
-      default: false,
+      default: false
     },
     limit: {
       type: Number,
-      default: 5,
+      default: 5
     },
     display: {
       type: Boolean,
-      default: false,
+      default: false
     },
     fileObjList: {
       type: Array,
-      default: () => [],
+      default: () => []
     },
     displayTitle: {
       type: Boolean,
-      default: true,
+      default: true
     },
     displayStar: {
       type: Boolean,
-      default: true,
-    },
+      default: true
+    }
   },
   watch: {
-    fileList(newVal) {
-      this.$emit("uploadSuccess", newVal);
-    },
-    fileObjList(newVal) {
-      this.fileList = newVal;
+    fileList (newVal) {
+      this.$emit('uploadSuccess', newVal)
     },
+    fileObjList (newVal) {
+      this.fileList = newVal
+    }
   },
-  data() {
+  data () {
     return {
       fileList: [],
       uploadUrl: uploadUrl,
-      previewPath: "",
-      previewName: "",
-      previewVisible: false,
-    };
+      previewPath: '',
+      previewName: '',
+      previewVisible: false
+    }
   },
   methods: {
-    handleUpload(file) {
+    handleUpload (file) {
       console.log(file)
-      function getBase64(file) {
+      function getBase64 (file) {
         return new Promise((resolve, reject) => {
-          const reader = new FileReader();
-          reader.readAsDataURL(file);
-          reader.onload = () => resolve(reader.result);
-          reader.onerror = (error) => reject(error);
-        });
+          const reader = new FileReader()
+          reader.readAsDataURL(file)
+          reader.onload = () => resolve(reader.result)
+          reader.onerror = (error) => reject(error)
+        })
       }
 
       return getBase64(file.file).then((res) => {
-        //需要return才会显示上传成功状态,不加return不好使
+        // 需要return才会显示上传成功状态,不加return不好使
         // 开始上传
-        const formData = new FormData();
-        formData.append("file", file.file);
+        const formData = new FormData()
+        formData.append('file', file.file)
         uploadFiles(formData).then(({ data }) => {
-          if (data && data.code === "200") {
+          if (data && data.code === '200') {
             data.data.forEach((item) => {
               let fileData = this.fileList.find(
                 (file) => file.name === item.originFileName
-              );
-              fileData.url = item.fileUrl;
-            });
-            this.$message.success("上传成功");
+              )
+              fileData.url = item.fileUrl
+            })
+            this.$message.success('上传成功')
           } else {
-            this.$message.error("上传失败");
+            this.$message.error('上传失败')
           }
-        });
-      });
+        })
+      })
     },
     // 上传
-    submitUpload() {
-      this.$refs.upload.submit();
+    submitUpload () {
+      this.$refs.upload.submit()
       // // 判断是否有文件
       // if (this.fileList.length === 0) {
       //   return this.$message.warning("请选取文件后再上传");
@@ -171,39 +171,39 @@ export default {
       // });
     },
     // 移除
-    handleRemove(file, fileList) {
-      this.fileList = fileList;
+    handleRemove (file, fileList) {
+      this.fileList = fileList
     },
     // 预览
-    handlePreview(file) {
+    handlePreview (file) {
       if (!file || !file.name || !file.url) {
-        this.$message.error("没有可预览的文件!");
-        return;
+        this.$message.error('没有可预览的文件!')
+        return
       }
-      let ext = getFileExt(file.name);
-      if (ext === "jpg" || ext === "jpeg" || ext === "png" || ext === "gif") {
-        this.previewPath = downloadUrl + file.url;
-        this.previewName = file.name;
-        this.previewVisible = true;
+      let ext = getFileExt(file.name)
+      if (ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif') {
+        this.previewPath = downloadUrl + file.url
+        this.previewName = file.name
+        this.previewVisible = true
       } else {
         // 弹出新页面显示下载文件
-        window.open(downloadUrl + file.url, "_blank");
+        window.open(downloadUrl + file.url, '_blank')
       }
     },
     // 改变上传内容
-    handleChange(file, fileList) {
-      this.fileList = fileList;
+    handleChange (file, fileList) {
+      this.fileList = fileList
     },
     // 超限
-    handleExceed(files, fileList) {
+    handleExceed (files, fileList) {
       this.$message.warning(
         `当前限制选择 ${this.limit} 个文件,本次选择了 ${
           files.length
         } 个文件,共选择了 ${files.length + fileList.length} 个文件`
-      );
-    },
-  },
-};
+      )
+    }
+  }
+}
 </script>
 
 <style scoped></style>

+ 136 - 136
src/views/modules/cus/communicate-add-or-update.vue

@@ -392,28 +392,28 @@
 
 <script>
 // import templateChose from '../product/template-chose'
-import { getCustomer, getCoDetail } from "@/api/cus";
-import { getDictList } from "@/api/dict";
-import uploadComponent from "../common/upload-component-v2";
-import AddOrUpdate from "../product/template-add-or-update";
-import WorderAddOrUpdate from "../worder/add-or-update";
-import AttachDetailDialog from "../common/attach-detail-dialog";
+import { getCustomer, getCoDetail } from '@/api/cus'
+import { getDictList } from '@/api/dict'
+import uploadComponent from '../common/upload-component-v2'
+import AddOrUpdate from '../product/template-add-or-update'
+import WorderAddOrUpdate from '../worder/add-or-update'
+import AttachDetailDialog from '../common/attach-detail-dialog'
 export default {
-  name: "communicate-add-or-update",
+  name: 'communicate-add-or-update',
   components: {
     AddOrUpdate,
     uploadComponent,
     WorderAddOrUpdate,
-    AttachDetailDialog,
+    AttachDetailDialog
   },
   computed: {
     orgId: {
-      get() {
-        return this.$store.state.user.orgId;
-      },
-    },
+      get () {
+        return this.$store.state.user.orgId
+      }
+    }
   },
-  data() {
+  data () {
     return {
       inboundVisible: false,
       detailVisible: false,
@@ -421,122 +421,122 @@ export default {
       attachVisible: false,
       visible: false,
       display: false,
-      dictType: "material_type",
+      dictType: 'material_type',
       options: [],
       optionsCus: [],
       dataList: [],
-      attachListTechnical: [], //技术资料
-      attachListDrawing: [], //数模/图纸
-      attachList: [], //沟通表原件
-      attachListOther: [], //其他附件
+      attachListTechnical: [], // 技术资料
+      attachListDrawing: [], // 数模/图纸
+      attachList: [], // 沟通表原件
+      attachListOther: [], // 其他附件
       id: 0,
       cusRCommProductVOS: [],
       workInfoList: [],
       dataForm: {},
       taskTypeOption: [
-        { label: "开始", value: "start" },
-        { label: "生产", value: "produce" },
-        { label: "检验", value: "check" },
-        { label: "总检", value: "t-check" },
-        { label: "结束", value: "end" },
-        { label: "常规", value: "routine" },
+        { label: '开始', value: 'start' },
+        { label: '生产', value: 'produce' },
+        { label: '检验', value: 'check' },
+        { label: '总检', value: 't-check' },
+        { label: '结束', value: 'end' },
+        { label: '常规', value: 'routine' }
       ],
       rankTypeOption: [
-        { label: "普通", value: 1 },
-        { label: "紧急", value: 2 },
-        { label: "加急", value: 3 },
+        { label: '普通', value: 1 },
+        { label: '紧急', value: 2 },
+        { label: '加急', value: 3 }
       ],
       dataRule: {
         cusId: [
-          { required: true, message: "客户名称不能为空", trigger: "blur" },
+          { required: true, message: '客户名称不能为空', trigger: 'blur' }
         ],
         coType: [
-          { required: true, message: "沟通类别不能为空", trigger: "change" },
+          { required: true, message: '沟通类别不能为空', trigger: 'change' }
         ],
         contact: [
-          { required: true, message: "联系人不能为空", trigger: "blur" },
+          { required: true, message: '联系人不能为空', trigger: 'blur' }
         ],
         contactTel: [
-          { required: true, message: "联系电话不能为空", trigger: "blur" },
+          { required: true, message: '联系电话不能为空', trigger: 'blur' }
         ],
-        way: [{ required: true, message: "沟通方式不能为空", trigger: "blur" }],
+        way: [{ required: true, message: '沟通方式不能为空', trigger: 'blur' }],
         content: [
-          { required: true, message: "沟通内容不能为空", trigger: "blur" },
-        ],
-      },
-    };
+          { required: true, message: '沟通内容不能为空', trigger: 'blur' }
+        ]
+      }
+    }
   },
   watch: {
-    "dataForm.cusId"(value) {
+    'dataForm.cusId' (value) {
       this.optionsCus.forEach((v) => {
         if (v.customerId === value) {
-          this.dataForm.contact = v.contact;
+          this.dataForm.contact = v.contact
         }
-      });
-    },
+      })
+    }
   },
   methods: {
-    onChose() {
-      this.$emit("onChose");
-      this.inboundVisible = false;
-      this.detailVisible = false;
-      this.worderVisible = false;
-      this.attachVisible = false;
+    onChose () {
+      this.$emit('onChose')
+      this.inboundVisible = false
+      this.detailVisible = false
+      this.worderVisible = false
+      this.attachVisible = false
     },
-    async init(id, display) {
-      this.dataForm = {};
-      this.cusRCommProductVOS = [];
-      this.workInfoList = [];
-      this.visible = true;
-      this.id = id || 0;
-      this.display = display;
+    async init (id, display) {
+      this.dataForm = {}
+      this.cusRCommProductVOS = []
+      this.workInfoList = []
+      this.visible = true
+      this.id = id || 0
+      this.display = display
       // 获取沟通类别
-      await getDictList({ type: "communication_type" }).then(({ data }) => {
+      await getDictList({ type: 'communication_type' }).then(({ data }) => {
         if (data) {
-          this.options = data;
+          this.options = data
         }
-      });
+      })
       await getCustomer().then(({ data }) => {
-        if (data && data.code === "200") {
-          this.optionsCus = data.data;
+        if (data && data.code === '200') {
+          this.optionsCus = data.data
         }
-      });
-      if (!id) return;
-      this.detailVisible = true;
+      })
+      if (!id) return
+      this.detailVisible = true
       await getCoDetail(this.id).then(({ data }) => {
-        if (data && data.code === "200") {
-          this.dataForm = data.data;
-          if (this.dataForm.coType !== "1") {
-            this.detailVisible = false;
+        if (data && data.code === '200') {
+          this.dataForm = data.data
+          if (this.dataForm.coType !== '1') {
+            this.detailVisible = false
           }
           // 附件显示
-          this.fileList = [];
+          this.fileList = []
           data.data.attachList.forEach((item) => {
             this.fileList.push({
               name: item.fileName,
               url: item.url,
-              id: item.url,
-            });
-          });
+              id: item.url
+            })
+          })
           if (data.data.cusRCommProductVOS) {
             data.data.cusRCommProductVOS.forEach((item) => {
-              this.addItem(item);
-            });
+              this.addItem(item)
+            })
           }
           if (data.data.workInfoList) {
             data.data.workInfoList.forEach((item) => {
-              this.addWorderItem(item);
-            });
+              this.addWorderItem(item)
+            })
           }
         }
-      });
+      })
     },
     // 表单提交
-    dataFormSubmit() {
-      this.$refs["dataForm"].validate((valid) => {
+    dataFormSubmit () {
+      this.$refs['dataForm'].validate((valid) => {
         if (valid) {
           // 添加附件
-          let fList = this.fileList;
+          // let fList = this.fileList
           // console.log('fileList = ' + fList)
           // if (fList.length > 0) {
           //   this.dataForm.attachList = [];
@@ -556,51 +556,51 @@ export default {
           //     return;
           //   }
           // }
-          this.dataForm.cusRCommProductVOS = this.cusRCommProductVOS;
-          this.dataForm.workInfoList = this.workInfoList;
+          this.dataForm.cusRCommProductVOS = this.cusRCommProductVOS
+          this.dataForm.workInfoList = this.workInfoList
           this.$http({
             url: !this.id
               ? this.$http.adornUrl(`/biz-service/cusCommunication/save`)
               : this.$http.adornUrl(`/biz-service/cusCommunication/update`),
-            method: "post",
-            data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId }),
+            method: 'post',
+            data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId })
           }).then(({ data }) => {
-            if (data && data.code === "200") {
+            if (data && data.code === '200') {
               this.$message({
-                message: "操作成功",
-                type: "success",
+                message: '操作成功',
+                type: 'success',
                 duration: 1500,
                 onClose: () => {
-                  this.onChose();
-                  this.$emit("refreshDataList");
-                },
-              });
+                  this.onChose()
+                  this.$emit('refreshDataList')
+                }
+              })
             } else {
-              this.$message.error(data.msg);
+              this.$message.error(data.msg)
             }
-          });
+          })
         }
-      });
+      })
     },
-    validateField(type) {
-      this.$refs.dataForm.validateField(type);
+    validateField (type) {
+      this.$refs.dataForm.validateField(type)
     },
-    inBound() {
-      this.inboundVisible = true;
+    inBound () {
+      this.inboundVisible = true
       this.$nextTick(() => {
-        this.$refs.inbound.init(1);
-      });
+        this.$refs.inbound.init(1)
+      })
     },
     // 编辑产品项
-    updateProductHandle(row) {
-      this.inboundVisible = true;
+    updateProductHandle (row) {
+      this.inboundVisible = true
       this.$nextTick(() => {
-        this.$refs.inbound.init(1, row);
-      });
+        this.$refs.inbound.init(1, row)
+      })
     },
-    addItem(item) {
+    addItem (item) {
       if (!item.recordId) {
-        item.recordId = Math.round(Math.random() * 1000000);
+        item.recordId = Math.round(Math.random() * 1000000)
       }
       if (
         this.cusRCommProductVOS.findIndex(
@@ -608,65 +608,65 @@ export default {
         ) === -1
       ) {
         this.cusRCommProductVOS.push({
-          ...item,
-        });
+          ...item
+        })
       }
     },
-    //添加工单
-    addWorderItem(item) {
+    // 添加工单
+    addWorderItem (item) {
       if (!item.recordId) {
-        item.recordId = Math.round(Math.random() * 1000000);
+        item.recordId = Math.round(Math.random() * 1000000)
       }
       if (
         this.workInfoList.findIndex(
           (item1) => item1.recordId === item.recordId
         ) === -1
       ) {
-        this.workInfoList.push({ ...item });
+        this.workInfoList.push({ ...item })
       }
     },
-    uploadSuccessTechnical(fileList) {
-      this.attachListTechnical = fileList;
+    uploadSuccessTechnical (fileList) {
+      this.attachListTechnical = fileList
     },
-    uploadSuccessDrawing(fileList) {
-      this.attachListDrawing = fileList;
+    uploadSuccessDrawing (fileList) {
+      this.attachListDrawing = fileList
     },
-    uploadSuccess(fileList) {
-      this.attachList = fileList;
+    uploadSuccess (fileList) {
+      this.attachList = fileList
     },
-    uploadSuccessOther(fileList) {
-      this.attachListOther = fileList;
+    uploadSuccessOther (fileList) {
+      this.attachListOther = fileList
     },
-    typeChanged(item) {
-      this.detailVisible = item === "1";
+    typeChanged (item) {
+      this.detailVisible = item === '1'
     },
     // 删除产品项
-    deleteProductHandle(recordId) {
+    deleteProductHandle (recordId) {
       this.cusRCommProductVOS.splice(
         this.cusRCommProductVOS.findIndex((item) => item.recordId === recordId),
         1
-      );
+      )
     },
-    worderAdd() {
-      this.worderVisible = true;
+    worderAdd () {
+      this.worderVisible = true
       this.$nextTick(() => {
-        this.$refs.worder.init(0, null);
-      });
+        this.$refs.worder.init(0, null)
+      })
     },
-    updateWorderHandle(row) {
-      this.worderVisible = true;
+    updateWorderHandle (row) {
+      this.worderVisible = true
       this.$nextTick(() => {
-        this.$refs.worder.init(1, row);
-      });
+        this.$refs.worder.init(1, row)
+      })
     },
-    attachDetails(attachList) {
+    attachDetails (attachList) {
       attachList.forEach((item) => {
-        item.fileName = item.name;
-      });
-      this.$refs.attachDetail.init(attachList);
-    },
-  },
-};
+        item.fileName = item.name
+      })
+      this.$refs.attachDetail.init(attachList)
+    }
+  }
+}
 </script>
 
 <style scoped>

+ 43 - 43
src/views/modules/cus/communicate-detail.vue

@@ -198,86 +198,86 @@
 </template>
 
 <script>
-import EDesc from "../common/e-desc";
-import EDescItem from "../common/e-desc-item";
-import { getCoDetail } from "@/api/cus";
-import uploadComponent from "../common/upload-component-v2";
-import AttachDetailDialog from "../common/attach-detail-dialog";
+import EDesc from '../common/e-desc'
+import EDescItem from '../common/e-desc-item'
+import { getCoDetail } from '@/api/cus'
+import uploadComponent from '../common/upload-component-v2'
+import AttachDetailDialog from '../common/attach-detail-dialog'
 export default {
-  name: "communicate-detail",
+  name: 'communicate-detail',
   components: {
     EDesc,
     EDescItem,
     uploadComponent,
     AttachDetailDialog
   },
-  data() {
+  data () {
     return {
       visible: false,
       id: 0,
       dataForm: {},
       cusRCommProductVOS: [],
-      fileList: [],
-    };
+      fileList: []
+    }
   },
   methods: {
-    onChose() {
-      this.$emit("onChose");
+    onChose () {
+      this.$emit('onChose')
     },
-    async init(id) {
-      this.visible = true;
-      this.id = id || 0;
-      this.dataForm = {};
-      this.cusRCommProductVOS = [];
-      this.fileList = [];
-      this.getDetails();
+    async init (id) {
+      this.visible = true
+      this.id = id || 0
+      this.dataForm = {}
+      this.cusRCommProductVOS = []
+      this.fileList = []
+      this.getDetails()
     },
-    getDetails() {
+    getDetails () {
       getCoDetail(this.id).then(({ data }) => {
-        if (data && data.code === "200") {
-          this.dataForm = data.data;
+        if (data && data.code === '200') {
+          this.dataForm = data.data
           // 附件显示
-          this.fileList = [];
+          this.fileList = []
           if (this.dataForm.attachListTechnical) {
             this.dataForm.attachListTechnical.forEach((item) => {
-              item.name = item.fileName;
-              item.id = item.url;
-            });
+              item.name = item.fileName
+              item.id = item.url
+            })
           }
           if (this.dataForm.attachListDrawing) {
             this.dataForm.attachListDrawing.forEach((item) => {
-              item.name = item.fileName;
-              item.id = item.url;
-            });
+              item.name = item.fileName
+              item.id = item.url
+            })
           }
           if (this.dataForm.attachList) {
             this.dataForm.attachList.forEach((item) => {
-              item.name = item.fileName;
-              item.id = item.url;
-            });
+              item.name = item.fileName
+              item.id = item.url
+            })
           }
           if (this.dataForm.attachListOther) {
             this.dataForm.attachListOther.forEach((item) => {
-              item.name = item.fileName;
-              item.id = item.url;
-            });
+              item.name = item.fileName
+              item.id = item.url
+            })
           }
 
           if (data.data.cusRCommProductVOS) {
             data.data.cusRCommProductVOS.forEach((item) => {
               this.cusRCommProductVOS.push({
-                ...item,
-              });
-            });
+                ...item
+              })
+            })
           }
         }
-      });
+      })
     },
-    attachDetails(attachList) {
-      this.$refs.attachDetail.init(attachList);
-    },
-  },
-};
+    attachDetails (attachList) {
+      this.$refs.attachDetail.init(attachList)
+    }
+  }
+}
 </script>
 
 <style scoped>

+ 1 - 1
src/views/modules/home/admin.vue

@@ -542,7 +542,7 @@ export default {
       })
     },
     contractProdListAddClass ({row, rowIndex}) {
-      if (row.warningState == '3') {
+      if (row.warningState === '3') {
         return 'custom-ranking-table-row overdue-row'
       }
 

+ 19 - 16
src/views/modules/order/order-add-or-update.vue

@@ -79,7 +79,7 @@
               prop="productName"
               header-align="center"
               align="center"
-              min-width="120"
+              width="160"
               :show-tooltip-when-overflow="true"
               label="物料名称">
             </el-table-column>
@@ -87,7 +87,7 @@
               prop="productSpecifications"
               header-align="center"
               align="center"
-              min-width="120"
+              width="120"
               :show-tooltip-when-overflow="true"
               label="规格">
             </el-table-column>
@@ -95,37 +95,37 @@
               prop="cnt"
               header-align="center"
               align="center"
-              min-width="100"
+              width="80"
               label="数量">
             </el-table-column>
             <el-table-column
               prop="cnt"
               header-align="center"
               align="center"
-              min-width="100"
+              width="80"
               label="单位">
             </el-table-column>
             <el-table-column
               prop="productNumber"
               header-align="center"
               align="center"
-              min-width="160"
+              width="120"
               :show-tooltip-when-overflow="true"
               label="生产编号">
             </el-table-column>
             <el-table-column
-              prop="-"
+              prop="batchNumber"
               header-align="center"
               align="center"
-              min-width="160"
+              width="120"
               :show-tooltip-when-overflow="true"
               label="批次号">
             </el-table-column>
             <el-table-column
-              prop="-"
+              prop="produceRequire"
               header-align="center"
               align="center"
-              min-width="160"
+              width="160"
               :show-tooltip-when-overflow="true"
               label="生产要求">
             </el-table-column>
@@ -133,14 +133,14 @@
               prop="price"
               header-align="center"
               align="center"
-              min-width="100"
+              width="80"
               label="含税单价">
             </el-table-column>
             <el-table-column
               prop="amount"
               header-align="center"
               align="center"
-              min-width="100"
+              width="80"
               label="含税总价">
               <template slot-scope="scope">
                 <span>{{ (scope.row.cnt*scope.row.price).toFixed(1) }}</span>
@@ -150,7 +150,7 @@
               prop="rate"
               header-align="center"
               align="center"
-              min-width="100"
+              width="100"
               label="税率">
               <template slot-scope="scope">
                 {{scope.row.rate}}%
@@ -173,12 +173,15 @@
               label="物料关联">
             </el-table-column>
             <el-table-column
-              prop="-"
+              prop="appraisal"
               header-align="center"
               align="center"
               width="120"
               :show-tooltip-when-overflow="true"
               label="首件鉴定">
+              <template slot-scope="scope">
+                <span>{{!scope.row.appraisal?'':(Number(scope.row.appraisal) === 2?'是':'否')}}</span>
+              </template>
             </el-table-column>
             <el-table-column
               fixed="right"
@@ -193,7 +196,7 @@
             </el-table-column>
           </el-table>
           <el-row style="text-align: center; margin-top: 10px;">
-            <el-button :disabled="addType === 2" v-show="!display" type="primary" icon="el-icon-plus" @click="addProduct"></el-button>
+            <el-button :disabled="addType === 2" v-show="!display" type="primary" icon="el-icon-plus" @click="addProductHandle"></el-button>
           </el-row>
         </el-row>
         <el-row class="my-row">
@@ -287,7 +290,7 @@
             </el-table-column>
           </el-table>
           <el-row style="text-align: center; margin-top: 10px;">
-            <el-button :disabled="addType === 2" v-show="!display" type="primary" icon="el-icon-plus" @click="addProductV2"></el-button>
+            <el-button :disabled="addType === 2" v-show="!display" type="primary" icon="el-icon-plus" @click="addWorkItemHandle"></el-button>
           </el-row>
         </el-row>
       </el-form>
@@ -475,7 +478,7 @@
         this.dataForm.salesmanId = val
       },
       // 添加订单产品明细
-      addProduct () {
+      addProductHandle () {
         this.productListVisible = true
         this.$nextTick(() => {
           this.$refs.productList.init(2)

+ 28 - 19
src/views/modules/product/template-add-or-update.vue

@@ -21,18 +21,22 @@
             <el-input-number v-model="dataForm.cnt" :disabled="bizType === 3" ></el-input-number>
           </el-form-item>
         </el-row>
-         <el-row class="my-row">
-          <el-form-item label="交付日期" prop="deliveryDate">
-            <el-date-picker
-              v-model="dataForm.deliveryDate"
-              value-format="yyyy-MM-dd"
-              type="date"
-              :disabled="bizType === 3"
-            >
-            </el-date-picker>
+        <el-row class="my-row" v-if="bizType === 2">
+          <el-form-item label="生产编号" prop="productNumber">
+            <el-input v-model="dataForm.productNumber" placeholder="订单编号" :disabled="bizType === 3" ></el-input>
+          </el-form-item>
+        </el-row>
+        <el-row class="my-row" v-if="bizType === 2">
+          <el-form-item label="批次号" prop="batchNumber">
+            <el-input v-model="dataForm.batchNumber" placeholder="批次号" :disabled="bizType === 3" ></el-input>
+          </el-form-item>
+        </el-row>
+        <el-row class="my-row" v-if="bizType === 2">
+          <el-form-item label="生产要求" prop="produceRequire">
+            <el-input v-model="dataForm.produceRequire" placeholder="生产要求" :disabled="bizType === 3" ></el-input>
           </el-form-item>
         </el-row>
-        <!-- <el-row class="my-row">
+        <el-row class="my-row">
           <el-form-item label="含税单价" prop="price">
             <el-input-number v-model="dataForm.price" :step="1" :min="0" :precision="1" :disabled="bizType === 3" ></el-input-number>
           </el-form-item>
@@ -47,21 +51,24 @@
             <el-input-number style="width: 160px" v-model="dataForm.rate" :step="1" :precision="1" :disabled="bizType === 3" />&nbsp;%
           </el-form-item>
         </el-row>
-        <el-row class="my-row" v-if="bizType === 2">
-          <el-form-item label="订单编号" prop="productNumber">
-            <el-input v-model="dataForm.productNumber" placeholder="订单编号" :disabled="bizType === 3" ></el-input>
-          </el-form-item>
-        </el-row> -->
         <el-row class="my-row">
           <el-form-item label="备注" prop="notes">
             <el-input type="textarea" v-model="dataForm.notes" placeholder="备注"></el-input>
           </el-form-item>
         </el-row>
         <el-row class="my-row" v-if="bizType === 2 || bizType === 3">
-          <el-form-item prop="productId" label="产品关联">
+          <el-form-item prop="productId" label="物料关联">
             <product-component v-model="dataForm.productId" :product-id="dataForm.productId" @productSelected="prodSelected"/>
           </el-form-item>
         </el-row>
+        <el-row class="my-row">
+          <el-form-item label="首件鉴定">
+            <el-radio-group v-model="dataForm.appraisal">
+              <el-radio :label="1">否</el-radio>
+              <el-radio :label="2">是</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-row>
       </el-form>
       <span slot="footer">
           <el-button @click="onChose">取消</el-button>
@@ -82,9 +89,10 @@
         visible: false,
         isModify: false,
         bizType: 1,
-        dataForm: {},
+        dataForm: {
+        },
         dataRule: {
-          productName: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }],
+          productName: [{ required: true, message: '物料名称不能为空', trigger: 'blur' }],
           productSpecifications: [{ required: true, message: '规格不能为空', trigger: 'blur' }],
           cnt: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
           price: [{ required: true, message: '含税单价不能为空', trigger: 'blur' }]
@@ -103,7 +111,8 @@
           this.dataForm = dataForm
         } else {
           this.dataForm = {
-            recordId: Math.round(Math.random() * 1000000)
+            recordId: Math.round(Math.random() * 1000000),
+            appraisal: 1
           }
         }
         this.visible = true

+ 64 - 64
src/views/modules/tech-manage/material-tech-add-or-update.vue

@@ -76,98 +76,98 @@
 </template>
 
 <script>
-import UploadComponent from "../common/upload-component";
-import { getMaterialList, getMaterialTechDetail } from "@/api/material";
+import UploadComponent from '../common/upload-component'
+import { getMaterialList, getMaterialTechDetail } from '@/api/material'
 export default {
-  name: "material-tech-add-or-update",
+  name: 'material-tech-add-or-update',
   components: { UploadComponent },
-  data() {
+  data () {
     return {
       id: 0,
       isEdit: false,
       dataForm: {
-        optionCode: "",
-        productId: "",
-        optionName: "",
-        remark: "",
+        optionCode: '',
+        productId: '',
+        optionName: '',
+        remark: ''
       },
       fileList: [],
       materialList: [],
       dataRule: {
         optionCode: [
-          { required: true, message: "请输入方案编码", trigger: "blur" },
+          { required: true, message: '请输入方案编码', trigger: 'blur' }
         ],
         materialName: [
-          { required: true, message: "请输入物料名称", trigger: "blur" },
+          { required: true, message: '请输入物料名称', trigger: 'blur' }
         ],
         optionName: [
-          { required: true, message: "请输入方案名称", trigger: "blur" },
-        ],
-      },
-    };
+          { required: true, message: '请输入方案名称', trigger: 'blur' }
+        ]
+      }
+    }
   },
-  created() {},
+  created () {},
   methods: {
-    onChose() {
-      this.$emit("onChose");
+    onChose () {
+      this.$emit('onChose')
     },
-    async init(id, display) {
-      this.id = id || 0;
-      this.fileList = [];
-      this.$refs["dataForm"].resetFields();
-      this.materialList = [];
+    async init (id, display) {
+      this.id = id || 0
+      this.fileList = []
+      this.$refs['dataForm'].resetFields()
+      this.materialList = []
 
-      await this.getMaterialList();
+      await this.getMaterialList()
 
-      if (!id) return;
+      if (!id) return
 
       await getMaterialTechDetail(id).then(({ data }) => {
-        if (data && data.code === "200") {
-          this.dataForm.optionId = id;
-          this.dataForm.productId = data.data.productId;
-          this.dataForm.optionCode = data.data.optionCode;
-          this.dataForm.optionName = data.data.optionName;
-          this.dataForm.remark = data.data.remark;
-          
+        if (data && data.code === '200') {
+          this.dataForm.optionId = id
+          this.dataForm.productId = data.data.productId
+          this.dataForm.optionCode = data.data.optionCode
+          this.dataForm.optionName = data.data.optionName
+          this.dataForm.remark = data.data.remark
+
           // 附件
           if (data.data.attachList) {
             data.data.attachList.forEach((item) => {
               this.fileList.push({
                 name: item.fileName,
                 url: item.url,
-                id: item.url,
-              });
-            });
+                id: item.url
+              })
+            })
           }
         }
-      });
+      })
     },
-    uploadSuccess(fileList) {
-      this.fileList = fileList;
+    uploadSuccess (fileList) {
+      this.fileList = fileList
     },
-    async getMaterialList() {
+    async getMaterialList () {
       await getMaterialList().then(({ data }) => {
-        if (data && data.code === "200") {
-          this.materialList = data.data.records;
+        if (data && data.code === '200') {
+          this.materialList = data.data.records
         }
-      });
+      })
     },
-    dataFormSubmit() {
-      this.$refs["dataForm"].validate((valid) => {
+    dataFormSubmit () {
+      this.$refs['dataForm'].validate((valid) => {
         if (valid) {
           // 产品技术文件
-          let fList = this.fileList;
+          let fList = this.fileList
           if (fList.length > 0) {
-            this.dataForm.attachList = [];
+            this.dataForm.attachList = []
             for (let i = 0; i < fList.length; i++) {
               this.dataForm.attachList.push({
                 fileName: fList[i].name,
-                url: fList[i].url,
-              });
+                url: fList[i].url
+              })
             }
           } else {
-            this.$message.error("请上传工艺方案附件");
-            return;
+            this.$message.error('请上传工艺方案附件')
+            return
           }
 
           this.$http({
@@ -176,28 +176,28 @@ export default {
               : this.$http.adornUrl(
                   `/biz-service/pro-technology-option/update`
                 ),
-            method: "post",
-            data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId }),
+            method: 'post',
+            data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId })
           }).then(({ data }) => {
-            if (data && data.code === "200") {
+            if (data && data.code === '200') {
               this.$message({
-                message: "操作成功",
-                type: "success",
+                message: '操作成功',
+                type: 'success',
                 duration: 1500,
                 onClose: () => {
-                  this.onChose();
-                  this.$emit("refreshDataList");
-                },
-              });
+                  this.onChose()
+                  this.$emit('refreshDataList')
+                }
+              })
             } else {
-              this.$message.error(data.msg);
+              this.$message.error(data.msg)
             }
-          });
+          })
         }
-      });
-    },
-  },
-};
+      })
+    }
+  }
+}
 </script>
 
 <style scoped></style>

+ 64 - 64
src/views/modules/tech-manage/material-tech-detail.vue

@@ -26,64 +26,64 @@
 </template>
 
 <script>
-import EDesc from "../common/e-desc";
-import EDescItem from "../common/e-desc-item";
-import UploadComponent from "../common/upload-component";
-import { getMaterialList, getMaterialTechDetail } from "@/api/material";
+import EDesc from '../common/e-desc'
+import EDescItem from '../common/e-desc-item'
+import UploadComponent from '../common/upload-component'
+import { getMaterialList, getMaterialTechDetail } from '@/api/material'
 export default {
-  name: "material-tech-detail",
+  name: 'material-tech-detail',
   components: { UploadComponent, EDesc, EDescItem },
-  data() {
+  data () {
     return {
       id: 0,
       isEdit: false,
       dataForm: {
-        optionCode: "",
-        productId: "",
-        optionName: "",
-        remark: "",
+        optionCode: '',
+        productId: '',
+        optionName: '',
+        remark: ''
       },
       fileList: [],
       materialList: [],
       dataRule: {
         optionCode: [
-          { required: true, message: "请输入方案编码", trigger: "blur" },
+          { required: true, message: '请输入方案编码', trigger: 'blur' }
         ],
         materialName: [
-          { required: true, message: "请输入物料名称", trigger: "blur" },
+          { required: true, message: '请输入物料名称', trigger: 'blur' }
         ],
         optionName: [
-          { required: true, message: "请输入方案名称", trigger: "blur" },
-        ],
-      },
-    };
+          { required: true, message: '请输入方案名称', trigger: 'blur' }
+        ]
+      }
+    }
   },
-  created() {},
+  created () {},
   methods: {
-    onChose() {
-      this.$emit("onChose");
+    onChose () {
+      this.$emit('onChose')
     },
-    async init(id, display) {
-      this.id = id || 0;
-      this.fileList = [];
-      this.materialList = [];
+    async init (id, display) {
+      this.id = id || 0
+      this.fileList = []
+      this.materialList = []
 
-      await this.getMaterialList();
+      await this.getMaterialList()
 
-      if (!id) return;
+      if (!id) return
 
       await getMaterialTechDetail(id).then(({ data }) => {
-        if (data && data.code === "200") {
-          this.dataForm.productId = data.data.productId;
+        if (data && data.code === '200') {
+          this.dataForm.productId = data.data.productId
           let marterial = this.materialList.find(
-            (t) => t.materialId == data.data.productId
-          );
+            (t) => t.materialId === data.data.productId
+          )
           if (marterial) {
-            this.dataForm.materialName = marterial.materialName;
+            this.dataForm.materialName = marterial.materialName
           }
-          this.dataForm.optionCode = data.data.optionCode;
-          this.dataForm.optionName = data.data.optionName;
-          this.dataForm.remark = data.data.remark;
+          this.dataForm.optionCode = data.data.optionCode
+          this.dataForm.optionName = data.data.optionName
+          this.dataForm.remark = data.data.remark
 
           // 附件
           if (data.data.attachList) {
@@ -91,36 +91,36 @@ export default {
               this.fileList.push({
                 name: item.fileName,
                 url: item.url,
-                id: item.url,
-              });
-            });
+                id: item.url
+              })
+            })
           }
         }
-      });
+      })
     },
-    async getMaterialList() {
+    async getMaterialList () {
       await getMaterialList().then(({ data }) => {
-        if (data && data.code === "200") {
-          this.materialList = data.data.records;
+        if (data && data.code === '200') {
+          this.materialList = data.data.records
         }
-      });
+      })
     },
-    dataFormSubmit() {
-      this.$refs["dataForm"].validate((valid) => {
+    dataFormSubmit () {
+      this.$refs['dataForm'].validate((valid) => {
         if (valid) {
           // 产品技术文件
-          let fList = this.fileList;
+          let fList = this.fileList
           if (fList.length > 0) {
-            this.dataForm.attachList = [];
+            this.dataForm.attachList = []
             for (let i = 0; i < fList.length; i++) {
               this.dataForm.attachList.push({
                 fileName: fList[i].name,
-                url: fList[i].url,
-              });
+                url: fList[i].url
+              })
             }
           } else {
-            this.$message.error("请上传工艺方案附件");
-            return;
+            this.$message.error('请上传工艺方案附件')
+            return
           }
 
           this.$http({
@@ -129,28 +129,28 @@ export default {
               : this.$http.adornUrl(
                   `/biz-service/pro-technology-option/update`
                 ),
-            method: "post",
-            data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId }),
+            method: 'post',
+            data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId })
           }).then(({ data }) => {
-            if (data && data.code === "200") {
+            if (data && data.code === '200') {
               this.$message({
-                message: "操作成功",
-                type: "success",
+                message: '操作成功',
+                type: 'success',
                 duration: 1500,
                 onClose: () => {
-                  this.onChose();
-                  this.$emit("refreshDataList");
-                },
-              });
+                  this.onChose()
+                  this.$emit('refreshDataList')
+                }
+              })
             } else {
-              this.$message.error(data.msg);
+              this.$message.error(data.msg)
             }
-          });
+          })
         }
-      });
-    },
-  },
-};
+      })
+    }
+  }
+}
 </script>
 
 <style scoped></style>

+ 40 - 40
src/views/modules/tech-manage/material-tech-note-change.vue

@@ -26,81 +26,81 @@
 </template>
 
 <script>
-import UserComponents from "../common/user-components";
+import UserComponents from '../common/user-components'
 export default {
-  name: "material-tech-note-change",
+  name: 'material-tech-note-change',
   components: {
-    UserComponents,
+    UserComponents
   },
-  data() {
+  data () {
     return {
       visible: false,
       dataForm: {
-        userIds: [],
+        userIds: []
       },
       dataRule: {
         userIds: [
-          { required: true, message: "请选择通知接收人", trigger: "change" },
-        ],
-      },
-    };
+          { required: true, message: '请选择通知接收人', trigger: 'change' }
+        ]
+      }
+    }
   },
-  created() {},
+  created () {},
   methods: {
-    onChose() {
-      this.$emit("onChose");
+    onChose () {
+      this.$emit('onChose')
     },
-    async init() {
-      this.dataForm = {};
+    async init () {
+      this.dataForm = {}
       this.$http({
         url: this.$http.adornUrl(
           `/biz-service/pro-technology-option/noteChangeConfig`
         ),
-        method: "get",
+        method: 'get'
       }).then(({ data }) => {
-        if (data && data.code === "200") {
+        if (data && data.code === '200') {
           this.dataForm = {
-            userIds: data.data,
-          };
+            userIds: data.data
+          }
         }
-      });
-      this.visible = true;
+      })
+      this.visible = true
     },
-    validateField(type) {
-      this.$refs.dataForm.validateField(type);
+    validateField (type) {
+      this.$refs.dataForm.validateField(type)
     },
     // 表单提交
-    dataFormSubmit() {
-      this.$refs["dataForm"].validate((valid) => {
+    dataFormSubmit () {
+      this.$refs['dataForm'].validate((valid) => {
         if (valid) {
           this.$http({
             url: this.$http.adornUrl(
               `/biz-service/pro-technology-option/noteChangeConfig`
             ),
-            method: "post",
-            data: this.dataForm.userIds,
+            method: 'post',
+            data: this.dataForm.userIds
           }).then(({ data }) => {
-            if (data && data.code === "200") {
+            if (data && data.code === '200') {
               this.$message({
-                message: "操作成功",
-                type: "success",
+                message: '操作成功',
+                type: 'success',
                 duration: 1500,
                 onClose: () => {
-                  this.onChose();
-                },
-              });
+                  this.onChose()
+                }
+              })
             } else {
-              this.$message.error(data.msg);
+              this.$message.error(data.msg)
             }
-          });
+          })
         }
-      });
-    },
-    userSelectedChanged(val) {
-      this.dataForm.userIds = val;
+      })
     },
-  },
-};
+    userSelectedChanged (val) {
+      this.dataForm.userIds = val
+    }
+  }
+}
 </script>
 
 <style scoped></style>

+ 61 - 62
src/views/modules/tech-manage/material-tech.vue

@@ -29,7 +29,6 @@
                 :label="item.materialName"
                 :value="item.materialId"
               >
-              </el-option>
             </el-option>
           </el-select>
         </el-form-item>
@@ -187,20 +186,20 @@
 </template>
 
 <script>
-import AddOrUpdate from "./material-tech-add-or-update";
-import Detail from "./material-tech-detail";
-import NoteChange from "./material-tech-note-change";
+import AddOrUpdate from './material-tech-add-or-update'
+import Detail from './material-tech-detail'
+import NoteChange from './material-tech-note-change'
 import AttachDetail from '../common/attach-detail'
-import { getMaterialList } from "@/api/material";
+import { getMaterialList } from '@/api/material'
 export default {
-  name: "material-tech",
+  name: 'material-tech',
   components: {
     AddOrUpdate,
     Detail,
     NoteChange,
     AttachDetail
   },
-  data() {
+  data () {
     return {
       addOrUpdateVisible: false,
       detailVisible: false,
@@ -208,46 +207,46 @@ export default {
       attachVisible: false,
       materialList: [],
       dataForm: {
-        optionName: "",
+        optionName: ''
       },
       options: [],
       dataList: [],
       pageIndex: 1,
       pageSize: 10,
       totalPage: 0,
-      dataListLoading: false,
-    };
+      dataListLoading: false
+    }
   },
-  created() {
-    this.getDataList();
-    this.getMaterialList();
+  created () {
+    this.getDataList()
+    this.getMaterialList()
   },
   methods: {
-    onChose() {
-      this.addOrUpdateVisible = false;
-      this.detailVisible = false;
-      this.noteChangeVisible = false;
-      this.attachVisible = false;
+    onChose () {
+      this.addOrUpdateVisible = false
+      this.detailVisible = false
+      this.noteChangeVisible = false
+      this.attachVisible = false
     },
-    getMaterialList() {
+    getMaterialList () {
       getMaterialList().then(({ data }) => {
-        if (data && data.code === "200") {
-          this.materialList = data.data.records;
+        if (data && data.code === '200') {
+          this.materialList = data.data.records
         }
-      });
+      })
     },
     // 查询
-    search() {
-      this.pageIndex = 1;
-      this.getDataList();
+    search () {
+      this.pageIndex = 1
+      this.getDataList()
     },
     // 获取数据列表
-    getDataList() {
-      this.addOrUpdateVisible = false;
-      this.dataListLoading = true;
+    getDataList () {
+      this.addOrUpdateVisible = false
+      this.dataListLoading = true
       this.$http({
-        url: this.$http.adornUrl("/biz-service/pro-technology-option/list"),
-        method: "get",
+        url: this.$http.adornUrl('/biz-service/pro-technology-option/list'),
+        method: 'get',
         params: this.$http.adornParams({
           current: this.pageIndex,
           size: this.pageSize,
@@ -258,58 +257,58 @@ export default {
             : null,
           createTimeE: this.dataForm.createTime
             ? this.dataForm.createTime[1]
-            : null,
-        }),
+            : null
+        })
       }).then(({ data }) => {
-        if (data && data.code === "200") {
-          this.dataList = data.data.records;
-          this.totalPage = Number(data.data.total);
+        if (data && data.code === '200') {
+          this.dataList = data.data.records
+          this.totalPage = Number(data.data.total)
         } else {
-          this.dataList = [];
-          this.totalPage = 0;
+          this.dataList = []
+          this.totalPage = 0
         }
-        this.dataListLoading = false;
-      });
+        this.dataListLoading = false
+      })
     },
     // 每页数
-    sizeChangeHandle(val) {
-      this.pageSize = val;
-      this.pageIndex = 1;
-      this.getDataList();
+    sizeChangeHandle (val) {
+      this.pageSize = val
+      this.pageIndex = 1
+      this.getDataList()
     },
     // 当前页
-    currentChangeHandle(val) {
-      this.pageIndex = val;
-      this.getDataList();
+    currentChangeHandle (val) {
+      this.pageIndex = val
+      this.getDataList()
     },
     // 新增 / 修改
-    addOrUpdateHandle(id, disabled) {
-      this.addOrUpdateVisible = true;
+    addOrUpdateHandle (id, disabled) {
+      this.addOrUpdateVisible = true
       this.$nextTick(() => {
-        this.$refs.addOrUpdate.init(id, disabled);
-      });
+        this.$refs.addOrUpdate.init(id, disabled)
+      })
     },
-    detailHandle(id) {
-      this.detailVisible = true;
+    detailHandle (id) {
+      this.detailVisible = true
       this.$nextTick(() => {
-        this.$refs.detail.init(id);
-      });
+        this.$refs.detail.init(id)
+      })
     },
-    noteChange(){
-      this.noteChangeVisible = true;
+    noteChange () {
+      this.noteChangeVisible = true
       this.$nextTick(() => {
-        this.$refs.noteChange.init();
-      });
+        this.$refs.noteChange.init()
+      })
     },
-    //方案文件
-    attachDetails (attachList){
+    // 方案文件
+    attachDetails (attachList) {
       this.attachVisible = true
       this.$nextTick(() => {
         this.$refs.attachDetail.init(attachList)
       })
     }
-  },
-};
+  }
+}
 </script>
 
 <style scoped></style>

+ 0 - 1
src/views/modules/tech/ctafts-add-or-detail.vue

@@ -114,7 +114,6 @@ export default {
   },
   data () {
     return {
-      workTypeOptions: [],
       datas: {},
       visible: false,
       display: false,

+ 59 - 59
src/views/modules/worder/add-or-update.vue

@@ -136,12 +136,12 @@
 </template>
 
 <script>
-import uploadComponent from "../common/upload-component-v2";
-import { getUserList } from "@/api/user";
+import uploadComponent from '../common/upload-component-v2'
+import { getUserList } from '@/api/user'
 export default {
-  name: "worder-add-or-update",
+  name: 'worder-add-or-update',
   components: { uploadComponent },
-  data() {
+  data () {
     return {
       id: 0,
       visible: false,
@@ -152,99 +152,99 @@ export default {
       attachList: [],
       userList: [],
       taskTypeOption: [
-        { label: "开始", value: "start" },
-        { label: "生产", value: "produce" },
-        { label: "检验", value: "check" },
-        { label: "总检", value: "t-check" },
-        { label: "结束", value: "end" },
-        { label: "常规", value: "routine" },
+        { label: '开始', value: 'start' },
+        { label: '生产', value: 'produce' },
+        { label: '检验', value: 'check' },
+        { label: '总检', value: 't-check' },
+        { label: '结束', value: 'end' },
+        { label: '常规', value: 'routine' }
       ],
       rankTypeOption: [
-        { label: "普通", value: 1 },
-        { label: "紧急", value: 2 },
-        { label: "加急", value: 3 },
+        { label: '普通', value: 1 },
+        { label: '紧急', value: 2 },
+        { label: '加急', value: 3 }
       ],
       dataRule: {
         taskCode: [
-          { required: true, message: "请输入工单编码", trigger: "blur" },
+          { required: true, message: '请输入工单编码', trigger: 'blur' }
         ],
         taskType: [
-          { required: true, message: "请选择工单类型", trigger: "change" },
+          { required: true, message: '请选择工单类型', trigger: 'change' }
         ],
         ranks: [
-          { required: true, message: "请选择工单级别", trigger: "change" },
+          { required: true, message: '请选择工单级别', trigger: 'change' }
         ],
         taskName: [
-          { required: true, message: "请输入工单名称", trigger: "blur" },
+          { required: true, message: '请输入工单名称', trigger: 'blur' }
         ],
         content: [
-          { required: true, message: "请输入工单内容", trigger: "blur" },
+          { required: true, message: '请输入工单内容', trigger: 'blur' }
         ],
         planCompletionTime: [
-          { required: true, message: "请选择要求完成时间", trigger: "blur" },
+          { required: true, message: '请选择要求完成时间', trigger: 'blur' }
         ],
         receiver: [
-          { required: true, message: "请输入工单任务接收人", trigger: "blur" },
+          { required: true, message: '请输入工单任务接收人', trigger: 'blur' }
         ],
         attachList: [
-          { required: true, message: "请上传附件", trigger: "blur" },
-        ],
-      },
-    };
+          { required: true, message: '请上传附件', trigger: 'blur' }
+        ]
+      }
+    }
   },
   methods: {
-    onChose() {
-      this.visible = false;
+    onChose () {
+      this.visible = false
     },
     // 初始化
-    async init(id, item) {
-      this.id = id || 0;
+    async init (id, item) {
+      this.id = id || 0
       if (item) {
-        this.isModify = true;
-        item.name = item.fileName;
-        this.dataForm = item;
+        this.isModify = true
+        item.name = item.fileName
+        this.dataForm = item
       } else {
-        this.isModify = false;
+        this.isModify = false
         this.dataForm = {
-          recordId: Math.round(Math.random() * 1000000),
-        };
+          recordId: Math.round(Math.random() * 1000000)
+        }
       }
-      this.userList = [];
-      this.attachList = [];
-      this.visible = true;
+      this.userList = []
+      this.attachList = []
+      this.visible = true
       await getUserList().then(({ data }) => {
-        if (data && data.code === "200") {
-          this.userList = data.data.records;
+        if (data && data.code === '200') {
+          this.userList = data.data.records
         }
-      });
+      })
     },
     // 表单提交
-    dataFormSubmit() {
-      this.$refs["dataForm"].validate((valid) => {
+    dataFormSubmit () {
+      this.$refs['dataForm'].validate((valid) => {
         if (valid) {
-          this.visible = false;
+          this.visible = false
           this.dataForm.taskTypeName = this.taskTypeOption.find(
-            (t) => t.value == this.dataForm.taskType
-          ).label;
+            (t) => t.value === this.dataForm.taskType
+          ).label
           this.dataForm.rankTypeName = this.rankTypeOption.find(
-            (t) => t.value == this.dataForm.ranks
-          ).label;
+            (t) => t.value === this.dataForm.ranks
+          ).label
           this.dataForm.receiverName = this.userList.find(
-            (t) => t.userId == this.dataForm.receiver
-          ).name;
-          this.$emit("submit", this.dataForm);
+            (t) => t.userId === this.dataForm.receiver
+          ).name
+          this.$emit('submit', this.dataForm)
         }
-      });
+      })
     },
-    prodSelected(item) {
-      this.dataForm.productId = item.value;
-      this.dataForm.relatedProduct = item.label;
+    prodSelected (item) {
+      this.dataForm.productId = item.value
+      this.dataForm.relatedProduct = item.label
     },
-    uploadSuccess(fileList) {
-      this.attachList = fileList;
-    },
-  },
-};
+    uploadSuccess (fileList) {
+      this.attachList = fileList
+    }
+  }
+}
 </script>
 
 <style scoped></style>

+ 202 - 202
src/views/modules/works/work.vue

@@ -458,40 +458,40 @@ import {
   completeTask,
   checkTask,
   damageTask,
-  getTaskDetail,
-} from "@/api/task";
-import { workTypeMasterList } from "@/api/worktype";
-import templateList from "../warehouse/template-list";
-import PreviewComponent from "../common/preview-component";
-import UserComponent from "@/views/modules/common/user-component";
+  getTaskDetail
+} from '@/api/task'
+import { workTypeMasterList } from '@/api/worktype'
+import templateList from '../warehouse/template-list'
+import PreviewComponent from '../common/preview-component'
+import UserComponent from '@/views/modules/common/user-component'
 export default {
   components: { UserComponent, PreviewComponent, templateList },
-  name: "work",
+  name: 'work',
   computed: {
     userId: {
-      get() {
-        return this.$store.state.user.id;
-      },
-    },
+      get () {
+        return this.$store.state.user.id
+      }
+    }
   },
   watch: {
-    "dataForm.userId"(value) {
+    'dataForm.userId' (value) {
       this.opColVisible =
-        Number(this.dataForm.state) !== 3 && value === this.userId;
+        Number(this.dataForm.state) !== 3 && value === this.userId
     },
-    "dataForm.state"(value) {
+    'dataForm.state' (value) {
       this.opColVisible = this.dataForm.userId
         ? Number(value) !== 3 && this.dataForm.userId === this.userId
-        : Number(value) !== 3;
-    },
+        : Number(value) !== 3
+    }
   },
-  data() {
+  data () {
     return {
       previewVisible: false,
       addOrUpdateVisible: false,
       opColVisible: true,
       dataForm: {
-        state: "1",
+        state: '1'
       },
       dataList: [],
       pageIndex: 1,
@@ -501,17 +501,17 @@ export default {
       dataListSelections: [],
       optionsState: [
         {
-          code: "1",
-          value: "未开始",
+          code: '1',
+          value: '未开始'
         },
         {
-          code: "2",
-          value: "待操作",
+          code: '2',
+          value: '待操作'
         },
         {
-          code: "3",
-          value: "已完成",
-        },
+          code: '3',
+          value: '已完成'
+        }
       ],
       transferDialogFormVisible: false,
       transferDialogForm: {},
@@ -519,311 +519,311 @@ export default {
       finishDialogForm: {},
       finishDialogFormRules: {
         operationRecords: [
-          { required: true, message: "完成记录说明不能为空", trigger: "blur" },
-        ],
+          { required: true, message: '完成记录说明不能为空', trigger: 'blur' }
+        ]
       },
       transferUserList: [],
       transferDialogFormRules: {
         transferType: [
-          { required: true, message: "请选择移交类型", trigger: "blur" },
+          { required: true, message: '请选择移交类型', trigger: 'blur' }
         ],
         transferUserId: [
-          { required: true, message: "请选择移交用户", trigger: "blur" },
-        ],
+          { required: true, message: '请选择移交用户', trigger: 'blur' }
+        ]
       },
       checkDialogFormVisible: false,
       checkDialogForm: {
-        checkType: "",
-        operationRecords: "",
-        notes: "",
-        prodProductionRecordList: [],
+        checkType: '',
+        operationRecords: '',
+        notes: '',
+        prodProductionRecordList: []
       },
       checkDialogFormRules: {
         operationRecords: [
-          { required: true, message: "完成记录说明不能为空", trigger: "blur" },
+          { required: true, message: '完成记录说明不能为空', trigger: 'blur' }
         ],
-        checkType: [{ required: true, message: "请选择", trigger: "blur" }],
+        checkType: [{ required: true, message: '请选择', trigger: 'blur' }],
         measureRecord1: [
-          { required: true, message: "请输入", trigger: "blur" },
+          { required: true, message: '请输入', trigger: 'blur' }
         ],
         measureRecord2: [
-          { required: true, message: "请输入", trigger: "blur" },
-        ],
+          { required: true, message: '请输入', trigger: 'blur' }
+        ]
       },
       damageDialogFormVisible: false,
       damageDialogForm: {},
       damageDialogFormRules: {
-        damageReason: [{ required: true, message: "请输入", trigger: "blur" }],
+        damageReason: [{ required: true, message: '请输入', trigger: 'blur' }]
       },
       // 是否显示进度条列
       showProgress: true,
       inspectionMethodOptions: {
-        1: "游标卡尺",
-        2: "千分尺",
-        3: "高度尺",
-        4: "百分表",
-        5: "R规",
-        6: "环规、塞规",
-        7: "游标角度尺",
-        8: "三坐标",
-        9: "模具",
-        10: "样板",
-        11: "夹具",
-        12: "目测",
-        13: "组合测量",
-        14: "精密测量",
-        15: "敲击",
-        16: "测厚仪",
-        17: "其他",
-      },
-    };
+        1: '游标卡尺',
+        2: '千分尺',
+        3: '高度尺',
+        4: '百分表',
+        5: 'R规',
+        6: '环规、塞规',
+        7: '游标角度尺',
+        8: '三坐标',
+        9: '模具',
+        10: '样板',
+        11: '夹具',
+        12: '目测',
+        13: '组合测量',
+        14: '精密测量',
+        15: '敲击',
+        16: '测厚仪',
+        17: '其他'
+      }
+    }
   },
-  created() {
-    this.getDataList();
+  created () {
+    this.getDataList()
   },
   methods: {
     // 查询
-    queryData() {
-      this.pageIndex = 1;
-      this.showProgress = this.dataForm.state !== "2";
-      this.getDataList();
+    queryData () {
+      this.pageIndex = 1
+      this.showProgress = this.dataForm.state !== '2'
+      this.getDataList()
     },
     // 获取数据列表
-    getDataList() {
-      this.dataListLoading = true;
+    getDataList () {
+      this.dataListLoading = true
       let params = {
         current: this.pageIndex,
         size: this.pageSize,
         state: this.dataForm.state,
-        userId: this.dataForm.userId ? this.dataForm.userId : null,
-      };
+        userId: this.dataForm.userId ? this.dataForm.userId : null
+      }
       getTaskList(params).then(({ data }) => {
-        if (data && data.code === "200") {
-          this.dataList = data.data.records;
-          this.totalPage = Number(data.data.total);
+        if (data && data.code === '200') {
+          this.dataList = data.data.records
+          this.totalPage = Number(data.data.total)
         } else {
-          this.dataList = [];
-          this.totalPage = 0;
+          this.dataList = []
+          this.totalPage = 0
         }
-        this.dataListLoading = false;
-      });
+        this.dataListLoading = false
+      })
     },
     // 每页数
-    sizeChangeHandle(val) {
-      this.pageSize = val;
-      this.pageIndex = 1;
-      this.getDataList();
+    sizeChangeHandle (val) {
+      this.pageSize = val
+      this.pageIndex = 1
+      this.getDataList()
     },
     // 当前页
-    currentChangeHandle(val) {
-      this.pageIndex = val;
-      this.getDataList();
+    currentChangeHandle (val) {
+      this.pageIndex = val
+      this.getDataList()
     },
     // 多选
-    selectionChangeHandle(val) {
-      this.dataListSelections = val;
+    selectionChangeHandle (val) {
+      this.dataListSelections = val
     },
     // 开始
-    startTask(taskId) {
-      this.$confirm("是否开始任务?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
+    startTask (taskId) {
+      this.$confirm('是否开始任务?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       })
         .then(() => {
           startTask({ taskId }).then(({ data }) => {
-            if (data && data.code === "200") {
+            if (data && data.code === '200') {
               this.$message({
-                type: "success",
-                message: "操作成功!",
-              });
-              this.getDataList();
+                type: 'success',
+                message: '操作成功!'
+              })
+              this.getDataList()
             } else {
               this.$message({
-                type: "error",
-                message: data.msg,
-              });
+                type: 'error',
+                message: data.msg
+              })
             }
-          });
+          })
         })
         .catch(() => {
           this.$message({
-            type: "info",
-            message: "已取消",
-          });
-        });
+            type: 'info',
+            message: '已取消'
+          })
+        })
     },
     // 移交
-    transferTask(taskId, workTypeId) {
-      this.transferDialogFormVisible = true;
-      this.transferDialogForm.taskId = taskId;
+    transferTask (taskId, workTypeId) {
+      this.transferDialogFormVisible = true
+      this.transferDialogForm.taskId = taskId
 
       workTypeMasterList(workTypeId).then(({ data }) => {
-        if (data && data.code === "200") {
-          this.transferUserList = data.data;
+        if (data && data.code === '200') {
+          this.transferUserList = data.data
         }
-      });
+      })
     },
     // 确认移交
-    transferSubmit() {
-      this.$refs["transferDialogForm"].validate((valid) => {
+    transferSubmit () {
+      this.$refs['transferDialogForm'].validate((valid) => {
         if (valid) {
           transferTask(this.transferDialogForm).then(({ data }) => {
-            if (data && data.code === "200") {
+            if (data && data.code === '200') {
               this.$message({
-                type: "success",
-                message: "移交成功!",
-              });
-              this.transferDialogFormVisible = false;
-              this.getDataList();
+                type: 'success',
+                message: '移交成功!'
+              })
+              this.transferDialogFormVisible = false
+              this.getDataList()
             } else {
               this.$message({
-                type: "error",
-                message: data.msg,
-              });
+                type: 'error',
+                message: data.msg
+              })
             }
-          });
+          })
         }
-      });
+      })
     },
     // 完成
-    completeTask(taskId) {
-      this.finishDialogFormVisible = true;
-      this.finishDialogForm.taskId = taskId;
+    completeTask (taskId) {
+      this.finishDialogFormVisible = true
+      this.finishDialogForm.taskId = taskId
     },
     // 确认完成
-    finishSubmit() {
-      this.$refs["finishDialogForm"].validate((valid) => {
+    finishSubmit () {
+      this.$refs['finishDialogForm'].validate((valid) => {
         if (valid) {
-          let submitData = this.finishDialogForm;
+          let submitData = this.finishDialogForm
           completeTask(submitData).then(({ data }) => {
-            if (data && data.code === "200") {
+            if (data && data.code === '200') {
               this.$message({
-                type: "success",
-                message: "操作成功!",
-              });
-              this.finishDialogFormVisible = false;
-              this.getDataList();
+                type: 'success',
+                message: '操作成功!'
+              })
+              this.finishDialogFormVisible = false
+              this.getDataList()
             } else {
               this.$message({
-                type: "error",
-                message: data.msg,
-              });
+                type: 'error',
+                message: data.msg
+              })
             }
-          });
+          })
         }
-      });
+      })
     },
     // 检验
-    checkTask(taskId, checkType) {
-      this.checkDialogForm.taskId = taskId;
+    checkTask (taskId, checkType) {
+      this.checkDialogForm.taskId = taskId
 
       if (checkType === 1) {
         // 查询工艺详情
         getTaskDetail(this.checkDialogForm.taskId).then(({ data }) => {
-          if (data && data.code === "200") {
-            let list = data.data.prodProductionRequireList;
+          if (data && data.code === '200') {
+            let list = data.data.prodProductionRequireList
             if (list && list.length > 0) {
               list.map((item) => {
-                item.requireId = item.id;
-              });
+                item.requireId = item.id
+              })
             }
-            this.checkDialogForm.prodProductionRecordList = list;
+            this.checkDialogForm.prodProductionRecordList = list
           }
-        });
+        })
 
-        this.checkDialogForm.checkType = checkType;
-        this.passTask();
+        this.checkDialogForm.checkType = checkType
+        this.passTask()
       } else {
-        this.checkDialogForm.checkType = null;
-        this.refuseTask();
+        this.checkDialogForm.checkType = null
+        this.refuseTask()
       }
     },
     // 通过
-    passTask() {
-      this.checkDialogFormVisible = true;
+    passTask () {
+      this.checkDialogFormVisible = true
     },
     // 不通过
-    refuseTask() {
-      this.checkDialogFormVisible = true;
+    refuseTask () {
+      this.checkDialogFormVisible = true
     },
     // 确认检验
-    checkSubmit() {
-      this.$refs["checkDialogForm"].validate((valid) => {
+    checkSubmit () {
+      this.$refs['checkDialogForm'].validate((valid) => {
         if (valid) {
-          let submitData = this.checkDialogForm;
+          let submitData = this.checkDialogForm
           // console.log(submitData);
           checkTask(submitData).then(({ data }) => {
-            if (data && data.code === "200") {
+            if (data && data.code === '200') {
               this.$message({
-                type: "success",
-                message: "检验成功!",
-              });
-              this.checkDialogFormVisible = false;
-              this.getDataList();
+                type: 'success',
+                message: '检验成功!'
+              })
+              this.checkDialogFormVisible = false
+              this.getDataList()
             } else {
               this.$message({
-                type: "error",
-                message: data.msg,
-              });
+                type: 'error',
+                message: data.msg
+              })
             }
-          });
+          })
         }
-      });
+      })
     },
     // 操作损坏
-    damageTask(nodeId, productionId) {
-      this.damageDialogFormVisible = true;
-      this.damageDialogForm.nodeId = nodeId;
-      this.damageDialogForm.productionId = productionId;
+    damageTask (nodeId, productionId) {
+      this.damageDialogFormVisible = true
+      this.damageDialogForm.nodeId = nodeId
+      this.damageDialogForm.productionId = productionId
     },
     // 确认操作损坏
-    damageSubmit() {
-      this.$refs["damageDialogForm"].validate((valid) => {
+    damageSubmit () {
+      this.$refs['damageDialogForm'].validate((valid) => {
         if (valid) {
-          let submitData = this.damageDialogForm;
+          let submitData = this.damageDialogForm
           damageTask(submitData).then(({ data }) => {
-            if (data && data.code === "200") {
+            if (data && data.code === '200') {
               this.$message({
-                type: "success",
-                message: "操作成功!",
-              });
-              this.damageDialogFormVisible = false;
-              this.getDataList();
+                type: 'success',
+                message: '操作成功!'
+              })
+              this.damageDialogFormVisible = false
+              this.getDataList()
             } else {
               this.$message({
-                type: "error",
-                message: data.msg,
-              });
+                type: 'error',
+                message: data.msg
+              })
             }
-          });
+          })
         }
-      });
+      })
     },
     // 预览
-    previewFile(fileName, url) {
-      this.previewVisible = true;
+    previewFile (fileName, url) {
+      this.previewVisible = true
       this.$nextTick(() => {
-        this.$refs.preview.init(fileName, url);
-      });
+        this.$refs.preview.init(fileName, url)
+      })
     },
     // 计算进度百分比,返回0到100的整数
-    getPercentage(completeNum, totalNum) {
-      completeNum = completeNum == null ? 0 : parseInt(completeNum);
-      totalNum = totalNum == null ? 100 : parseInt(totalNum);
+    getPercentage (completeNum, totalNum) {
+      completeNum = completeNum == null ? 0 : parseInt(completeNum)
+      totalNum = totalNum == null ? 100 : parseInt(totalNum)
       if (totalNum === 0) {
-        return 100;
+        return 100
       }
 
-      return (completeNum / totalNum).toFixed(2) * 100;
+      return (completeNum / totalNum).toFixed(2) * 100
     },
     // 用户选择
-    userChanged(val) {
-      this.dataForm.userId = val;
-      this.getDataList();
-    },
-  },
-};
+    userChanged (val) {
+      this.dataForm.userId = val
+      this.getDataList()
+    }
+  }
+}
 </script>
 
 <style scoped></style>