| | |
| | | :visible.sync="editConfig.visible" |
| | | :width="dialogWidth" |
| | | :before-close="handleClose" |
| | | append-to-body |
| | | custom-class="iframe-dialog" |
| | | > |
| | | <el-form |
| | | ref="form" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售总单" prop="masterOrderNumber"> |
| | | <el-form-item label="销售总单" prop="master_order_number"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.masterOrderNumber" |
| | | v-model="editConfig.infomation.master_order_number" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'master') |
| | |
| | | </el-row> |
| | | </div> |
| | | <!-- 附件信息 --> |
| | | <div class="basic-info-title">附件信息</div> |
| | | <!-- <div class="basic-info-title">附件信息</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </div> --> |
| | | <!-- 产品管理 --> |
| | | <div class="basic-info-title" style="display: flex"> |
| | | 产品管理 |
| | |
| | | </div> |
| | | </div> |
| | | <div class="product-view"> |
| | | <CommonFormTableView :product-table-list="productTableList" /> |
| | | <CommonFormTableView |
| | | :product-table-list="productTableList" |
| | | @inputContent="inputContent" |
| | | @addProductClick="addProductClick" |
| | | /> |
| | | </div> |
| | | <!-- 合计 --> |
| | | <div class="basic-info-view"> |
| | |
| | | infomation: {} |
| | | }, |
| | | clientId: this.editCommonConfig.infomation.client_id, |
| | | masterId: this.editCommonConfig.infomation.masterOrderId |
| | | masterId: this.editCommonConfig.infomation.masterOrderId, |
| | | tableData: [], |
| | | productId: 1, |
| | | addProductArr: [] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | dataProcess() { |
| | | this.masterOrderList.map((item) => { |
| | | if (this.masterId === item.id) { |
| | | this.editConfig.infomation.masterOrderNumber = item.number |
| | | this.editConfig.infomation.master_order_number = item.number |
| | | } |
| | | }) |
| | | }, |
| | |
| | | const params = this.saveParams() |
| | | console.log(params) |
| | | if (this.editConfig.title === "新建") { |
| | | getAddSubOrder(params) |
| | | .then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | message: "添加成功", |
| | | type: "success" |
| | | }) |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | | }) |
| | | getAddSubOrder(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | } else { |
| | | getUpdateSubOrder(params) |
| | | .then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message({ |
| | | message: "编辑成功", |
| | | type: "success" |
| | | }) |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | | }) |
| | | getUpdateSubOrder(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("编辑成功") |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | console.log("error submit") |
| | |
| | | let data = this.editConfig.infomation |
| | | let params = { |
| | | id: this.editConfig.title === "新建" ? 0 : data.id, |
| | | clientId: parseInt(this.clientId) || 0, |
| | | masterOrderId: parseInt(this.masterId) || 0, |
| | | clientId: this.clientId || 0, |
| | | masterOrderId: this.masterId || 0, |
| | | memberId: data.memberId || 0, |
| | | number: data.number || "", |
| | | product: [ |
| | | { |
| | | amount: 0, |
| | | desc: "", |
| | | id: 0, |
| | | name: "", |
| | | number: "", |
| | | price: 0, |
| | | total: 0 |
| | | } |
| | | ] |
| | | product: this.tableData |
| | | } |
| | | return params |
| | | }, |
| | |
| | | } else if (value == "master") { |
| | | this.editSelectMasterConfig.title = "销售总单" |
| | | this.editSelectMasterConfig.editVisible = true |
| | | this.editSelectMasterConfig.tableInfomation = [...this.masterOrderList] |
| | | } |
| | | }, |
| | | selClient(row, value) { |
| | |
| | | this.editConfig.infomation.client_id = row.id |
| | | this.clientId = row.id |
| | | } else if (value == "master") { |
| | | this.editConfig.infomation.masterOrderNumber = row.number |
| | | this.editConfig.infomation.master_order_number = row.number |
| | | this.masterId = row.id |
| | | } |
| | | }, |
| | |
| | | this.editConfig.infomation.client_id = 0 |
| | | this.clientId = 0 |
| | | } else if (value == "master") { |
| | | this.editConfig.infomation.masterOrderNumber = "" |
| | | this.editConfig.infomation.master_order_number = "" |
| | | this.masterId = 0 |
| | | } |
| | | }, |
| | |
| | | // 设置允许上传文件格式 |
| | | setFormatClick() {}, |
| | | setTableForm() { |
| | | this.productTableList = { |
| | | tableData: [ |
| | | if (this.editConfig.title === "新建") { |
| | | this.tableData = [ |
| | | { |
| | | id: "1", |
| | | productName: "上海有限公司", |
| | | other0: "ZDYBD03-1", |
| | | other1: "12", |
| | | other2: "", |
| | | other6: "3.00", |
| | | other7: "2.00" |
| | | id: 1, |
| | | Amount: 0, |
| | | IsSale: true, |
| | | MaterialMode: "", |
| | | MinInventory: 0, |
| | | Name: "", |
| | | Number: "", |
| | | PurchaseType: "", |
| | | SalePrice: 0, |
| | | Unit: "" |
| | | } |
| | | ], |
| | | ] |
| | | } else { |
| | | this.tableData = this.editConfig.infomation.products |
| | | } |
| | | this.productTableList = { |
| | | tableData: this.tableData, |
| | | tableColumn: [ |
| | | { label: "#", prop: "id", width: 40 }, |
| | | { label: "产品名称", prop: "productName", input: true, isRequird: true }, |
| | | { label: "产品编号", prop: "other0" }, |
| | | { label: "计量单位", prop: "other2" }, |
| | | { label: "规格编号", prop: "other3" }, |
| | | { label: "源单类型", prop: "other4" }, |
| | | { label: "合同信息", prop: "other5" }, |
| | | { label: "数量", prop: "other1", input: true, isRequird: true }, |
| | | { label: "含税单价", prop: "other6", input: true }, |
| | | { label: "价税合计", prop: "other7", input: true }, |
| | | { label: "产品名称", prop: "Name", input: true, isRequird: true }, |
| | | { label: "产品编号", prop: "Number" }, |
| | | { label: "数量", prop: "Amount", input: true, isRequird: true }, |
| | | { label: "销售单价", prop: "Unit", input: true }, |
| | | { label: "价税合计", prop: "other3", input: true }, |
| | | { label: "描述", prop: "other8" } |
| | | ] |
| | | } |
| | | }, |
| | | // 产品列表输入 |
| | | inputContent(val, prop, row) { |
| | | console.log("aaaaaaaa") |
| | | console.log(val, prop) |
| | | this.productId = row.id |
| | | this.tableData.map((item) => { |
| | | if (item.id === row.id) { |
| | | item[prop] = val |
| | | } |
| | | }) |
| | | console.log(this.tableData) |
| | | }, |
| | | // 产品新增 |
| | | addProductClick() { |
| | | this.productId++ |
| | | this.tableData.push({ |
| | | id: this.productId, |
| | | Amount: 0, |
| | | IsSale: true, |
| | | MaterialMode: "", |
| | | MinInventory: 0, |
| | | Name: "", |
| | | Number: "", |
| | | PurchaseType: "", |
| | | SalePrice: 0, |
| | | Unit: "" |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .add-quotation { |
| | | .basic-info { |
| | | .basic-info-title { |
| | | background-color: #f4f8fe; |
| | | padding-left: 10px; |
| | | font-size: 15px; |
| | | font-weight: bold; |
| | | color: #666; |
| | | height: 42px; |
| | | line-height: 42px; |
| | | } |
| | | .basic-info-view { |
| | | margin-top: 10px; |
| | | padding-right: 40px; |
| | | .custom-name { |
| | | ::v-deep { |
| | | .iframe-dialog .el-dialog__body { |
| | | .basic-info { |
| | | .basic-info-title { |
| | | background-color: #f4f8fe; |
| | | padding-left: 10px; |
| | | font-size: 15px; |
| | | font-weight: bold; |
| | | color: #666; |
| | | height: 42px; |
| | | line-height: 42px; |
| | | } |
| | | .basic-info-view { |
| | | margin-top: 10px; |
| | | padding-right: 40px; |
| | | .custom-name { |
| | | display: flex; |
| | | .common-select-btn { |
| | | margin-left: 5px; |
| | | font-size: 18px; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | .address-view { |
| | | margin-top: 10px; |
| | | padding-right: 40px; |
| | | } |
| | | .annex-view { |
| | | display: flex; |
| | | .common-select-btn { |
| | | margin-left: 5px; |
| | | font-size: 18px; |
| | | cursor: pointer; |
| | | color: #6166d3; |
| | | .setFormat { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | } |
| | | .address-view { |
| | | margin-top: 10px; |
| | | padding-right: 40px; |
| | | .dialog-footer { |
| | | background-color: #f5f5f5; |
| | | height: 55px; |
| | | line-height: 55px; |
| | | } |
| | | .annex-view { |
| | | display: flex; |
| | | color: #6166d3; |
| | | .setFormat { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | } |
| | | .dialog-footer { |
| | | background-color: #f5f5f5; |
| | | height: 55px; |
| | | line-height: 55px; |
| | | } |
| | | } |
| | | </style> |