| | |
| | | :disabled="editConfig.isDisabled" |
| | | v-model="editConfig.infomation.phone" |
| | | placeholder="请填写" |
| | | maxlength="11" |
| | | show-word-limit |
| | | clearable |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | <div class="basic-info-title" style="display: flex">产品信息</div> |
| | | <div class="product-view"> |
| | | <CommonFormTableView |
| | | :detailEnter=editCommonConfig.detailEnter |
| | | :show-summary="showSummary" |
| | | :recalculateShow="false" |
| | | :product-table-list="productTableList" |
| | |
| | | @addProductClick="addProductClick" |
| | | @emptyProductClick="emptyProductClick" |
| | | @clearupProduct="clearupProduct" |
| | | @rowClick="rowClick" |
| | | @handleProduct="handleProduct" |
| | | /> |
| | | </div> |
| | | <div class="table-bottom"> |
| | |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <!-- <el-button type="primary" size="small" @click="editConfig.visible = false">保并提交审批</el-button> --> |
| | | <el-button type="primary" size="small" @click="saveClick('form')" |
| | | <el-button type="primary" v-if="this.editConfig.title != '查看'" size="small" @click="saveClick('form')" |
| | | >保存</el-button |
| | | > |
| | | <el-button size="small" @click="editConfig.visible = false" |
| | | <el-button size="small" v-if="this.editConfig.title != '查看'" @click="editConfig.visible = false" |
| | | >取消</el-button |
| | | > |
| | | </div> |
| | |
| | | <script> |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView"; |
| | | import BomDialog from "@/components/makepager/BomDialog"; |
| | | import { getProductList } from "@/api/productManage/product" |
| | | |
| | | import { |
| | | addPurchase, |
| | |
| | | } from "@/api/purchaseManage/purchase"; |
| | | |
| | | import SelectSupplierDialog from "@/views/purchaseManage/purchase/components/SelectSupplierDialog"; |
| | | // import { formToJSON } from "axios"; |
| | | export default { |
| | | name: "QuotationDialog", |
| | | components: { SelectSupplierDialog, CommonFormTableView,BomDialog }, |
| | |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | detailEnter:true, |
| | | visible: false, |
| | | title: "创建", |
| | | infomation: {}, |
| | |
| | | }, |
| | | supplierId: this.editCommonConfig.infomation.supplierId, |
| | | tableData: [], |
| | | productId: 1, |
| | | productIndex: 0, |
| | | productId:'', |
| | | isNoProduct: true, |
| | | clientList: [], |
| | | plcBrandList:[], |
| | |
| | | }, |
| | | total:0, |
| | | totalTwo:0, |
| | | productListIdx:0 |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | }, |
| | | // 选择客户相关方法 |
| | | querySearchAsync(queryString, cb, value) { |
| | | this.productTableList.tableProductList=[] |
| | | var restaurants = []; |
| | | if (value === "supplier") { |
| | | restaurants = this.supplierList; |
| | |
| | | ); |
| | | }; |
| | | }, |
| | | handleSelectClient(value, item) { |
| | | async handleSelectClient(value, item) { |
| | | this.productTableList.supplierId=item.ID |
| | | if (value === "client") { |
| | | this.supplierId = item.id; |
| | | this.editConfig.infomation.supplierId=item.ID |
| | | } |
| | | await getProductList({ |
| | | supplierId:item.ID, |
| | | page:1, |
| | | pageSize:100 |
| | | }).then((res)=>{ |
| | | if(res.code===200){ |
| | | this.productTableList.tableProductList = res.data.list |
| | | console.log(this.productTableList.tableProductList,"pop") |
| | | } |
| | | }) |
| | | }, |
| | | selClientClick() { |
| | | this.editSelectSupplierConfig.editVisible = true; |
| | |
| | | }, |
| | | // 清除已选择用户 |
| | | clearupClient(value) { |
| | | this.emptyProductClick() |
| | | if (value == "client") { |
| | | this.$set(this.editConfig.infomation, "supplierName", ""); |
| | | this.supplierId = null; |
| | |
| | | this.tableData = [ |
| | | { |
| | | productId: this.productId, |
| | | productIndex:this.productIndex, |
| | | id: 0, |
| | | amount: 0, |
| | | desc: "", |
| | |
| | | // }); |
| | | } |
| | | this.productTableList = { |
| | | tableProductList:[], |
| | | supplierId:undefined, |
| | | tableData: this.tableData, |
| | | disabled:this.editConfig.isDisabled, |
| | | tableColumn: [ |
| | |
| | | }, |
| | | // 产品列表输入 |
| | | inputContent(val, prop, row) { |
| | | this.productId = row.productId; |
| | | // this.productId = row.productId; |
| | | this.productIndex=row.productIndex; |
| | | console.log(row,val,prop,"产品ID",this.tableData) |
| | | this.tableData.map((item) => { |
| | | if (item.productId === row.productId) { |
| | | if (item.productIndex === row.productIndex) { |
| | | item[prop] = val; |
| | | } |
| | | }); |
| | |
| | | }, |
| | | // 产品新增 |
| | | addProductClick() { |
| | | this.productId++; |
| | | this.productIndex++; |
| | | this.tableData.push({ |
| | | productId: this.productId, |
| | | productIndex: this.productIndex, |
| | | productId:'', |
| | | id: 0, |
| | | amount: 0, |
| | | desc: "", |
| | |
| | | }, |
| | | // 产品清空 |
| | | emptyProductClick() { |
| | | this.productId = 1; |
| | | this.productIndex = 1; |
| | | this.tableData = [ |
| | | { |
| | | productId: this.productId, |
| | | productId: '', |
| | | productIndex:this.productIndex, |
| | | id: 0, |
| | | amount: 0, |
| | | desc: "", |
| | |
| | | this.tableData = data; |
| | | this.productTableList.tableData = this.tableData; |
| | | }, |
| | | //选择行 |
| | | rowClick(row){ |
| | | console.log(row,"xuanze") |
| | | this.productListIdx=row.productIndex |
| | | }, |
| | | //选中产品 |
| | | handleProduct(item){ |
| | | this.tableData[this.productListIdx].productId=item.ID |
| | | console.log(item,"选中产品",this.tableData) |
| | | } |
| | | }, |
| | | }; |
| | | </script> |