Browse Source

调整语法规范

liqianyi 2 years ago
parent
commit
61a3f7ecf5
3 changed files with 223 additions and 223 deletions
  1. 1 1
      src/api/task.js
  2. 19 19
      src/views/modules/check/fc-detail.vue
  3. 203 203
      src/views/modules/works/work.vue

+ 1 - 1
src/api/task.js

@@ -77,4 +77,4 @@ export function getTaskDetail (taskId) {
     url: request.adornUrl(`/biz-service/WorkController/info/${taskId}`),
     method: 'get'
   })
-}
+}

+ 19 - 19
src/views/modules/check/fc-detail.vue

@@ -47,7 +47,7 @@
             </el-table-column>
           </el-table>
         </div>
-        
+
         <span slot="footer" class="dialog-footer">
           <el-button @click="onChose">取消</el-button>
         </span>
@@ -84,24 +84,24 @@
           }
         ],
         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: '其他'
+        }
       }
     },
     methods: {

+ 203 - 203
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>