| | |
| | | <el-form :model="addStepForm0" :rules="addStepRules0" ref="dialogForm0" label-width="80px" label-position="center" class="addStepRules0" v-show="active == 0"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="工艺路线" prop="name"> |
| | | <el-input v-model="addStepForm0.name" placeholder="工艺路线" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="产品编号"> |
| | | <el-select v-model="addStepForm0.productId" style="width: 100%" placeholder="产品编号"> |
| | | <el-option v-for="item in productList" :key="item.id" :label="item.name" :value="item.id"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="addStepForm0.description" placeholder="备注" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <!-- 第二步 --> |
| | | <el-form :model="addStepForm1" :rules="addStepRules1" ref="dialogForm1" label-width="80px" label-position="center" class="addStepRules0" v-show="active == 1"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-row class="step1-top"> |
| | | <el-col :span="8"><span>工艺路线名称</span><span>-</span></el-col> |
| | | <el-col :span="8"><span>关联产品</span><span>-</span></el-col> |
| | | <el-col :span="8"><span>工艺路线描述</span><span>-</span></el-col> |
| | | <el-col :span="8"><span>工艺路线名称</span><span style="margin-left: 12px">{{detail.name}}</span></el-col> |
| | | <el-col :span="8"><span>关联产品</span><span style="margin-left: 12px">{{detail.productName}}</span></el-col> |
| | | <el-col :span="8"><span>工艺路线描述</span><span style="margin-left: 12px">{{detail.description}}</span></el-col> |
| | | </el-row> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="版本名称"> |
| | | <el-input v-model="addStepForm1.name" disabled placeholder="版本名称" clearable></el-input> |
| | | <el-input v-model="addStepForm0.name" disabled placeholder="版本名称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | |
| | | <el-tree-select |
| | | node-key="id" |
| | | :props="{ label: 'title',children: 'children',hasChildren: 'ids'}" |
| | | v-model="addStepForm1.groupIds" |
| | | v-model="addStepForm0.groupIds" |
| | | placeholder="关联产线" |
| | | :data="step1TreeData" |
| | | multiple |
| | |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="描述"> |
| | | <el-input v-model="addStepForm1.description" placeholder="请输入工艺路线版本描述" clearable></el-input> |
| | | <el-input v-model="addStepForm0.description" placeholder="请输入工艺路线版本描述" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <!-- 第二步 --> |
| | | <el-form :model="addStepForm1" :rules="addStepRules1" ref="dialogForm1" label-width="80px" label-position="center" class="addStepRules1" v-show="active == 1"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-row class="step1-top"> |
| | | <el-col :span="8"><span>工艺路线名称</span><span style="margin-left: 12px">{{detail.name}}</span></el-col> |
| | | <el-col :span="8"><span>关联产品</span><span style="margin-left: 12px">{{detail.productName}}</span></el-col> |
| | | <el-col :span="8"><span>工艺路线描述</span><span style="margin-left: 12px">{{detail.description}}</span></el-col> |
| | | <el-col :span="8" style="margin-top: 6px;"><span>工艺路线版本</span><span style="margin-left: 12px">{{versionDetail.name}}</span></el-col> |
| | | <el-col :span="8" style="margin-top: 6px;"><span>关联产线</span><span style="margin-left: 12px">{{versionDetail.groupName}}</span></el-col> |
| | | <el-col :span="8" style="margin-top: 6px;"><span>工艺路线描述</span><span style="margin-left: 12px">{{versionDetail.description}}</span></el-col> |
| | | </el-row> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <workmanship :isCustomization = "false"></workmanship> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import workmanship from './workmanship' //工艺路线 |
| | | export default { |
| | | name: 'add-craft', |
| | | components: {}, |
| | | components: {workmanship}, |
| | | data() { |
| | | var valiarrPass = (rule, value, callback) => { |
| | | if (value.length == 0) { |
| | |
| | | return { |
| | | step1TreeData: [], |
| | | active: 0, |
| | | //表单数据 |
| | | addStepForm0: { |
| | | detail: { |
| | | name: "", |
| | | productId: "", |
| | | productName: "", |
| | | description: "", |
| | | |
| | | }, |
| | | versionDetail: { |
| | | name: "", |
| | | groupName: "", |
| | | description: "" |
| | | }, |
| | | //表单数据 |
| | | addStepForm0: { |
| | | name: "", |
| | | groupIds: [], |
| | | description: "" |
| | | }, |
| | | //验证规则 |
| | | addStepRules0: { |
| | | name:[{required: true, message: '请输入工艺路线'}], |
| | | }, |
| | | groupIds:[{validator: valiarrPass,required: true, trigger:'change'}], |
| | | },//表单数据 |
| | | addStepForm1: { |
| | | name: "", |
| | | groupIds: [], |
| | | description: "", |
| | | |
| | | description: "" |
| | | }, |
| | | //验证规则 |
| | | addStepRules1: { |
| | | groupIds:[{validator: valiarrPass,required: true, trigger:'change'}], |
| | | //name:[{required: true, message: '请输入工艺路线'}], |
| | | }, |
| | | |
| | | productList: [] |
| | | } |
| | | }, |
| | |
| | | } |
| | | }, |
| | | mounted(){ |
| | | //this.getProductList(); //for step0 |
| | | // this.getGroupWorkstation(); //for step1 |
| | | this.getGroupWorkstation(); //for step0 |
| | | this.getDetail(this.$route.query.id); //for step0 |
| | | }, |
| | | methods: { |
| | | getGroupWorkstation() { |
| | |
| | | } |
| | | }) |
| | | this.step1TreeData = tree; |
| | | console.log(this.step1TreeData) |
| | | } |
| | | }) |
| | | }, |
| | | goStep1() { |
| | | var obj = Object.assign({},this.addStepForm0); |
| | | obj.craftId = this.$route.query.id; |
| | | obj.id = this.$route.query.craftId; |
| | | this.$refs.dialogForm0.validate(async (valid) => { |
| | | if (valid) { |
| | | this.$HTTP.put(`/api/blade-cps/production-craft-version/update`,obj).then(res=> { |
| | | if(res.code == 200) { |
| | | this.active = 1; |
| | | //this.getVersionDetail(res.data.id); |
| | | }else { |
| | | this.$alert(res.message, "提示", {type: 'error'}); |
| | | } |
| | | }) |
| | | }else{ |
| | | return false; |
| | | } |
| | | }) |
| | | }, |
| | | getVersionDetail(id) { |
| | | this.$HTTP.get(`/api/blade-cps/production-craft-version/detail/${id}`).then(res=> { |
| | | if(res.code == 200) { |
| | | this.versionDetail = res.data; |
| | | }else { |
| | | this.$alert(res.message, "提示", {type: 'error'}); |
| | | } |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | next() { |
| | | if(this.active == 0) { |
| | | this.setStep0(); |
| | | this.goStep1(); |
| | | }else if(this.active == 1) { |
| | | |
| | | }else if(this.active == 2) { |
| | | |
| | | } |
| | | }, |
| | | setStep0() { |
| | | var obj = Object.assign({},this.addStepForm1); |
| | | obj.craftId = ""; |
| | | this.$refs.dialogForm1.validate(async (valid) => { |
| | | if (valid) { |
| | | this.$HTTP.post("/api/blade-cps/production-craft-version/insert",obj).then(res=> { |
| | | this.isSaveing = false; |
| | | if(res.code == 200) { |
| | | this.active = 2; |
| | | this.$message.success("操作成功"); |
| | | }else { |
| | | console.log(res,123) |
| | | //this.$alert(res.message, "提示", {type: 'error'}); |
| | | } |
| | | }) |
| | | }else{ |
| | | return false; |
| | | } |
| | | }) |
| | | }, |
| | | getDetail(id) { |
| | | this.$HTTP.get(`/api/blade-cps/craft-routing/detail?id=${this.$route.query.id}`).then(res=> { |
| | | if(res.code == 200) { |
| | | this.addStepForm0 = res.data; |
| | | } |
| | | }) |
| | | }, |
| | | getProductList() { |
| | | this.$HTTP.get(`/api/blade-cps/craft-routing/not-band-craft?craftId=${this.$route.query.id}`).then(res=> { |
| | | if(res.code == 200) { |
| | | this.productList = res.data; |
| | | this.getDetail(); |
| | | this.detail = res.data; |
| | | res.data.dtos.forEach(item=> { |
| | | if(item.id == this.$route.query.craftId) { |
| | | this.addStepForm0.name = item.name; |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |