| | |
| | | rules: { |
| | | number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur", "change"] }], |
| | | repository: [{ required: true, message: "请选择退入仓库", trigger: "change" }], |
| | | memberId: [{ required: true, message: "请选择负责人", trigger: "change" }], |
| | | memberId: [{ required: true, validator: this.validateMemberId, trigger: "change" }], |
| | | salesDetailNumber: [{ required: true, message: "请选择销售明细单", trigger: "change" }] |
| | | }, |
| | | memberOptions: [], |
| | |
| | | getAllData() |
| | | .then((res) => { |
| | | this.memberOptions = res.data.member |
| | | if (this.editConfig.title === "新建") { |
| | | let username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1") |
| | | this.memberOptions.map((item) => { |
| | | if (item.username == username) { |
| | | this.editConfig.infomation.memberId = item.id |
| | | } |
| | | }) |
| | | } |
| | | this.repositoryOptions = res.data.repository |
| | | this.statusOptions = res.data.salesReturnStatus |
| | | }) |
| | |
| | | this.tableData = item.products |
| | | this.tableData.map((item, index) => { |
| | | item.productId = index + 1 |
| | | this.selProductData.forEach((key) => { |
| | | if (item.number === key.number) { |
| | | item.amount = key.amount |
| | | item.id = key.id |
| | | } |
| | | }) |
| | | }) |
| | | this.productTableList.tableData = item.products |
| | | this.productTableList.tableData = this.tableData |
| | | this.selProductData.forEach((key) => { |
| | | this.tableData.forEach((row) => { |
| | | if (key.number === row.number) { |
| | |
| | | { label: "产品名称", prop: "name", productName: true, isRequird: true }, |
| | | { label: "产品编号", prop: "number" }, |
| | | { label: "数量", prop: "amount", inputNumber: true, isRequird: true }, |
| | | { label: "单位", prop: "unit" }, |
| | | { label: "销售单价", prop: "price", inputFloat: true }, |
| | | { label: "价税合计", prop: "total", inputFloat: true } |
| | | ] |
| | |
| | | getSelectArray(val) { |
| | | console.log(val, "cccccccccccccccccc") |
| | | this.selProductData = val |
| | | }, |
| | | // 销售负责人自定义校验规则 |
| | | validateMemberId(rule, value, callback) { |
| | | if (this.editConfig.infomation?.memberId > 0) { |
| | | callback() |
| | | } else { |
| | | callback(new Error("请选择销售负责人")) |
| | | } |
| | | } |
| | | } |
| | | } |