chrislee 2 settimane fa
parent
commit
ae23141d90

+ 2 - 2
src/api/program.js

@@ -3,7 +3,7 @@ import request from '@/utils/httpRequest'
 // 数据程序管理列表
 export function getList (params) {
   return request({
-    url: request.adornUrl(`/biz-service/pro-program/list`),
+    url: request.adornUrl(`/biz-service/proProgram/list`),
     method: 'get',
     params: params
   })
@@ -12,7 +12,7 @@ export function getList (params) {
 // 数据程序管理详情
 export function getDetail (programId) {
   return request({
-    url: request.adornUrl(`/biz-service/pro-program/info/${programId}`),
+    url: request.adornUrl(`/biz-service/proProgram/info/${programId}`),
     method: 'get'
   })
 }

+ 8 - 8
src/components/work-flow-v2/home.vue

@@ -5,9 +5,9 @@
         <div class="nodes-wrap">
           <div class="left-tab-container">
             <div class="primary-tabs">
-              <div 
-                v-for="(tab, index) in nodeTypeList" 
-                @click="activePrimary = index; activeSecondary = 0" 
+              <div
+                v-for="(tab, index) in nodeTypeList"
+                @click="activePrimary = index; activeSecondary = 0"
                 :class="{ 'active': activePrimary === index }"
                 :key="tab.name"
               >
@@ -23,9 +23,9 @@
         <div class="nodes-wrap">
           <div class="left-tab-container">
             <div class="secondary-tabs" v-if="nodeTypeList!= null && nodeTypeList.length > 0">
-              <div 
+              <div
                 v-for="(subTab, subIndex) in nodeTypeList[activePrimary].children"
-                @click="activeSecondary = subIndex" 
+                @click="activeSecondary = subIndex"
                 :class="{ 'active': activeSecondary === subIndex }"
                 :key="subTab.typeId"
                 :draggable="true"
@@ -121,7 +121,7 @@ export default {
       type: Boolean,
       default: false
     },
-    //节点类型
+    // 节点类型
     nodeTypeList: {
       type: Array,
       default: () => []
@@ -180,7 +180,7 @@ export default {
     disabled (val) {
     },
     isEdit (val) {},
-    nodeTypeList(val){
+    nodeTypeList (val) {
       console.log('watch', val)
     }
   },
@@ -399,7 +399,7 @@ export default {
 
 /* 左侧列:固定宽度,垂直排列 */
 .primary-tabs {
-  width: 100%; 
+  width: 100%;
   display: flex;
   flex-direction: column; /* 垂直布局 */
   border-right: 1px solid #ddd;

+ 1 - 1
src/components/work-flow-v2/node-edit-normal.vue

@@ -171,7 +171,7 @@ export default {
           { required: true, message: '请选择', trigger: 'blur' }
         ],
         allowValues: [{ required: true, message: '请输入', trigger: 'blur' }],
-        isProgramme:[{ required: true, message: '请选择', trigger: 'change' }]
+        isProgramme: [{ required: true, message: '请选择', trigger: 'change' }]
       }
     }
   },

+ 2 - 2
src/components/work-flow-v2/node-item.vue

@@ -66,7 +66,7 @@ import nodeEdit from './node-edit'
 export default {
   name: 'node-item',
   components: {
-    nodeEdit,
+    nodeEdit
     // nodeAdd
   },
   props: {
@@ -183,7 +183,7 @@ export default {
           this.$emit('setNode', this.node.id, formData)
           this.dialog.visible = false
         })
-        .catch((e) => {console.log(e)})
+        .catch((e) => { console.log(e) })
     }
   }
 }

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

@@ -104,7 +104,7 @@ export default {
         newVal.forEach(t => { t.name = t.fileName })
       }
       this.fileList = newVal
-    },
+    }
     // 不注释,上传一个文件,列表会显示两个
     // value (newVal) {
     //   if (newVal && newVal instanceof Array) {

+ 157 - 157
src/views/modules/tech/ctafts-add-or-detail-v2.vue

@@ -92,25 +92,25 @@
 </template>
 
 <script>
-import { getInfo, getWorkType } from "@/api/crafts";
-import UploadComponent from "../common/upload-component";
-import WorkFlow from "@/components/work-flow-v2/home";
+import { getInfo, getWorkType } from '@/api/crafts'
+import UploadComponent from '../common/upload-component'
+import WorkFlow from '@/components/work-flow-v2/home'
 // import data from "@/components/work-flow/config/data.json";
-import { GenNonDuplicateID } from "@/components/work-flow/until";
-import CraftProductComponent from "@/views/modules/common/craft-product-component";
-import { getOrderByCode } from "@/api/sale";
-import _ from "lodash";
+import { GenNonDuplicateID } from '@/components/work-flow/until'
+import CraftProductComponent from '@/views/modules/common/craft-product-component'
+import { getOrderByCode } from '@/api/sale'
+import _ from 'lodash'
 export default {
-  name: "add-or-update",
+  name: 'add-or-update',
   components: { CraftProductComponent, UploadComponent, WorkFlow },
   computed: {
     orgId: {
-      get() {
-        return this.$store.state.user.orgId;
-      },
-    },
+      get () {
+        return this.$store.state.user.orgId
+      }
+    }
   },
