| | |
| | | type="primary" |
| | | :loading="isAddloading" |
| | | @click="saveClickOne('form')" |
| | | :disabled="title==='查看'" |
| | | >保存</el-button |
| | | > |
| | | </template> |
| | | </CommonSearch> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="body"> |
| | | <div class="body-l"> |
| | | <el-form |
| | |
| | | label-width="80px" |
| | | > |
| | | <el-form-item label="编号" prop="number" class="form-item"> |
| | | <el-input v-model="form.number" :disabled="title=='修改'?true:false" placeholder="请输入"> </el-input> |
| | | <el-input v-model="form.number" :disabled="title=='修改'||title=='查看'?true:false" placeholder="请输入"> </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="落丝时间" prop="finishDate" class="form-item"> |
| | | <el-date-picker |
| | |
| | | type="date" |
| | | placeholder="选择日期" |
| | | class="select-width" |
| | | :disabled='title==="查看"' |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | |
| | | placeholder="请选择" |
| | | class="select-width" |
| | | @change="getGroupNumber" |
| | | :disabled='title==="查看"' |
| | | > |
| | | <el-option |
| | | v-for="item in marketList" |
| | |
| | | v-model="form.workshopObj" |
| | | placeholder="请选择" |
| | | class="select-width" |
| | | @change="getGroupNumber('workshopObj')" |
| | | > |
| | | :disabled='title==="查看"' |
| | | @change="getGroupNumber('workshopObj')"> |
| | | <el-option |
| | | v-for="item in nameList" |
| | | :key="item.ID" |
| | | :label="item.name" |
| | | :value="{ value: item.number, label: item.name }" |
| | | > |
| | | :value="{ value: item.number, label: item.name }"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | v-model="form.spec" |
| | | placeholder="请选择" |
| | | class="select-width" |
| | | :disabled='title==="查看"' |
| | | > |
| | | <el-option |
| | | v-for="item in specList" |
| | |
| | | placeholder="请先选择车间" |
| | | no-data-text="请先选择车间" |
| | | class="select-width" |
| | | :disabled='title==="查看"' |
| | | @change="getGroupNumber()" |
| | | > |
| | | <el-option |
| | | v-for="item in workshopGroupList" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | > |
| | | :value="item"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | placeholder="请输入" |
| | | show-word-limit |
| | | class="select-width" |
| | | :disabled='title==="查看"' |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="2" style="margin: 0 auto; text-align: center" |
| | | >-</el-col |
| | | > |
| | | <el-col :span="2" style="margin: 0 auto; text-align: center">-</el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item |
| | | label="" |
| | |
| | | @input="inputStart" |
| | | placeholder="请输入" |
| | | show-word-limit |
| | | :disabled='title==="查看"' |
| | | class="select-width" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | </el-row> |
| | | </el-form-item> |
| | | <el-form-item label="车号" prop="position" class="form-item"> |
| | | <el-input v-model.number="form.position" placeholder="请输入"> |
| | | <el-input disabled v-model.number="form.position" placeholder="请输入车号"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | @selTableCol="selTableCol"> |
| | | </TableCommonView> --> |
| | | <!-- 修改为输入 --> |
| | | <CommonFormTableView |
| | | ref="commonFormTableView" |
| | | <FormTableView |
| | | ref="formTableView" |
| | | :detail-enter="isView ? true : false" |
| | | :selectBox="false" |
| | | :detailEnter="true" |
| | |
| | | :product-table-list="tableList" |
| | | @inputContent="inputContent" |
| | | @addProductClick="addProductClick" |
| | | ></CommonFormTableView> |
| | | ></FormTableView> |
| | | </div> |
| | | </div> |
| | | <div class="body-r"> |
| | |
| | | type="primary" |
| | | :loading="isAddloading" |
| | | @click="saveClickOne('form')" |
| | | >保存</el-button |
| | | > |
| | | :disabled="title==='查看'" |
| | | >保存</el-button> |
| | | <!-- </template> |
| | | </CommonSearch> --> |
| | | </div> |
| | |
| | | show-overflow-tooltip |
| | | :sortable="item.sortable" |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{scope.row[item.prop]}} |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | show-overflow-tooltip |
| | | :sortable="item.sortable" |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{scope.row[item.prop]}} |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | width="100" |
| | | align="center" |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{scope.row[item.prop]}} |
| | | </template> |
| | | <template v-for="(item, i) in tableTwoList.upper"> |
| | | <el-table-column |
| | | align="center" |
| | |
| | | show-overflow-tooltip |
| | | :sortable="item.sortable" |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{scope.row[item.prop]}} |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | saveRegister, |
| | | getDictList, |
| | | getRegisterDetails, |
| | | getCarNumber |
| | | getCarNumber, |
| | | getAutoCode |
| | | } from "@/api/productManage/silkRegisterForm.js"; |
| | | import { |
| | | getCheckDetails, |
| | | saveCheck, |
| | | getNewCheckDetails |
| | | } from "@/api/productManage/silkInspectForm.js"; |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin"; |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView"; |
| | | //import CommonFormTableView from "@/components/makepager/CommonFormTableView"; |
| | | import { getWorkshopManageGroup } from "@/api/productManage/productRegisterForm.js"; |
| | | import FormTableView from '@/views/productManage/silkRegisterForm/components/FormTableView.vue'; |
| | | export default { |
| | | name: "silkRegisterAddPage", |
| | | props: {}, |
| | | mixins: [pageMixin], |
| | | components: { |
| | | CommonFormTableView, |
| | | FormTableView, |
| | | }, |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | title:'', |
| | |
| | | workshopGroupList: [], //组别 |
| | | deliveryTypeList: [], |
| | | specList: [], //规格 |
| | | form: {}, |
| | | form: { |
| | | number:'' |
| | | }, |
| | | rules: { |
| | | number: [ |
| | | { required: true, message: "请填写", trigger: ["change", "blur"] }, |
| | |
| | | }, |
| | | pickerOptions: { |
| | | disabledDate(time) { |
| | | return time.getTime() < new Date().getTime() - 86400000; |
| | | //return time.getTime() < new Date().getTime() - 86400000; |
| | | return false; |
| | | }, |
| | | }, |
| | | tableTwoList: { |
| | |
| | | productId: 1, |
| | | position: null, |
| | | fineness: null, |
| | | quantity: null, |
| | | quantity: 0, |
| | | sum: null, |
| | | }, |
| | | ], |
| | |
| | | prop: "position", |
| | | inputNumber: true, |
| | | isRequird: true, |
| | | noOperate:true |
| | | }, // 客户名称 |
| | | { |
| | | label: "纤度值", |
| | | prop: "fineness", |
| | | inputNumber: true, |
| | | isRequird: true, |
| | | noOperate:this.$route.query.title==='查看' |
| | | }, // 销售负责人 |
| | | { |
| | | label: "数量", |
| | | prop: "quantity", |
| | | inputNumber: true, |
| | | isRequird: true, |
| | | noOperate:true |
| | | }, // 重要级别 |
| | | { |
| | | label: "纤度合计", |
| | |
| | | this.getDetailsData(); |
| | | }, |
| | | methods: { |
| | | async getAutoCode(){ |
| | | const {code,data}=await getAutoCode({type:2}); |
| | | if(code===200){ |
| | | return data.id; |
| | | } |
| | | return ''; |
| | | }, |
| | | async getDetailsData(id) { |
| | | const code= await this.getAutoCode() |
| | | if (this.activeName == "first") { |
| | | this.form = { |
| | | number: "", |
| | | finishDate: "", |
| | | number: code, |
| | | finishDate:this.$moment(new Date()).format('YYYY-MM-DD'), |
| | | market: "", |
| | | workshopObj: "", |
| | | spec: "", |
| | |
| | | circle: "", |
| | | totalCircle: "", |
| | | position: "", |
| | | }; |
| | | } |
| | | if (this.registerId) { |
| | | await getRegisterDetails({ id: id ? id : this.registerId }).then( |
| | | (response) => { |
| | |
| | | } |
| | | } else { |
| | | this.form = { |
| | | number: "", |
| | | number: code, |
| | | workshopObj: "", |
| | | workshopGroup: "", |
| | | circle: "", |
| | | spec: "", |
| | | finishDate: "", |
| | | finishDate: this.$moment(new Date()).format('YYYY-MM-DD'), |
| | | averageFineness: "", |
| | | measureFineness: "", |
| | | deviation: "", |
| | |
| | | marketProcessOrderNumber: "", |
| | | inspector: "", |
| | | }; |
| | | if (this.inspectID) { |
| | | getCheckDetails({ id: id ? id : this.inspectID }).then((response) => { |
| | | if (this.registerId) { |
| | | getNewCheckDetails({ id: id ? id : this.registerId }).then((response) => { |
| | | if (response.code === 200) { |
| | | let config = JSON.parse( |
| | | JSON.stringify(response.data.info ? response.data.info : {}) |
| | |
| | | } |
| | | if (round) { |
| | | for (let j in round) { |
| | | arr[i][round[j].fineness] = round[j].quantity; |
| | | arr[i][round[j].fineness.toString()] = round[j].quantity; |
| | | } |
| | | } |
| | | } |
| | | this.tableTwoList.tableInfomation = arr; |
| | | this.tableTwoList.tableInfomation = arr; |
| | | } |
| | | }); |
| | | } |
| | |
| | | let item = { |
| | | label: lowNumber + i * 0.5 + "", |
| | | prop: lowNumber + i * 0.5 + "", |
| | | min: 100, |
| | | min: 50, |
| | | default: true, |
| | | }; |
| | | this.tableTwoList.objective.push(item); |
| | |
| | | let item = { |
| | | label: lowStart + i * 0.5 + "", |
| | | prop: lowStart + i * 0.5 + "", |
| | | min: 100, |
| | | min: 50, |
| | | default: true, |
| | | }; |
| | | this.tableTwoList.lower.push(item); |
| | |
| | | let item = { |
| | | label: topNumber + i * 0.5 + "", |
| | | prop: topNumber + i * 0.5 + "", |
| | | min: 100, |
| | | min: 50, |
| | | default: true, |
| | | }; |
| | | this.tableTwoList.upper.push(item); |
| | |
| | | getSelectDataList() { |
| | | //车间 |
| | | getDictList({ |
| | | dictType: 1, |
| | | dictType: 2, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.nameList = res.data || []; |
| | |
| | | // }); |
| | | //庄口 |
| | | getDictList({ |
| | | dictType: 0, |
| | | dictType: 1, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.marketList = res.data || []; |
| | |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.tableData=[] |
| | | let data = res.data?JSON.parse(JSON.stringify(res.data)) : []; |
| | | const {startCarNumber,endCarNumber,startCarHalf,endCarHalf}=res.data; |
| | | for(let i=startCarNumber;i<=endCarNumber;i++){ |
| | | if((i===startCarNumber&&startCarHalf===2)||(i===endCarNumber&&endCarHalf===1)){ |
| | | this.tableData.push({position:i,productId:Number(i)*2-1,quantity:1}); |
| | | }else{ |
| | | this.tableData.push({position:i,productId:Number(i)*2-1,quantity:1}); |
| | | this.tableData.push({position:i,productId:Number(i)*2,quantity:1}); |
| | | } |
| | | /*if(i===startCarNumber){ |
| | | if(startCarHalf===1){//左半车 |
| | | this.tableData.push({position:i,productId:Number(i)*2-1}); |
| | | this.tableData.push({position:i,productId:Number(i)*2}); |
| | | }else{//右半车 |
| | | this.tableData.push({position:i,productId:Number(i)*2-1}); |
| | | } |
| | | }else if(i===endCarNumber){ |
| | | if(endCarHalf===1){//左半车 |
| | | this.tableData.push({position:i,productId:Number(i)*2-1}); |
| | | this.tableData.push({position:i,productId:Number(i)*2}); |
| | | }else{//右半车 |
| | | this.tableData.push({position:i,productId:Number(i)*2-1}); |
| | | } |
| | | }else{ |
| | | this.tableData.push({position:i,productId:Number(i)*2-1}); |
| | | this.tableData.push({position:i,productId:Number(i)*2}); |
| | | }*/ |
| | | } |
| | | /*let data = res.data?JSON.parse(JSON.stringify(res.data)) : []; |
| | | if(Object.keys(data).length>0){ |
| | | for(let i in data){ |
| | | this.tableData.push({position:data[i],productId:Number(i)*2+1}) |
| | | this.tableData.push({position:data[i],productId:Number(i)*2+2}) |
| | | } |
| | | } |
| | | } |
| | | }*/ |
| | | console.log(this.tableData); |
| | | this.tableList.tableData = this.tableData |
| | | }else{ |
| | | this.tableData=[] |
| | |
| | | // 产品列表输入 |
| | | inputContent(val, prop, row) { |
| | | this.productId = row.productId; |
| | | this.form.position=row.position; |
| | | this.tableData.map((item) => { |
| | | if (item.productId === row.productId) { |
| | | item[prop] = val; |
| | |
| | | // } else { |
| | | // this.is_public = false |
| | | // } |
| | | this.$router.push({ |
| | | /*this.$router.push({ |
| | | path: "/productManage/silkRegisterForm/addPage", |
| | | query: { |
| | | activeName: this.activeName, |
| | | inspectID: this.inspectID, |
| | | id: this.registerId, |
| | | title:this.title |
| | | }, |
| | | }); |
| | | });*/ |
| | | this.getDetailsData(); |
| | | this.keyword = ""; |
| | | }, |
| | |
| | | }, |
| | | // 纤度登记表 |
| | | // 放弃 |
| | | cancelClickOne() { |
| | | async cancelClickOne() { |
| | | const code=await this.getAutoCode() |
| | | if (this.activeName == "first") { |
| | | this.form = { |
| | | number: "", |
| | | finishDate: "", |
| | | number: code, |
| | | finishDate:this.$moment(new Date()).format('YYYY-MM-DD'), |
| | | market: "", |
| | | workshopObj: "", |
| | | spec: "", |
| | |
| | | productId: 1, |
| | | position: "", |
| | | fineness: 0, |
| | | quantity: 0, |
| | | quantity: 1, |
| | | sum: "", |
| | | }, |
| | | ]; |
| | |
| | | } |
| | | for (let i in finenessList) { |
| | | delete finenessList[i].productId; |
| | | finenessList[i].sum=finenessList[i].sum*1; |
| | | } |
| | | this.isAddloading = true; |
| | | const mapFineness=new Map(); |
| | | finenessList.forEach(item=>{ |
| | | if(mapFineness.has(item.position)){ |
| | | const value=mapFineness.get(item.position); |
| | | if(value[0].fineness===item.fineness){ |
| | | value[0].sum+=item.sum; |
| | | value[0].quantity+=item.quantity; |
| | | }else{ |
| | | value.push(item); |
| | | } |
| | | mapFineness.set(item.position,value); |
| | | } else{ |
| | | mapFineness.set(item.position,[item]); |
| | | } |
| | | }); |
| | | console.log("修改",mapFineness) |
| | | finenessList=[...mapFineness.values()].flat(Infinity); |
| | | let params = { |
| | | finenessList: finenessList, |
| | | ...form, |
| | | finenessList: finenessList, |
| | | }; |
| | | // 编辑 |
| | | if (this.inspectID) { |
| | |
| | | message: "保存成功!", |
| | | type: "success", |
| | | }); |
| | | this.$router.push({ |
| | | path: "/productManage/silkRegisterForm", |
| | | }); |
| | | if(res.data.ID){ |
| | | this.registerId=res.data.ID; |
| | | } |
| | | this.activeName = "second"; |
| | | this.getDetailsData(); |
| | | // this.$router.push({ |
| | | // path: "/productManage/silkRegisterForm", |
| | | // }); |
| | | } |
| | | this.isAddloading = false; |
| | | }) |
| | |
| | | }); |
| | | } else { |
| | | let paramsTwo = { |
| | | // ...form, |
| | | info:form, |
| | | items:this.tableTwoList.tableInfomation, |
| | | }; |
| | |
| | | this.getDetailsData(); |
| | | } |
| | | this.isAddloading = false; |
| | | }) |
| | | .catch(() => { |
| | | }).catch(() => { |
| | | setTimeout(() => { |
| | | this.isAddloading = false; |
| | | }, 3000); |
| | |
| | | } |
| | | } else { |
| | | console.log("error submit!!"); |
| | | |
| | | return false; |
| | | } |
| | | }); |
| | |
| | | } |
| | | |
| | | .list-view { |
| | | margin-top: 20px; |
| | | height: calc(100% - 180px); |
| | | min-height: 200px; |
| | | overflow-y: auto; |