| | |
| | | " |
| | | value-key="number" |
| | | @select="handleSelectClient('master', $event)" |
| | | placeholder="请先选择客户名称" |
| | | :disabled="isAddMaster" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick('master')"> |
| | | <div v-if="!isAddMaster" class="common-select-btn" @click="selClientClick('master')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div |
| | | v-if=" |
| | | editConfig.infomation.master_order_number && |
| | | editConfig.infomation.master_order_number.length > 0 |
| | | editConfig.infomation.master_order_number.length > 0 && |
| | | !isAddMaster |
| | | " |
| | | class="common-select-btn" |
| | | @click="clearupClient('master')" |
| | |
| | | import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" |
| | | import WordInput from "@/components/wordInput.vue" |
| | | import codeMixin from "@/views/client/followupRecords/mixin/codeMixin" |
| | | import { getMasterOrderList } from "@/api/sales/masterOrder" |
| | | |
| | | export default { |
| | | name: "SubOrderDialog", |
| | |
| | | computed: { |
| | | clientList() { |
| | | return this.$store.state.getClientName.clientList |
| | | }, |
| | | masterOrderList() { |
| | | return this.$store.state.getClientName.masterOrderList |
| | | } |
| | | // masterOrderList() { |
| | | // return this.$store.state.getClientName.masterOrderList |
| | | // } |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | number: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | master_order_number: [{ required: true, message: "请选择或创建销售总单", trigger: "blur" }], |
| | | client_name: [{ required: true, message: "请选择", trigger: "change" }], |
| | | memberId: [{ required: true, message: "请选择", trigger: "change" }] |
| | | }, |
| | |
| | | tableData: [], |
| | | productId: 1, |
| | | addProductArr: [], |
| | | objCode: { name: "", page: 0, pageSize: 0, type: "销售子单编码", codeStandID: "" } |
| | | objCode: { name: "", page: 0, pageSize: 0, type: "销售子单编码", codeStandID: "" }, |
| | | isAddMaster: true, |
| | | masterOrderList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.$store.dispatch("geClient") |
| | | this.$store.dispatch("geMaster") |
| | | // this.$store.dispatch("geMaster") |
| | | this.setTableForm() |
| | | this.getCommonData() |
| | | this.formInfo() |
| | |
| | | // 保存 |
| | | saveClick(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | this.validateFormNumber() |
| | | if (valid) { |
| | | console.log(this.editConfig.infomation) |
| | | for (let i = 0; i < this.tableData.length; i++) { |
| | |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | | // 获取销售总单 |
| | | getMasterList(id) { |
| | | getMasterOrderList({ |
| | | page: 0, |
| | | pageSize: 0, |
| | | search_map: { |
| | | client_id: id |
| | | } |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.masterOrderList = res.data.list |
| | | } |
| | | }) |
| | | }, |
| | | // 选择客户相关方法 |
| | | querySearchAsync(queryString, cb, value) { |
| | | var restaurants = [] |
| | |
| | | handleSelectClient(value, item) { |
| | | if (value === "client") { |
| | | this.clientId = item.id |
| | | this.isAddMaster = false |
| | | this.getMasterList(item.id) |
| | | this.editConfig.infomation.master_order_number = "" |
| | | this.masterId = 0 |
| | | } else if (value === "master") { |
| | | this.editConfig.infomation.master_order_number = item.number |
| | | this.masterId = item.id |
| | | } |
| | | this.refresh() |
| | | }, |
| | | selClientClick(value) { |
| | | if (value == "client") { |
| | |
| | | } else if (value == "master") { |
| | | this.editSelectMasterConfig.title = "销售总单" |
| | | this.editSelectMasterConfig.editVisible = true |
| | | this.editSelectMasterConfig.clientId = this.clientId |
| | | this.editSelectMasterConfig.tableInfomation = [...this.masterOrderList] |
| | | } |
| | | }, |
| | | selClient(row, value) { |
| | | console.log(row) |
| | | if (value == "client") { |
| | | this.editConfig.infomation.client_name = row.name |
| | | this.editConfig.infomation.client_id = row.id |
| | | this.clientId = row.id |
| | | this.isAddMaster = false |
| | | this.getMasterList(row.id) |
| | | this.editConfig.infomation.master_order_number = "" |
| | | this.masterId = 0 |
| | | } else if (value == "master") { |
| | | this.editConfig.infomation.master_order_number = row.number |
| | | this.masterId = row.id |
| | |
| | | this.editConfig.infomation.client_name = "" |
| | | this.editConfig.infomation.client_id = 0 |
| | | this.clientId = 0 |
| | | this.isAddMaster = true |
| | | this.editConfig.infomation.master_order_number = "" |
| | | this.masterId = 0 |
| | | } else if (value == "master") { |
| | | this.editConfig.infomation.master_order_number = "" |
| | | this.masterId = 0 |