| | |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 自动生成编码 |
| | | // |
| | | export function getAutoCode(params) { |
| | | return request({ |
| | | url: "/api-jl/v1/system/getAutoCode", |
| | | method: "get", |
| | | params |
| | | }) |
| | | } |
| | |
| | | </CommonSearch> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="body"> |
| | | <div class="body-l"> |
| | | <el-form |
| | |
| | | saveRegister, |
| | | getDictList, |
| | | getRegisterDetails, |
| | | getCarNumber |
| | | getCarNumber, |
| | | getAutoCode |
| | | } from "@/api/productManage/silkRegisterForm.js"; |
| | | import { |
| | | getCheckDetails, |
| | |
| | | //import CommonFormTableView from "@/components/makepager/CommonFormTableView"; |
| | | import { getWorkshopManageGroup } from "@/api/productManage/productRegisterForm.js"; |
| | | import FormTableView from '@/views/productManage/silkRegisterForm/components/FormTableView.vue'; |
| | | import moment from 'moment'; |
| | | let idValue=moment(new Date()).format('YYYYMMDDHHmmss'); |
| | | export default { |
| | | name: "silkRegisterAddPage", |
| | | props: {}, |
| | |
| | | deliveryTypeList: [], |
| | | specList: [], //规格 |
| | | form: { |
| | | number:idValue |
| | | number:'' |
| | | }, |
| | | rules: { |
| | | number: [ |
| | |
| | | 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, |
| | | isRequird: true |
| | | }, // 销售负责人 |
| | | { |
| | | 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: idValue, |
| | | number: code, |
| | | finishDate:this.$moment(new Date()).format('YYYY-MM-DD'), |
| | | market: "", |
| | | workshopObj: "", |
| | |
| | | } |
| | | } else { |
| | | this.form = { |
| | | number: idValue, |
| | | number: code, |
| | | workshopObj: "", |
| | | workshopGroup: "", |
| | | circle: "", |
| | |
| | | this.tableData=[] |
| | | const {startCarNumber,endCarNumber,startCarHalf,endCarHalf}=res.data; |
| | | for(let i=startCarNumber;i<=endCarNumber;i++){ |
| | | if(i===startCarNumber){ |
| | | 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}); |
| | | 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){ |
| | |
| | | }, |
| | | // 纤度登记表 |
| | | // 放弃 |
| | | cancelClickOne() { |
| | | async cancelClickOne() { |
| | | const code=await this.getAutoCode() |
| | | if (this.activeName == "first") { |
| | | this.form = { |
| | | number: idValue, |
| | | number: code, |
| | | finishDate:this.$moment(new Date()).format('YYYY-MM-DD'), |
| | | market: "", |
| | | workshopObj: "", |
| | |
| | | productId: 1, |
| | | position: "", |
| | | fineness: 0, |
| | | quantity: 0, |
| | | quantity: 1, |
| | | sum: "", |
| | | }, |
| | | ]; |
| | |
| | | delete finenessList[i].productId; |
| | | } |
| | | 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]); |
| | | } |
| | | }); |
| | | finenessList=[...mapFineness.values()].flat(Infinity); |
| | | let params = { |
| | | finenessList: finenessList, |
| | | ...form, |
| | |
| | | message: "保存成功!", |
| | | type: "success", |
| | | }); |
| | | |
| | | this.activeName = "second" |
| | | // this.$router.push({ |
| | | // path: "/productManage/silkRegisterForm", |
| | |
| | | }); |
| | | } else { |
| | | let paramsTwo = { |
| | | // ...form, |
| | | info:form, |
| | | items:this.tableTwoList.tableInfomation, |
| | | }; |
| | |
| | | this.getDetailsData(); |
| | | } |
| | | this.isAddloading = false; |
| | | }) |
| | | .catch(() => { |
| | | }).catch(() => { |
| | | setTimeout(() => { |
| | | this.isAddloading = false; |
| | | }, 3000); |
| | |
| | | } |
| | | |
| | | .list-view { |
| | | margin-top: 20px; |
| | | height: calc(100% - 180px); |
| | | min-height: 200px; |
| | | overflow-y: auto; |
| | |
| | | placeholder="" |
| | | :min="0" |
| | | :controls="false" |
| | | :disabled="!isOperate" |
| | | :disabled="!isOperate||item.noOperate" |
| | | size="mini" |
| | | style="width: 100%; margin-right: 5px" |
| | | @change=" |
| | |
| | | placeholder="" |
| | | :min="0" |
| | | :controls="false" |
| | | :disabled="!isOperate" |
| | | :disabled="!isOperate||item.noOperate" |
| | | size="mini" |
| | | @keydown.enter.native="moveToNextField($event,scope.$index)" |
| | | style="width: 100%; margin-right: 5px" |
| | | @change=" |
| | | (val) => { |
| | |
| | | @change=" |
| | | (val) => { |
| | | commonInputChange(val, item.prop, scope.row, scope) |
| | | } |
| | | " |
| | | }" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="70" v-if="!detailEnter" align="center" fixed='right'> |
| | | <template slot-scope="scope"> |
| | | |
| | | <el-button type="text" size="small" :disabled="!isOperate" @click="deleteClick(scope)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-checkbox-group> |
| | | </div> |
| | | </el-form> |
| | | <el-button style="margin: 10px" size="small" type="primary" @click="add">新增</el-button> |
| | | <!-- <el-button style="margin: 10px" size="small" type="primary" @click="add">新增</el-button>--> |
| | | <div v-if="!detailEnter" style="margin: 10px" > |
| | | <el-button size="small" type="primary" :disabled="!isOperate" @click="add">新增</el-button> |
| | | <!-- <el-button size="small" type="primary" disabled>导入明细</el-button> --> |
| | |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | moveToNextField(event,index){ |
| | | let inputs = document.querySelectorAll('.page-view input'); |
| | | let enabledInputs = Array.prototype.filter.call(inputs, function(input) { |
| | | return !input.disabled; |
| | | }); |
| | | if(index<enabledInputs.length-1){ |
| | | event.target.blur(); |
| | | enabledInputs[index+1].focus(); |
| | | } |
| | | }, |
| | | getMergeNumber(){ |
| | | let pattern=new RegExp("[0-9]+"); |
| | | if(pattern.test(this.showSummary.mergeNumber)){ |