Bläddra i källkod

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

5 år sedan
förälder
incheckning
6925f8faa7
3 ändrade filer med 108 tillägg och 10 borttagningar
  1. 3 0
      ys_vue/src/port.js
  2. 71 7
      ys_vue/src/views/mold/moldDetail.vue
  3. 34 3
      ys_vue/src/views/mold/moldList.vue

+ 3 - 0
ys_vue/src/port.js

@@ -39,6 +39,8 @@ export default {
         addMold: '/mould/addOrUpdate', //添加/修改模具设备
         molds: '/mould/list', //模具列表
         modelList: '/mould/modelList', //给项目分配模具获取该公司下的模具列表
+        delMold: '/mould/delMoule', //删除模具
+
         moldDetail: '/mould/detail', //模具详情
         moldFileList: '/mouldfile/list', //获取模具文档
         moldFileListAll: '/mouldfile/allList', //获取全部模具文档
@@ -47,6 +49,7 @@ export default {
         moldFileDowloadList: '/mouldfile/fileList', //获取模具文档下载列表
         moldFileDowloadFile: '/mouldfile/downloadfileList', //批量下载
         moldFileCheck: '/mouldfile/check', //审批模具文档 
+
         moldFileDelete: '/mouldfile/delFile', //项目文档的删除
         moldOperationList: '/mouldoperationdynamics/list', //项目文档的删除
     },

+ 71 - 7
ys_vue/src/views/mold/moldDetail.vue

@@ -65,10 +65,19 @@
             </el-col>
             <el-col :span="24" class="detail">
                 生产方:
-                <span class="info" v-for="(item, index) in customCompany">
+                <!-- <span class="info" v-for="(item, index) in customCompany">
                     {{item.companyName}}
                     <span v-if="index != customCompany.length-1">、</span>
-                </span>
+                </span> -->
+                <span class="info">{{moldDetail.produceCompany}}</span>
+            </el-col>
+            <el-col :span="24" class="detail">
+                生产方地址:
+                <!-- <span class="info" v-for="(item, index) in customCompany">
+                    {{item.companyName}}
+                    <span v-if="index != customCompany.length-1">、</span>
+                </span> -->
+                <span class="info">{{moldDetail.area}}</span>
             </el-col>
         </el-col>
 
@@ -380,14 +389,27 @@
                 <el-form-item label="模具名称" prop="modelName">
                     <el-input v-model="editForm.modelName" autocomplete="off" placeholder="请输入模具名称"></el-input>
                 </el-form-item>
+                <el-form-item label="模具编号" prop="modelNo">
+                    <el-input v-model="editForm.modelNo" autocomplete="off" placeholder="请输入模具编号"></el-input>
+                </el-form-item>
+                <el-form-item label="云模盒编号" prop="equipmentId">
+                    <el-select v-model="editForm.equipmentId" clearable filterable placeholder="请选择云模盒编号" style="width:202px">
+                        <el-option v-for="item in boxes" :key="item.id" :label="item.equipmentNo" :value="item.id"></el-option>
+                    </el-select>
+                </el-form-item>
                 <el-form-item label="初始模次">
-                <el-input v-model="editForm.initialModulus" autocomplete="off" placeholder="请输入初始模次"></el-input>
+                    <el-input v-model="editForm.initialModulus" autocomplete="off" placeholder="请输入初始模次"></el-input>
                 </el-form-item>
                 <el-form-item label="模次寿命">
-                <el-input v-model="editForm.settingLife" autocomplete="off" placeholder="请输入模次寿命"></el-input>
+                    <el-input v-model="editForm.settingLife" autocomplete="off" placeholder="请输入模次寿命"></el-input>
                 </el-form-item>
                 <el-form-item label="RIFD码">
-                <el-input v-model="editForm.rfid" autocomplete="off" placeholder="请输入RIFD码"></el-input>
+                    <el-input v-model="editForm.rfid" autocomplete="off" placeholder="请输入RIFD码"></el-input>
+                </el-form-item>
+                <el-form-item label="所属生产方" v-if="moldDetail.projectId != null">
+                    <el-select v-model="editForm.produceCompanyId" clearable filterable placeholder="请选择所属生产方" style="width:202px">
+                        <el-option v-for="item in customCompany" :key="item.companyId" :label="item.companyName" :value="item.companyId"></el-option>
+                    </el-select>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
@@ -407,10 +429,21 @@
                 user: JSON.parse(sessionStorage.getItem("user")),
                 moldDetail: {},
                 customCompany: [],
+                boxes: [],
 
                 formRules: {
+                    modelNo: [
+                        { required: true, message: "请输入模具编号", trigger: "blur" }
+                    ],
                     modelName: [
-                    { required: true, message: "请输入模具名称", trigger: "blur" }
+                        { required: true, message: "请输入模具名称", trigger: "blur" }
+                    ],
+                    equipmentId: [
+                        {
+                            required: true,
+                            message: "请选择云模盒编号",
+                            trigger: ["blur", "change"]
+                        }
                     ]
                 },
 
@@ -454,9 +487,12 @@
                 editForm: {
                     id: 0,
                     modelName: "",
+                    modelNo: "",
+                    equipmentId: "",
                     initialModulus: "",
                     settingLife: "",
                     rfid: "",
+                    produceCompanyId: "",
                     flag: 1
                 }
             };