-  data() {
+  data () {
     return {
       datas: {},
       visible: false,
@@ -122,19 +122,19 @@ export default {
       dataList: [],
       id: 0,
       dataForm: {
-        techName: "",
-        techVersion: "",
-        productId: "",
-        notes: "",
+        techName: '',
+        techVersion: '',
+        productId: '',
+        notes: ''
       },
-      previewPath: "",
-      previewName: "",
+      previewPath: '',
+      previewName: '',
       previewVisible: false,
       optionsProducts: [],
       optionLevel: [],
       workFlowData: {
         nodeList: [],
-        lineList: [],
+        lineList: []
       }, // 流程图数据
       // 工艺流程表格数据
       workFlowTableData: [],
@@ -144,210 +144,210 @@ export default {
       orderOptions: [],
       dataRule: {
         techName: [
-          { required: true, message: "工艺名称不能为空", trigger: "blur" },
+          { required: true, message: '工艺名称不能为空', trigger: 'blur' }
         ],
         techVersion: [
-          { required: true, message: "工艺版本不能为空", trigger: "blur" },
+          { required: true, message: '工艺版本不能为空', trigger: 'blur' }
         ],
         productId: [
-          { required: true, message: "物料不能为空", trigger: "change" },
-        ],
+          { required: true, message: '物料不能为空', trigger: 'change' }
+        ]
       },
       dataRule1: {
         name: [
-          { required: true, message: "节点名称不能为空", trigger: "blur" },
+          { required: true, message: '节点名称不能为空', trigger: 'blur' }
         ],
         type: [
-          { required: true, message: "节点类型不能为空", trigger: "change" },
+          { required: true, message: '节点类型不能为空', trigger: 'change' }
         ],
         workTypeId: [
-          { required: true, message: "工种不能为空", trigger: "change" },
-        ],
-      },
-    };
+          { required: true, message: '工种不能为空', trigger: 'change' }
+        ]
+      }
+    }
   },
-  created() {
-    this.initNode();
+  created () {
+    this.initNode()
     // 创建防抖函数(500ms延迟)
-    this.debouncedSearch = _.debounce(this.remoteMethod, 500);
+    this.debouncedSearch = _.debounce(this.remoteMethod, 500)
   },
-  beforeDestroy() {
+  beforeDestroy () {
     // 清除防抖定时器,避免内存泄漏
-    this.debouncedSearch.cancel();
+    this.debouncedSearch.cancel()
   },
-  mounted() {
-    this.initNode();
+  mounted () {
+    this.initNode()
   },
   methods: {
-    onChose() {
-      this.$emit("onChose");
+    onChose () {
+      this.$emit('onChose')
     },
-    initNode() {
+    initNode () {
       // this.workFlowData = data;
     },
-    resetWorkFlow() {
+    resetWorkFlow () {
       this.workFlowData = {
         nodeList: [],
-        lineList: [],
-      };
+        lineList: []
+      }
     },
-    async init(id, display, isEdit, isCopy, isResubmit) {
-      this.remoteMethod();
+    async init (id, display, isEdit, isCopy, isResubmit) {
+      this.remoteMethod()
 
-      this.fileList = [];
+      this.fileList = []
       this.dataForm = {
-        techName: "",
-        techVersion: "",
-        productId: "",
-        notes: "",
-      };
-      this.visible = true;
-      this.display = display;
-      this.isEdit = isEdit && !isCopy && !isResubmit;
-      this.isCopy = isCopy || false;
-      this.isResubmit = isResubmit || false;
+        techName: '',
+        techVersion: '',
+        productId: '',
+        notes: ''
+      }
+      this.visible = true
+      this.display = display
+      this.isEdit = isEdit && !isCopy && !isResubmit
+      this.isCopy = isCopy || false
+      this.isResubmit = isResubmit || false
 
       // 获取车间工种列表
       this.$http({
         url: this.$http.adornUrl(`/biz-service/pro-workshop/list`),
-        method: "get",
+        method: 'get',
         params: this.$http.adornParams({
           current: 1,
-          size: 1000,
-        }),
+          size: 1000
+        })
       }).then(({ data }) => {
-        if (data && data.code === "200") {
+        if (data && data.code === '200') {
           //   this.workTypeOptions = data.data.records;
-          this.workTypeOptions = [];
+          this.workTypeOptions = []
 
           for (var item of data.data.records) {
             let first = {
               name: item.name,
-              children: [],
-            };
+              children: []
+            }
 
             if (item.proWorkTypeList != null) {
-              first.children.push({ name: "结束", typeId: "", type: "end" });
+              first.children.push({ name: '结束', typeId: '', type: 'end' })
               for (var subItem of item.proWorkTypeList) {
                 let second = {
                   name: subItem.name,
-                  typeId: subItem.typeId,
-                };
+                  typeId: subItem.typeId
+                }
 
-                first.children.push(second);
+                first.children.push(second)
               }
             }
 
-            this.workTypeOptions.push(first);
+            this.workTypeOptions.push(first)
           }
 
-          console.log("workTypeOptions:", this.workTypeOptions);
+          console.log('workTypeOptions:', this.workTypeOptions)
         } else {
-          this.$message.error(data.msg);
+          this.$message.error(data.msg)
         }
-      });
+      })
 
-      if (!id) return;
+      if (!id) return
       await getInfo(id).then(async ({ data }) => {
-        if (data && data.code === "200") {
-          this.dataForm = data.data;
+        if (data && data.code === '200') {
+          this.dataForm = data.data
           // 附件
           if (data.data.attachList) {
             data.data.attachList.forEach((item) => {
               this.fileList.push({
                 name: item.fileName,
                 url: item.url,
-                id: item.url,
-              });
-            });
+                id: item.url
+              })
+            })
           }
           // 工艺流程
           this.workFlowData = {
             nodeList: data.data.nodeList,
-            lineList: data.data.lineList,
-          };
+            lineList: data.data.lineList
+          }
 
-          console.log("workFlowData", this.workFlowData);
+          console.log('workFlowData', this.workFlowData)
         }
-      });
+      })
     },
-    productIdChangeHandle(val) {
+    productIdChangeHandle (val) {
       if (val) {
-        let item = this.optionLevel.find((t) => t.productId === val);
-        this.dataForm.techName = item.productName;
+        let item = this.optionLevel.find((t) => t.productId === val)
+        this.dataForm.techName = item.productName
       }
     },
-    handleRemove(file, fileList) {
-      this.fileList = fileList;
+    handleRemove (file, fileList) {
+      this.fileList = fileList
     },
-    handleChange(file, fileList) {
-      this.fileList = fileList;
+    handleChange (file, fileList) {
+      this.fileList = fileList
     },
-    handleExceed(files, fileList) {
+    handleExceed (files, fileList) {
       this.$message.warning(
         `当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
           files.length + fileList.length
         } 个文件`
-      );
+      )
     },
-    remoteMethod(query) {
-      this.loading = true;
-      this.getOrderByCode(query);
+    remoteMethod (query) {
+      this.loading = true
+      this.getOrderByCode(query)
     },
-    getOrderByCode(orderCode) {
+    getOrderByCode (orderCode) {
       getOrderByCode(orderCode).then(({ data }) => {
-        this.loading = false;
+        this.loading = false
 
-        if (data && data.code === "200" && data.data) {
+        if (data && data.code === '200' && data.data) {
           this.orderOptions = data.data.map((item) => {
-            return { label: item.orderCode, value: item.orderId };
-          });
+            return { label: item.orderCode, value: item.orderId }
+          })
         }
-      });
+      })
     },
-    validateField(type) {
-      this.$refs.dataForm.validateField(type);
+    validateField (type) {
+      this.$refs.dataForm.validateField(type)
     },
     // 表单提交
-    dataFormSubmit() {
-      let flowData = this.$refs.workFlow.getFlowData();
+    dataFormSubmit () {
+      let flowData = this.$refs.workFlow.getFlowData()
       if (!flowData) {
-        this.$message.error("请先完成流程图!");
-        return;
+        this.$message.error('请先完成流程图!')
+        return
       }
 
-      this.$refs["dataForm"].validate((valid) => {
+      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
+              })
             }
           }
 
-          let url = `/biz-service/technology/submit`;
+          let url = `/biz-service/technology/submit`
           if (this.isResubmit) {
-            url = `/biz-service/technology/resubmit`;
+            url = `/biz-service/technology/resubmit`
           }
           if (this.isEdit && !this.isCopy) {
-            url = `/biz-service/technology/update`;
+            url = `/biz-service/technology/update`
           }
 
           if (this.isCopy) {
-            this.dataForm.id = 0;
-            this.dataForm.techId = null;
+            this.dataForm.id = 0
+            this.dataForm.techId = null
 
             if (flowData.nodeList != null && flowData.nodeList.length > 0) {
               for (let index = 0; index < flowData.nodeList.length; index++) {
-                let oldId = flowData.nodeList[index].id;
-                let newId = GenNonDuplicateID(8);
-                flowData.nodeList[index].techId = null;
-                flowData.nodeList[index].id = newId;
+                let oldId = flowData.nodeList[index].id
+                let newId = GenNonDuplicateID(8)
+                flowData.nodeList[index].techId = null
+                flowData.nodeList[index].id = newId
 
                 if (flowData.lineList != null && flowData.lineList.length > 0) {
                   for (
@@ -355,15 +355,15 @@ export default {
                     index < flowData.lineList.length;
                     index++
                   ) {
-                    flowData.lineList[index].techId = null;
-                    flowData.lineList[index].id = GenNonDuplicateID(8);
-                    let from = flowData.lineList[index].from;
-                    let to = flowData.lineList[index].to;
+                    flowData.lineList[index].techId = null
+                    flowData.lineList[index].id = GenNonDuplicateID(8)
+                    let from = flowData.lineList[index].from
+                    let to = flowData.lineList[index].to
                     if (from === oldId) {
-                      flowData.lineList[index].from = newId;
+                      flowData.lineList[index].from = newId
                     }
                     if (to === oldId) {
-                      flowData.lineList[index].to = newId;
+                      flowData.lineList[index].to = newId
                     }
                   }
                 }
@@ -373,58 +373,58 @@ export default {
 
           this.$http({
             url: this.$http.adornUrl(url),
-            method: "post",
+            method: 'post',
             data: this.$http.adornData({
               ...this.dataForm,
-              ...flowData,
-            }),
+              ...flowData
+            })
           }).then(({ data }) => {
-            if (data && data.code === "200") {
+            if (data && data.code === '200') {
               this.$message({
-                message: "操作成功",
-                type: "success",
+                message: '操作成功',
+                type: 'success',
                 duration: 1500,
                 onClose: () => {
-                  this.resetWorkFlow();
-                  this.onChose();
-                  this.$emit("refreshDataList");
-                },
-              });
+                  this.resetWorkFlow()
+                  this.onChose()
+                  this.$emit('refreshDataList')
+                }
+              })
             } else {
-              this.$message.error(data.msg);
+              this.$message.error(data.msg)
             }
-          });
+          })
         }
-      });
+      })
     },
