| | |
| | | <template> |
| | | <el-dialog |
| | | width="75%" |
| | | top="10vh" |
| | | top="5vh" |
| | | :fullscreen="isFullScreen" |
| | | :close-on-click-modal="false" |
| | | :visible.sync="visible" |
| | |
| | | <el-input |
| | | v-model="dataForm.contractNo" |
| | | placeholder="" |
| | | disabled |
| | | |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="业务员" prop="salesMan"> |
| | | <el-select @change="selsctionSales" clearable filterable v-model="salesSelectData" style="width:100%"> |
| | | <!-- salesMan --> |
| | | <el-input v-model="dataForm.salesMan" placeholder=""></el-input> |
| | | <!-- <el-select @change="selsctionSales" clearable filterable v-model="salesSelectData" style="width:100%"> |
| | | <el-option v-for="(item,index) in staffOptions" :key="index" :value="item.staffNo+','+item.staffName" :label="item.staffName"/> |
| | | </el-select> |
| | | </el-select> --> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | |
| | | } |
| | | </style> |
| | | <script> |
| | | import { addObj } from '@/api/plan/customer' |
| | | import { saveOrUpdate } from '@/api/plan/customer' |
| | | import { getCustomerMainAndOrderBycNo } from '@/api/plan/customerorder' |
| | | import { remote } from '@/api/admin/dict' |
| | | import PartDialog from '@/views/common/part.vue' |
| | | import {dateFormat} from '@/util/date' |
| | |
| | | currentSelectRow: 0, |
| | | option: tableOption, |
| | | tableData: [{ |
| | | "$cellEdit": true, |
| | | "$index": 0, |
| | | "partNo": "", |
| | | "customerPartSpec": "", |
| | | "manufactureAttr": "", |
| | | "productName": "", |
| | | "productType": "", |
| | | "otcUnit": "", |
| | | "buyQtyDue": "", |
| | | "shippingAddress": "", |
| | | "remark": "", |
| | | "isTrusted": true |
| | | id: null, |
| | | $cellEdit: true, |
| | | $index: 0, |
| | | partNo: "", |
| | | customerPartSpec: "", |
| | | manufactureAttr: "", |
| | | productName: "", |
| | | productType: "", |
| | | otcUnit: "", |
| | | buyQtyDue: "", |
| | | shippingAddress: "", |
| | | remark: "", |
| | | isTrusted: true |
| | | }], |
| | | staffOptions: [], |
| | | title: '', |
| | |
| | | buttonDisable: false, |
| | | showPart: false, |
| | | dataForm: { |
| | | id: null, |
| | | contractNo: null, |
| | | customerName: null, |
| | | customerNo: null, |
| | |
| | | this.staffOptions = response.data.data |
| | | }) |
| | | }, |
| | | init(id) { |
| | | this.initDataForm() |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.title = '新增' |
| | | }) |
| | | init(contractNo) { |
| | | if(contractNo){ |
| | | getCustomerMainAndOrderBycNo(contractNo).then(res=>{ |
| | | if(res.status===200){ |
| | | let data = res.data.data |
| | | this.dataForm.id = data.id |
| | | this.dataForm.contractNo = data.contractNo |
| | | this.dataForm.customerName = data.customerName |
| | | this.dataForm.entityName = data.entityName |
| | | this.dataForm.province = data.province |
| | | this.salesSelectData = data.salesMan |
| | | this.dataForm.salesMan = data.salesMan |
| | | this.dataForm.originalContractStatus = data.originalContractStatus |
| | | this.dataForm.isCp = data.isCp |
| | | this.dataForm.customerNo = data.customerNo |
| | | this.dataForm.returnStatus = data.returnStatus |
| | | this.dataForm.placeOrderDate = data.placeOrderDate |
| | | this.dataForm.factoryPlaceOrderDate = data.factoryPlaceOrderDate |
| | | this.dataForm.deliveryDate = data.deliveryDate |
| | | this.dataForm.comment = data.comment |
| | | data.customerOrderVOList.forEach(e=>{ |
| | | e.$cellEdit = true |
| | | }) |
| | | this.tableData = data.customerOrderVOList |
| | | console.log(this.dataForm); |
| | | } |
| | | }).catch(error=>{ |
| | | console.error(error) |
| | | }) |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.title = '编辑' |
| | | }) |
| | | }else{ |
| | | this.initDataForm() |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.title = '新增' |
| | | }) |
| | | } |
| | | }, |
| | | initDataForm() { |
| | | this.dataForm.contractNo = null |
| | |
| | | this.dataForm.deliveryDate = null |
| | | this.dataForm.comment = null |
| | | this.dataForm.customerOrderVOList = [{ |
| | | "$cellEdit": true, |
| | | "$index": 0, |
| | | "partNo": "", |
| | | "customerPartSpec": "", |
| | | "manufactureAttr": "", |
| | | "productName": "", |
| | | "productType": "", |
| | | "otcUnit": "", |
| | | "buyQtyDue": "", |
| | | "shippingAddress": "", |
| | | "remark": "", |
| | | "isTrusted": true |
| | | id: null, |
| | | $cellEdit: true, |
| | | $index: 0, |
| | | partNo: "", |
| | | customerPartSpec: "", |
| | | manufactureAttr: "", |
| | | productName: "", |
| | | productType: "", |
| | | otcUnit: "", |
| | | buyQtyDue: "", |
| | | shippingAddress: "", |
| | | remark: "", |
| | | isTrusted: true |
| | | }] |
| | | }, |
| | | // 表单提交 |
| | |
| | | _than.$refs.dataForm.validate((valid) => { |
| | | if (valid) { |
| | | _than.dataForm.customerOrderVOList = _than.tableData |
| | | addObj(_than.dataForm).then((data) => { |
| | | _than.$message.success('添加成功') |
| | | _than.initDataForm(); |
| | | _than.visible = false |
| | | _than.buttonDisable = false |
| | | _than.$emit('refreshDataList', 1) |
| | | saveOrUpdate(_than.dataForm).then((res) => { |
| | | if(res.status===200){ |
| | | if(_than.dataForm.id){ |
| | | _than.$message.success('更新成功') |
| | | }else{ |
| | | _than.$message.success('添加成功') |
| | | } |
| | | _than.initDataForm(); |
| | | _than.visible = false |
| | | _than.buttonDisable = false |
| | | _than.$emit('refreshDataList', 1) |
| | | } |
| | | }).catch((error) => { |
| | | _than.buttonDisable = false |
| | | }) |
| | |
| | | const index = this.currentSelectRow |
| | | if (part) { |
| | | this.tableData[index].partNo = part.partNo |
| | | this.tableData[index].customerPartSpec = part.specs |
| | | this.tableData[index].productName = part.partName |
| | | // this.tableData[index].customerPartSpec = part.specs |
| | | // this.tableData[index].productName = part.partName |
| | | } |
| | | }, |
| | | // 全屏 |