@@ -476,6 +512,30 @@
                 this.getOperationRecord(this.activeTab);
             },
 
+            getMsg() {
+                this.http.post( this.port.base.moulds, {
+                    belongCompanyId: this.user.companyId,
+                    mouldId: this.detailId
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.boxes = res.data;
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+
             //模具详情
             getDetail() {
                 this.http.post( this.port.mold.moldDetail, {
@@ -522,9 +582,12 @@
                 this.editForm = {
                     id: this.moldDetail.id,
                     modelName: this.moldDetail.modelName,
+                    modelNo: this.moldDetail.modelNo,
+                    equipmentId: this.moldDetail.equipmentId,
                     initialModulus: this.moldDetail.initialModulus,
                     settingLife: this.moldDetail.settingLife,
                     rfid: this.moldDetail.rfid,
+                    produceCompanyId: this.moldDetail.produceCompanyId,
                     flag: 1
                 };
             },
@@ -539,7 +602,7 @@
                             if (res.code == "ok") {
                                 this.editFormVisible = false;
                                 this.$message({
-                                    message: "创建成功",
+                                    message: "修改成功",
                                     type: "success"
                                 });
                                 this.getDetail();
@@ -785,6 +848,7 @@
             };
         },
         mounted() {
+            this.getMsg();
             this.getDetail();
         }
     };

+ 34 - 3
ys_vue/src/views/mold/moldList.vue

@@ -51,12 +51,14 @@
             <el-table-column prop="rfid" label="对应RFID码" width="120" align="center" sortable></el-table-column>
             <el-table-column label="状态" width="100" align="center" sortable>
                     <template slot-scope="scope">
-                    <span v-if="scope.row.state == 1" style="color:#00CD66;">运行</span>
-                    <span v-else style="color:#999999;">静止</span>
+                        <span v-if="scope.row.state == 1" style="color:#00CD66;">运行</span>
+                        <span v-else style="color:#999999;">静止</span>
                     </template>
             </el-table-column>
             <el-table-column label="操作" width="150" align="center" fixed="right" sortable v-if="user.parentId == 1">
-                <el-button size="small" type="danger">删除</el-button>
+                <template slot-scope="scope">
+                    <el-button size="small" type="danger" @click="handleDel(scope.row)">删除</el-button>
+                </template>
             </el-table-column>
         </el-table>
 
@@ -240,6 +242,35 @@
                 this.$router.push("/moldList/" + row.id);
             },
 
+            //删除
+			handleDel: function (row) {
+                this.$confirm('确认删除该模具吗?', '提示', {
+					type: 'warning'
+				}).then(() => {
+                    this.http.post(this.port.mold.delMold, {
+                        id: row.id
+                    }, res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: '删除成功',
+                                type: 'success'
+                            });
+                            this.getUsers();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            });
+                        }
+                    }, error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        });
+                    })
+				});
+            },
+
             //添加界面
             showAdd() {
                 this.addFormVisible = true;