-    uploadSuccess(fileList) {
-      this.fileList = fileList;
+    uploadSuccess (fileList) {
+      this.fileList = fileList
     },
     // 保存流程图
-    saveWorkFlow(workFlowData) {
-      console.log("save work flow.");
-      this.workFlowData = workFlowData;
+    saveWorkFlow (workFlowData) {
+      console.log('save work flow.')
+      this.workFlowData = workFlowData
     },
     // 流程图数据变更通知
-    workFlowDataChange() {},
-    handleClose() {
+    workFlowDataChange () {},
+    handleClose () {
       // this.visible = false
-      this.$emit("close");
+      this.$emit('close')
     },
-    async getWorkTypeOptions() {
-      this.workTypeOptions = [];
+    async getWorkTypeOptions () {
+      this.workTypeOptions = []
       await getWorkType().then(({ data }) => {
-        if (data && data.code === "200") {
-          this.workTypeOptions = data.data;
+        if (data && data.code === '200') {
+          this.workTypeOptions = data.data
           // console.log(data.data)
         }
-      });
+      })
     },
-    prodSelected(item) {
-      this.dataForm.productId = item.value;
-    },
-  },
-};
+    prodSelected (item) {
+      this.dataForm.productId = item.value
+    }
+  }
+}
 </script>
 
 <style lang="less" scoped>

+ 54 - 87
src/views/modules/tech/program-add-or-update.vue

@@ -1,94 +1,66 @@
 <template>
   <div>
     <div class="my-title">{{ !id ? "新增" : "修改" }}</div>
-    <el-form
-      :model="dataForm"
-      :rules="dataRule"
-      ref="dataForm"
-      label-width="180px"
-    >
+    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="180px">
       <el-row>
         <el-col :span="6">
-          <el-form-item label="物料名称" prop="productId">
-            <product-component v-model="dataForm.productId" :product-id="dataForm.productId" @productSelected="prodSelected"/>
+          <el-form-item label="项目名称" prop="projectName">
+            <el-input v-model="dataForm.projectName" placeholder="请输入项目名称"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="6">
-          <el-form-item label="程序编码" prop="programCode">
-            <el-input
-              v-model="dataForm.programCode"
-              placeholder="请输入"
-            ></el-input>
+          <el-form-item label="任务号" prop="orderCode">
+            <el-input v-model="dataForm.orderCode" placeholder="请输入任务号"></el-input>
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row>
-        <el-col :span="12">
-          <el-form-item label="程序说明" prop="programInstructions">
-            <el-input
-              v-model="dataForm.programInstructions"
-              placeholder="请输入"
-              type="textarea"
-            ></el-input>
+        <el-col :span="6">
+          <el-form-item label="图号" prop="drawingNumber">
+            <el-input v-model="dataForm.drawingNumber" placeholder="请输入图号"></el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="12">
-          <el-form-item label="备注说明" prop="remark">
-            <el-input
-              v-model="dataForm.remark"
-              placeholder="请输入"
-              type="textarea"
-            ></el-input>
+        <el-col :span="6">
+          <el-form-item label="物料名称" prop="productId">
+            <product-component v-model="dataForm.productId" :product-id="dataForm.productId"
+              @productSelected="prodSelected" />
           </el-form-item>
         </el-col>
       </el-row>
       <el-row>
-        <el-col :span="8">
-            <el-form-item label="程序包" prop="cxbList">
-            <upload-component
-              :display="false"
-              :displayStar="false"
-              :accept="'*'"
-              v-model="dataForm.cxbList"
-              @uploadSuccess="uploadSuccess"
-            />
+        <el-col :span="6">
+          <el-form-item label="数量" prop="planCnt">
+            <el-input-number v-model="dataForm.planCnt" :min="1" placeholder="请输入数量"></el-input-number>
           </el-form-item>
         </el-col>
-        <el-col :span="8" :offset="4">
-            <el-form-item label="数控加工程序单" prop="skjgList">
-            <upload-component
-              :display="false"
-              :displayStar="false"
-              :accept="'*'"
-              v-model="dataForm.skjgList"
-              @uploadSuccess="uploadSuccess"
-              templateCode="bom_program_skcxd"
-            />
+        <el-col :span="6">
+          <el-form-item label="合同交期" prop="deliveryDate">
+            <el-date-picker v-model="dataForm.deliveryDate" type="date" placeholder="请选择合同交期" format="yyyy-MM-dd"
+              value-format="yyyy-MM-dd"></el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="责任人" prop="responsibilityPerson">
+            <user-component v-model="dataForm.responsibilityPerson" />
           </el-form-item>
         </el-col>
       </el-row>
       <el-row>
         <el-col :span="8">
-            <el-form-item label="防真验证情况记录表" prop="fzyzList">
+          <el-form-item label="技术协议" prop="attachList1">
             <upload-component
-              :display="false"
               :displayStar="false"
               :accept="'*'"
