| | |
| | | :value="item.ID"> |
| | | </el-option> |
| | | </el-select> |
| | | |
| | | </el-form-item> |
| | | <el-form-item label="回数" prop='circle' class="form-item"> |
| | | <el-row> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="组别" prop="workshopGroup" class="form-item"> |
| | | <el-select v-model="form.workshopGroup" placeholder="请选择" class="select-width"> |
| | | <el-option v-for="item in workshopGroupList" :key="item.ID" :label="item.name" |
| | | :value="item.ID"> |
| | | <el-option v-for="item in workshopGroupList" :key="item.ID" :label="item.workshopNumber" |
| | | :value="item.workshopNumber"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | |
| | | <script> |
| | | import { getRegisterList,saveRegister,getDictList,getWorkshopManageList,getRegisterDetails } from "@/api/productManage/silkRegisterForm.js" |
| | | import {getCheckDetails,saveCheck,} from "@/api/productManage/silkInspectForm.js" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView" |
| | | export default { |
| | |
| | | loading: false, |
| | | activeName: "first", |
| | | searchOptions: [], |
| | | search_map: {}, |
| | | is_public: true, |
| | | keyword: '', |
| | | marketList:[], //庄口 |
| | | nameList:[], //车间 |
| | | workshopGroupList:[], //组别 |
| | |
| | | tableData: [ |
| | | { |
| | | productId:1, |
| | | position: '', |
| | | fineness: 0, |
| | | quantity: 0, |
| | | sum: "", |
| | | position: null, |
| | | fineness: null, |
| | | quantity: null, |
| | | sum: null, |
| | | } |
| | | ], |
| | | tableColumn:[ |
| | | { label: "车号", prop: "position", input: true }, // 客户名称 |
| | | { label: "车号", prop: "position", inputNumber: true,isRequird: true, }, // 客户名称 |
| | | { label: "纤度值", prop: "fineness", inputNumber: true, isRequird: true, }, // 销售负责人 |
| | | { label: "数量", prop: "quantity", inputNumber: true , isRequird: true,}, // 重要级别 |
| | | { label: "纤度合计", prop: "sum", inputNumber: true}, // 下次回访日期 |
| | | { label: "纤度合计", prop: "sum", inputNumber: true,isRequird: true,}, // 下次回访日期 |
| | | ], |
| | | }, |
| | | tableData:[], |
| | |
| | | this.registerId= query.id ? query.id : ""; |
| | | } |
| | | this.getSelectDataList() |
| | | this.search_map = { |
| | | is_public: this.is_public |
| | | } |
| | | this.keyword='' |
| | | this.getDetailsData() |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | getDetailsData(){ |
| | | if(this.registerId){ |
| | | getRegisterDetails({ id: this.registerId }).then((response) => { |
| | | if (response.code === 200) { |
| | | let config=JSON.parse(JSON.stringify(response.data?response.data:{})); |
| | | this.form=config; |
| | | this.tableList.tableData=config.finenessList?config.finenessList:[] |
| | | this.tableData=config.finenessList?config.finenessList:[] |
| | | } |
| | | }) |
| | | if(this.activeName=='first'){ |
| | | getRegisterDetails({ id: this.registerId }).then((response) => { |
| | | if (response.code === 200) { |
| | | let config=JSON.parse(JSON.stringify(response.data?response.data:{})); |
| | | this.form=config; |
| | | this.tableList.tableData=config.finenessList?config.finenessList:[] |
| | | this.tableData=config.finenessList?config.finenessList:[] |
| | | } |
| | | }) |
| | | }else{ |
| | | getCheckDetails({ id: this.registerId }).then((response) => { |
| | | if (response.code === 200) { |
| | | let config=JSON.parse(JSON.stringify(response.data?response.data:{})); |
| | | this.form=config; |
| | | this.tableList.tableData=config.finenessList?config.finenessList:[] |
| | | this.tableData=config.finenessList?config.finenessList:[] |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | }, |
| | | getSelectDataList(){ |
| | | //车间 |
| | |
| | | async getData() { |
| | | this.loading = true |
| | | await getRegisterList({ |
| | | search_map: this.search_map, |
| | | keyword: this.keyword?this.keyword:'', |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }) |
| | |
| | | }) |
| | | }, |
| | | tabsClick(tab) { |
| | | console.log(tab.name) |
| | | if (tab.name === "first") { |
| | | this.is_public = true |
| | | } else { |
| | | this.is_public = false |
| | | } |
| | | this.search_map = { |
| | | is_public: this.is_public |
| | | } |
| | | // if (tab.name === "first") { |
| | | // this.is_public = true |
| | | // } else { |
| | | // this.is_public = false |
| | | // } |
| | | this.$router.push({ |
| | | path:"/productManage/silkRegisterForm/addPage?activeName="+tab.name, |
| | | }); |
| | | this.keyword = '' |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | // 搜索 |
| | | onFilterSearch(searchText) { |
| | | this.search_map = { |
| | | is_public: this.is_public, |
| | | name: searchText |
| | | } |
| | | this.keyword=searchText||'' |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | |
| | | finenessList:finenessList, |
| | | ...form |
| | | } |
| | | // 编辑 |
| | | if(this.registerId){ |
| | | params.id=this.registerId |
| | | } |
| | | // params.workshopGroup=Number(params.workshopGroup) |
| | | this.isAddloading=true |
| | | saveRegister(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: "保存成功!", |
| | | type: "success", |
| | | }); |
| | | } |
| | | this.isAddloading=false |
| | | }).catch(() => { |
| | | setTimeout(() => { |
| | | this.isAddloading = false; |
| | | }, 3000); |
| | | }) |
| | | if(this.activeName=='first'){ |
| | | saveRegister(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: "保存成功!", |
| | | type: "success", |
| | | }); |
| | | } |
| | | this.isAddloading=false |
| | | }).catch(() => { |
| | | setTimeout(() => { |
| | | this.isAddloading = false; |
| | | }, 3000); |
| | | }) |
| | | }else{ |
| | | saveCheck(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: "保存成功!", |
| | | type: "success", |
| | | }); |
| | | } |
| | | this.isAddloading=false |
| | | }).catch(() => { |
| | | setTimeout(() => { |
| | | this.isAddloading = false; |
| | | }, 3000); |
| | | }) |
| | | } |
| | | |
| | | } else { |
| | | console.log('error submit!!'); |
| | | |