|
@@ -24,54 +24,47 @@
|
|
|
</el-col>
|
|
|
|
|
|
<!--列表-->
|
|
|
- <el-table
|
|
|
- :data="moulds"
|
|
|
- :height="tableHeight"
|
|
|
- highlight-current-row
|
|
|
- v-loading="listLoading"
|
|
|
- style="width: 100%;"
|
|
|
- >
|
|
|
- <el-table-column type="index" width="40"></el-table-column>
|
|
|
- <el-table-column prop="typeNumber" label="模具类型编号" width="130" sortable></el-table-column>
|
|
|
- <el-table-column prop="name" label="模具名称" width="100" sortable></el-table-column>
|
|
|
- <el-table-column prop="project" label="所属项目" width="100" sortable></el-table-column>
|
|
|
- <el-table-column prop="client" label="所属客户" sortable></el-table-column>
|
|
|
- <el-table-column prop="manufacturer" label="生产厂家" width="100" sortable></el-table-column>
|
|
|
- <el-table-column prop="mouldNumber" label="云模盒编号" width="120" sortable></el-table-column>
|
|
|
- <el-table-column prop="lifetime" label="模次寿命" width="100" sortable></el-table-column>
|
|
|
- <el-table-column prop="initial" label="初始模次" width="100" sortable></el-table-column>
|
|
|
- <el-table-column prop="RFIDcode" label="对应RFID码" width="120" sortable></el-table-column>
|
|
|
- <el-table-column label="图纸资料" width="100" sortable>
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.blueprint">需要</span>
|
|
|
- <span v-else>不需要</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="Bom表" width="90" sortable>
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.BOMtable">需要</span>
|
|
|
- <span v-else>不需要</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="零件清单" width="100" sortable>
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.partList">需要</span>
|
|
|
- <span v-else>不需要</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="保养标准" width="100" sortable>
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.standard">需要</span>
|
|
|
- <span v-else>不需要</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" width="220" sortable>
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button size="small" @click="toDetail(scope.row.typeNumber)">详情</el-button>
|
|
|
- <el-button size="small">修改</el-button>
|
|
|
- <el-button size="small" type="danger">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-table :data="molds" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;">
|
|
|
+ <el-table-column type="index" width="40"></el-table-column>
|
|
|
+ <el-table-column prop="typeNumber" label="模具类型编号" width="130" sortable></el-table-column>
|
|
|
+ <el-table-column prop="name" label="模具名称" width="120" sortable></el-table-column>
|
|
|
+ <el-table-column prop="project" label="所属项目" width="100" sortable></el-table-column>
|
|
|
+ <el-table-column prop="client" label="所属客户" sortable></el-table-column>
|
|
|
+ <el-table-column prop="manufacturer" label="生产厂家" sortable></el-table-column>
|
|
|
+ <el-table-column prop="mouldNumber" label="云模盒编号" width="120" sortable></el-table-column>
|
|
|
+ <el-table-column prop="lifetime" label="模次寿命" width="100" sortable></el-table-column>
|
|
|
+ <el-table-column prop="initial" label="初始模次" width="100" sortable></el-table-column>
|
|
|
+ <el-table-column prop="RFIDcode" label="对应RFID码" width="120" sortable></el-table-column>
|
|
|
+ <el-table-column label="图纸资料" width="100" sortable>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.blueprint">需要</span>
|
|
|
+ <span v-else>不需要</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="Bom表" width="100" sortable>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.BOMtable">需要</span>
|
|
|
+ <span v-else>不需要</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="零件清单" width="100" sortable>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.partList">需要</span>
|
|
|
+ <span v-else>不需要</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="保养标准" width="100" sortable>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.standard">需要</span>
|
|
|
+ <span v-else>不需要</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="150" sortable>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="small" type="primary" @click="toDetail(scope.row.typeNumber)">详情</el-button>
|
|
|
+ <el-button size="small" type="danger" v-if="user.parentId == 1">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<!--工具条-->
|
|
@@ -96,12 +89,11 @@
|
|
|
<el-form-item label="模具名称" prop="modelName">
|
|
|
<el-input v-model="addForm.modelName" autocomplete="off" placeholder="请输入模具名称"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="云模盒编号" prop="mouldNumber">
|
|
|
- <el-select v-model="addForm.companyType" clearable filterable placeholder="请选择公司类型" style="width:533px">
|
|
|
- <el-option v-for="item in team" :key="item.value" :label="item.label" :value="item.value">
|
|
|
+ <el-form-item label="云模盒编号" prop="equipmentId">
|
|
|
+ <el-select v-model="addForm.equipmentId" clearable filterable placeholder="请选择云模盒编号" style="width:533px">
|
|
|
+ <el-option v-for="item in boxes" :key="item.id" :label="item.equipmentNo" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <el-input v-model="addForm.mouldNumber" autocomplete="off" placeholder="请输入云模盒编号"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -118,7 +110,7 @@
|
|
|
data() {
|
|
|
return {
|
|
|
user: JSON.parse(sessionStorage.getItem('user')),
|
|
|
- moulds: [
|
|
|
+ molds: [
|
|
|
//临时数据
|
|
|
{
|
|
|
typeNumber: "MUJU002",
|
|
@@ -163,22 +155,45 @@
|
|
|
modelName: [
|
|
|
{ required: true, message: '请输入模具名称', trigger: 'blur' }
|
|
|
],
|
|
|
- managerId: [
|
|
|
+ equipmentId: [
|
|
|
{ required: true, message: '请选择云模盒编号', trigger: ['blur','change'] }
|
|
|
]
|
|
|
},
|
|
|
listLoading: false,
|
|
|
total: 0,
|
|
|
tableHeight: 0,
|
|
|
+ boxes: [],
|
|
|
+
|
|
|
+ addLoading: false,
|
|
|
addFormVisible: false,
|
|
|
addForm: {
|
|
|
modelNo: "",
|
|
|
modelName: "",
|
|
|
- managerId: ""
|
|
|
+ equipmentId: ""
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ getMsg() {
|
|
|
+ this.http.post(this.port.base.moulds, {
|
|
|
+ belongCompanyId: this.user.companyId
|
|
|
+ }, 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'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
//分页
|
|
|
handleCurrentChange(val) {
|
|
|
this.page = val;
|
|
@@ -188,30 +203,78 @@
|
|
|
this.size = val;
|
|
|
// this.getUsers();
|
|
|
},
|
|
|
- selsChange: function(sels) {
|
|
|
- this.sels = sels;
|
|
|
+
|
|
|
+ //获取模具列表
|
|
|
+ getMoldList() {
|
|
|
+ // this.listLoading = true;
|
|
|
+ // this.http.post(this.port.mold.modelList, {
|
|
|
+ // keyName: this.filters.keyName,
|
|
|
+ // currentPage: this.page,
|
|
|
+ // pageSize: this.size,
|
|
|
+ // companyId: this.filters.companyId==''?-1:this.filters.companyId,
|
|
|
+ // flag: this.filters.flag=='姓名'?0:this.filters.flag
|
|
|
+ // }, res => {
|
|
|
+ // this.listLoading = false;
|
|
|
+ // if (res.code == "ok") {
|
|
|
+ // this.list = res.data.list;
|
|
|
+ // this.total = res.data.total;
|
|
|
+ // } else {
|
|
|
+ // this.$message({
|
|
|
+ // message: res.msg,
|
|
|
+ // type: 'error'
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }, error => {
|
|
|
+ // this.listLoading = false;
|
|
|
+ // this.$message({
|
|
|
+ // message: error,
|
|
|
+ // type: 'error'
|
|
|
+ // });
|
|
|
+ // })
|
|
|
},
|
|
|
+ //详情
|
|
|
toDetail(id) {
|
|
|
this.$router.push("/moldDetail/" + id);
|
|
|
},
|
|
|
+
|
|
|
//添加界面
|
|
|
showAdd() {
|
|
|
this.addFormVisible = true;
|
|
|
this.addForm = {
|
|
|
- typeNumber: "",
|
|
|
- name: "",
|
|
|
- project: "",
|
|
|
- client: "",
|
|
|
- manufacturer: "",
|
|
|
- mouldNumber: "",
|
|
|
- lifetime: "",
|
|
|
- initial: "",
|
|
|
- RFIDcode: "",
|
|
|
- blueprint: false,
|
|
|
- BOMtable: false,
|
|
|
- partList: false,
|
|
|
- standard: false
|
|
|
+ modelNo: "",
|
|
|
+ modelName: "",
|
|
|
+ equipmentId: ""
|
|
|
};
|
|
|
+ },
|
|
|
+ addSubmit() {
|
|
|
+ this.$refs.addForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.addLoading = true;
|
|
|
+ this.http.post(this.port.mold.addMold, this.addForm , res => {
|
|
|
+ this.addLoading = false;
|
|
|
+ this.addFormVisible = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: '创建成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.getMoldList();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, error => {
|
|
|
+ this.addLoading = false;
|
|
|
+ this.addFormVisible = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -219,7 +282,8 @@
|
|
|
this.tableHeight = height - 210;
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
+ this.getMsg();
|
|
|
+ this.getMoldList();
|
|
|
}
|
|
|
};
|
|
|
</script>
|