-              v-model="dataForm.fzyzList"
-              @uploadSuccess="uploadSuccess"
-              templateCode="bom_program_fzyzqkjlb"
+              :file-obj-list="fileList1"
+              @uploadSuccess="uploadSuccess1"
             />
           </el-form-item>
         </el-col>
         <el-col :span="8" :offset="4">
-            <el-form-item label="数控加工程序试切鉴定表" prop="cxsqList">
+          <el-form-item label="技术文件" prop="attachList2">
             <upload-component
-              :display="false"
               :displayStar="false"
               :accept="'*'"
-              v-model="dataForm.cxsqList"
-              @uploadSuccess="uploadSuccess"
-              templateCode="bom_program_skjgcxsqjdb"
+              :file-obj-list="fileList2"
+              @uploadSuccess="uploadSuccess2"
             />
           </el-form-item>
         </el-col>
@@ -105,45 +77,36 @@
 import { getMaterialList } from '@/api/material'
 import uploadComponent from '../common/upload-component-v2'
 import ProductComponent from '@/views/modules/common/product-component'
+import UserComponent from '@/views/modules/common/user-component'
 export default {
   name: 'program-add-or-update',
-  components: {ProductComponent, uploadComponent},
+  components: { ProductComponent, uploadComponent, UserComponent },
   data () {
     return {
       id: 0,
       dataForm: {},
       materialList: [],
+      fileList1: [],
+      fileList2: [],
+      optionsState: [
+        { value: '1', label: '待处理' },
+        { value: '2', label: '已处理' }
+      ],
       dataRule: {
-        productName: [{required: true, message: '请选择物料名称', trigger: 'change'}],
-        programCode: [{required: true, message: '请输入程序编码', trigger: 'blur'}],
-        programInstructions: [{required: true, message: '请输入程序说明', trigger: 'blur'}],
-        cxbList: [{required: true, message: '请上传文件', trigger: 'blur'}],
-        skjgList: [{required: true, message: '请上传文件', trigger: 'blur'}],
-        fzyzList: [{required: true, message: '请上传文件', trigger: 'blur'}],
-        cxsqList: [{required: true, message: '请上传文件', trigger: 'blur'}]
+        projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
+        orderCode: [{ required: true, message: '请输入任务号', trigger: 'blur' }],
+        productName: [{ required: true, message: '请选择物料名称', trigger: 'change' }],
+        planCnt: [{ required: true, message: '请输入数量', trigger: 'blur' }],
+        deliveryDate: [{ required: true, message: '请选择合同交期', trigger: 'change' }],
+        responsibilityPerson: [{ required: true, message: '请选择责任人', trigger: 'change' }]
       }
     }
   },
   created () {
   },
   methods: {
-    init (id, item) {
+    init (id) {
       this.id = id || 0
-      if (item) {
-        if (item.cxbList) {
-          item.cxbList.forEach(t => { t.name = t.fileName })
-        }
-        if (item.cxsqList) {
-          item.cxsqList.forEach(t => { t.name = t.fileName })
-        }
-        if (item.fzyzList) {
-          item.fzyzList.forEach(t => { t.name = t.fileName })
-        }
-        if (item.skjgList) {
-          item.skjgList.forEach(t => { t.name = t.fileName })
-        }
-        this.dataForm = {...item}
-      }
       this.getMaterialList()
     },
     onChose () {
@@ -161,8 +124,8 @@ export default {
         if (valid) {
           this.$http({
             url: !this.id
-              ? this.$http.adornUrl(`/biz-service/pro-program/save`)
-              : this.$http.adornUrl(`/biz-service/pro-program/update`),
+              ? this.$http.adornUrl(`/biz-service/proProgram/save`)
+              : this.$http.adornUrl(`/biz-service/proProgram/update`),
             method: 'post',
             data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId })
           }).then(({ data }) => {
@@ -183,7 +146,12 @@ export default {
         }
       })
     },
-    uploadSuccess () {},
+    uploadSuccess1 (fileList) {
+      this.fileList1 = fileList
+    },
+    uploadSuccess2 (fileList) {
+      this.fileList2 = fileList
+    },
     prodSelected (item) {
       this.dataForm.productId = item.value
       this.dataForm.materialName = item.label
@@ -192,5 +160,4 @@ export default {
 }
 </script>
 
-<style>
-</style>
+<style></style>

+ 47 - 44
src/views/modules/tech/program-detail.vue

@@ -3,49 +3,39 @@
     <div class="my-title">查看</div>
     <div>
       <e-desc title="基本信息" column="3">
-        <e-desc-item label="方案编码">{{ dataForm.programId }}</e-desc-item>
-        <e-desc-item label="物料名称">{{ dataForm.productName }} </e-desc-item>
-        <e-desc-item label="程序编号">{{dataForm.programCode }} </e-desc-item>
-
-        <e-desc-item label="程序说明" span="3">{{ dataForm.programInstructions }}</e-desc-item>
-        <e-desc-item label="备注" span="3">{{ dataForm.remark }}</e-desc-item>
-      </e-desc>
-      <e-desc title="程序包">
-        <upload-component
-          :display="true"
-          :display-title="false"
-          :accept="'*'"
-          :value="dataForm.cxbList"
-        />
-      </e-desc>
-      <e-desc title="防真验证情况记录表">
-        <upload-component
-          :display="true"
-          :display-title="false"
-          :accept="'*'"
-          :value="dataForm.fzyzList"
-        />
+        <e-desc-item label="项目名称">{{ dataForm.projectName }}</e-desc-item>
+        <e-desc-item label="任务号">{{ dataForm.orderCode }}</e-desc-item>
+        <e-desc-item label="图号">{{ dataForm.mapNumber }}</e-desc-item>
+        <e-desc-item label="物料名称">{{ dataForm.productName }}</e-desc-item>
+        <e-desc-item label="数量">{{ dataForm.planCnt }}</e-desc-item>
+        <e-desc-item label="状态">{{dataForm.state ? optionsStates.find(item => item.value ===
+          dataForm.state).label : ''}}</e-desc-item>
+        <e-desc-item label="合同交期">{{ dataForm.deliveryDate }}</e-desc-item>
+        <e-desc-item label="责任人">{{ dataForm.responsibilityPerson }}</e-desc-item>
       </e-desc>
-      <e-desc title="数控加工程序试切鉴定表">
-        <upload-component
-          :display="true"
-          :display-title="false"
-          :accept="'*'"
-          :value="dataForm.cxsqList"
-        />
+      <e-desc title="技术协议">
+        <e-desc-item v-if="dataForm.attachList1" label="技术协议" span="3">
+          <div v-for="(item, index) in dataForm.attachList1" style="display: inline">
+            <span v-if="index > 0">,</span>
+            <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{
+              item.fileName }}</a>
+          </div>
+        </e-desc-item>
       </e-desc>
-      <e-desc title="数控加工程序单">
-        <upload-component
-          :display="true"
-          :display-title="false"
-          :accept="'*'"
-          :value="dataForm.skjgList"
-        />
+      <e-desc title="技术文件">
+        <e-desc-item v-if="dataForm.attachList2" label="技术文件" span="3">
+          <div v-for="(item, index) in dataForm.attachList2" style="display: inline">
+            <span v-if="index > 0">,</span>
+            <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{
+              item.fileName }}</a>
+          </div>
+        </e-desc-item>
       </e-desc>
     </div>
     <span slot="footer" class="dialog-footer">
       <el-button @click="onChose">返回</el-button>
     </span>
+    <preview-component ref="preview" v-if="previewVisible" @onChose="previewVisible = false" />
   </div>
 </template>
 
@@ -53,17 +43,24 @@
 import EDesc from '../common/e-desc'
 import EDescItem from '../common/e-desc-item'
 import uploadComponent from '../common/upload-component-v2'
-import {getDetail} from '@/api/program'
+import { getDetail } from '@/api/program'
+import PreviewComponent from '@/views/modules/common/preview-component'
 export default {
   name: 'tech-program-detail',
-  components: { EDesc, EDescItem, uploadComponent },
+  components: { EDesc, EDescItem, uploadComponent, PreviewComponent },
   data () {
     return {
       id: '',
       dataForm: {
-        cxbList: [],
-        cxsqList: []
-      }
+        attachList1: [],
+        attachList2: []
+      },
+      // 状态列表数据
+      optionsStates: [
+        { value: '1', label: '待处理' },
+        { value: '2', label: '已处理' }
+      ],
+      previewVisible: false
     }
   },
   methods: {
@@ -75,15 +72,21 @@ export default {
       this.$emit('onChose')
     },
     getDetail () {
-      getDetail(this.id).then(({data}) => {
+      getDetail(this.id).then(({ data }) => {
         if (data && data.code === '200') {
           this.dataForm = data.data
         }
       })
+    },
+    // 预览
+    previewFile (fileName, url) {
+      this.previewVisible = true
+      this.$nextTick(() => {
+        this.$refs.preview.init(fileName, url)
+      })
     }
   }
 }
 </script>
 
-<style>
-</style>
+<style></style>

+ 68 - 201
src/views/modules/tech/program.vue

@@ -2,224 +2,85 @@
 <template>
   <div>
     <template v-if="!addOrUpdateVisible && !detailVisible">
-      <el-form
-        :inline="true"
-        :model="dataForm"
-        @keyup.enter.native="queryData()"
-      >
-        <el-form-item label="程序编号">
-          <el-input
-            v-model="dataForm.programCode"
-            placeholder="请输入程序编号"
-            clearable
-          />
+      <el-form :inline="true" :model="dataForm" label-width="80px" @keyup.enter.native="queryData()">
+        <el-form-item label="项目名称">
+          <el-input v-model="dataForm.projectName" placeholder="请输入项目名称" clearable />
         </el-form-item>
-        <el-form-item label="物料名称">
-          <el-select
-            v-model="dataForm.productName"
-            filterable
-            remote
-            clearable
-            placeholder="请选择"
-          >
-            <el-option
-              v-for="item in materialList"
-              :key="item.productId"
-              :label="item.productName"
-              :value="item.productName"
-            >
-            </el-option>
+        <el-form-item label="任务号">
+          <el-input v-model="dataForm.orderCode" placeholder="请输入任务号" clearable />
+        </el-form-item>
+        <el-form-item label="责任人">
+          <user-component v-model="dataForm.responsibilityPerson" />
+        </el-form-item>
+        <el-form-item label="状态">
+          <el-select v-model="dataForm.state" placeholder="请选择状态" clearable>
+            <el-option v-for="item in optionsState" :key="item.value" :label="item.label" :value="item.value" />
           </el-select>
         </el-form-item>
-        <el-form-item label="创建日期">
-          <el-date-picker
-            v-model="dataForm.startTime"
-            value-format="yyyy-MM-dd"
-            type="date"
-            style="width: 100%"
-          >
-          </el-date-picker>
+        <el-form-item label="物料名称">
+          <el-input v-model="dataForm.productName" placeholder="请输入物料名称" clearable />
         </el-form-item>
         <el-form-item>
           <el-button @click="queryData()">查询</el-button>
-          <el-button
-            v-if="isAuth('pro:program:save')"
-            type="primary"
-            @click="addOrUpdateHandle(0, false)"
-            >新建</el-button
-          >
+          <el-button v-if="isAuth('pro:program:save')" type="primary" @click="addOrUpdateHandle(0)">新建</el-button>
         </el-form-item>
       </el-form>
       <el-table :data="dataList" border v-loading="dataListLoading" style="width:100%">
         <el-table-column label="序号" type="index" width="50" align="center"></el-table-column>
-        <el-table-column
-            prop="programCode"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="程序编号"
-        >
+        <el-table-column prop="projectName" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="项目名称">
         </el-table-column>
-        <el-table-column
-            prop="programInstructions"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="程序说明"
-        >
+        <el-table-column prop="orderCode" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="任务号">
         </el-table-column>
-        <el-table-column
-            prop="productName"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="物料名称"
-        >
+        <el-table-column prop="mapNumber" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="图号">
         </el-table-column>
-        <el-table-column
-            prop="cxbList"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="程序包"
-        >
-            <template slot-scope="scope">
-                <el-button
-                  :disabled="
-                    !scope.row.cxbList || scope.row.cxbList.length === 0
-                  "
-                  type="text"
-                  size="small"
-                  @click="attachDetails(scope.row.cxbList)"
-                  >查看</el-button
-                >
-            </template>
+        <el-table-column prop="productName" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="物料名称">
         </el-table-column>
-        <el-table-column
-            prop="fzyzList"
-            header-align="center"
-            align="center"
-            min-width="120"
-            :show-tooltip-when-overflow="true"
-            label="防真验证情况记录表"
-        >
-            <template slot-scope="scope">
-                <el-button
-                  :disabled="
-                    !scope.row.fzyzList || scope.row.fzyzList.length === 0
-                  "
-                  type="text"
-                  size="small"
-                  @click="attachDetails(scope.row.fzyzList)"
-                  >查看</el-button
-                >
-            </template>
+        <el-table-column prop="planCnt" header-align="center" align="center" min-width="80"
+          :show-tooltip-when-overflow="true" label="数量">
         </el-table-column>
-        <el-table-column
-            prop="cxsqList"
-            header-align="center"
-            align="center"
-            min-width="120"
-            :show-tooltip-when-overflow="true"
-            label="数控加工程序试切鉴定表"
-        >
-            <template slot-scope="scope">
-                <el-button
-                  :disabled="
-                    !scope.row.cxsqList || scope.row.cxsqList.length === 0
-                  "
-                  type="text"
-                  size="small"
-                  @click="attachDetails(scope.row.cxsqList)"
-                  >查看</el-button
-                >
-            </template>
+        <el-table-column prop="state" header-align="center" align="center" min-width="80" fixed="right" label="状态">
+          <template slot-scope="scope">
+            <span>{{(optionsState.find(t => t.value === scope.row.state.toString())).label}}</span>
+          </template>
         </el-table-column>
-        <el-table-column
-            prop="skjgList"
-            header-align="center"
-            align="center"
-            min-width="120"
-            :show-tooltip-when-overflow="true"
-            label="数控加工程序单"
-        >
-            <template slot-scope="scope">
-                <el-button
-                  :disabled="
-                    !scope.row.skjgList || scope.row.skjgList.length === 0
-                  "
-                  type="text"
-                  size="small"
-                  @click="attachDetails(scope.row.skjgList)"
-                  >查看</el-button
-                >
-            </template>
+        <el-table-column prop="attachList1" header-align="center" align="center" min-width="100" label="技术协议">
+          <template slot-scope="scope">
+            <el-button :disabled="!scope.row.attachList1 || scope.row.attachList1.length === 0
+              " type="text" size="small" @click="attachDetails(scope.row.attachList1)">查看</el-button>
+          </template>
         </el-table-column>
-        <el-table-column
-            prop="remark"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="备注"
-        >
+        <el-table-column prop="attachList2" header-align="center" align="center" min-width="100" label="技术文件">
+          <template slot-scope="scope">
+            <el-button :disabled="!scope.row.attachList2 || scope.row.attachList2.length === 0
+              " type="text" size="small" @click="attachDetails(scope.row.attachList2)">查看</el-button>
+          </template>
         </el-table-column>
-        <el-table-column
-            prop="createTime"
-            header-align="center"
-            align="center"
-            min-width="180"
-            :show-tooltip-when-overflow="true"
-            label="创建时间"
-        >
+        <el-table-column prop="deliveryDate" header-align="center" align="center" min-width="160"
+          :show-tooltip-when-overflow="true" label="合同交期">
         </el-table-column>
-        <el-table-column
-            prop="creatorName"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="创建人"
-        >
+        <el-table-column prop="responsibilityPerson" header-align="center" align="center" min-width="100"
+          :show-tooltip-when-overflow="true" label="责任人">
         </el-table-column>
-        <el-table-column
-            fixed="right"
-            header-align="center"
-            align="center"
-            width="180"
-            label="操作"
-        >
-            <template slot-scope="scope">
-                <el-button
-                    type="text"
-                    size="small"
-                    @click="showDetail(scope.row.programId)"
-                    >查看</el-button>
-                <el-button
-                    v-if="isAuth('pro:program:update')"
-                    type="text"
-                    size="small"
-                    @click="addOrUpdateHandle(scope.row.taskId, scope.row)"
-                    >编辑</el-button>
-            </template>
+        <el-table-column fixed="right" header-align="center" align="center" width="90" label="操作">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="showDetail(scope.row.programId)">查看</el-button>
+            <el-button v-if="isAuth('pro:program:update')" type="text" size="small"
+              @click="addOrUpdateHandle(scope.row.programId)">编辑</el-button>
+          </template>
         </el-table-column>
       </el-table>
-      <el-pagination
-        @size-change="sizeChangeHandle"
-        @current-change="currentChangeHandle"
-        :current-page="pageIndex"
-        :page-sizes="[10, 20, 50, 100]"
-        :page-size="pageSize"
-        :total="totalPage"
+      <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
+        :page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
         layout="total, sizes, prev, pager, next, jumper">
       </el-pagination>
     </template>
     <attach-detail-dialog ref="attachDetail" />
-    <program-add-or-update ref="addOrUpdate" v-if="addOrUpdateVisible" @onChose="onChose" @refreshDataList="getDataList"></program-add-or-update>
+    <program-add-or-update ref="addOrUpdate" v-if="addOrUpdateVisible" @onChose="onChose"
+      @refreshDataList="getDataList"></program-add-or-update>
     <program-detail ref="detail" v-if="detailVisible" @onChose="onChose"></program-detail>
   </div>
 </template>
@@ -230,20 +91,26 @@ import { getList } from '@/api/program'
 import AttachDetailDialog from '../common/attach-detail-dialog'
 import ProgramAddOrUpdate from './program-add-or-update'
 import ProgramDetail from './program-detail'
+import { isAuth } from '@/utils'
+import UserComponent from '@/views/modules/common/user-component.vue'
 export default {
   name: 'program',
-  components: {AttachDetailDialog, ProgramAddOrUpdate, ProgramDetail},
+  components: { UserComponent, AttachDetailDialog, ProgramAddOrUpdate, ProgramDetail },
   data () {
     return {
       addOrUpdateVisible: false,
       detailVisible: false,
       dataForm: {},
       dataList: [],
-      materialList: [],
       pageIndex: 1,
       pageSize: 10,
       totalPage: 0,
-      dataListLoading: false
+      dataListLoading: false,
+      // 状态列表数据
+      optionsState: [
+        { value: '1', label: '待处理' },
+        { value: '2', label: '已处理' }
+      ]
     }
   },
   created () {
@@ -251,6 +118,7 @@ export default {
     this.getProductList()
   },
   methods: {
+    isAuth,
     onChose () {
       this.addOrUpdateVisible = false
       this.detailVisible = false
@@ -277,16 +145,16 @@ export default {
         size: this.pageSize,
         ...this.dataForm
       }
-      getList(param).then(({data}) => {
+      getList(param).then(({ data }) => {
         if (data && data.code === '200') {
           this.dataList = data.data.records
         }
       })
     },
-    addOrUpdateHandle (id, item) {
+    addOrUpdateHandle (id) {
       this.addOrUpdateVisible = true
       this.$nextTick(() => {
-        this.$refs.addOrUpdate.init(id, item)
+        this.$refs.addOrUpdate.init(id)
       })
     },
     showDetail (id) {
@@ -304,7 +172,7 @@ export default {
       this.pageIndex = 1
       this.getDataList()
     },
-      // 当前页
+    // 当前页
     currentChangeHandle (val) {
       this.pageIndex = val
       this.getDataList()
@@ -313,5 +181,4 @@ export default {
 }
 </script>
 
-<style scoped>
-</style>
+<style scoped></style>

+ 1 - 1
src/views/modules/tech/project-tech-submit.vue

@@ -276,7 +276,7 @@ export default {
         }
       })
     },
-    handleCrafts(techId){
+    handleCrafts (techId) {
       this.$emit('showCraftsAddOrDetail', techId)
     }
   }

+ 3 - 3
src/views/modules/tech/project-tech.vue

@@ -157,7 +157,7 @@
         this.submitVisible = false
         this.craftsAddOrDetailVisible = false
       },
-      showCraftsAddOrDetail(techId) {
+      showCraftsAddOrDetail (techId) {
         this.detailVisible = false
         this.assignVisible = false
         this.noticeChangeVisible = false
@@ -169,7 +169,7 @@
           this.$refs.craftsAddOrDetail.init(techId, false, techId !== 0, false, false)
         })
       },
-      onCloseCraftsAddOrDetail(){
+      onCloseCraftsAddOrDetail () {
         this.craftsAddOrDetailVisible = false
         this.submitHandle(this.lastSubmitItem, false)
       },
@@ -223,7 +223,7 @@
           this.$refs.assign.init(item)
         })
       },
-      submitHandle(item, readonly) {
+      submitHandle (item, readonly) {
         this.lastSubmitItem = item
         this.submitVisible = true
         this.$nextTick(() => {