| | |
| | | id:4, |
| | | }, |
| | | ] |
| | | |
| | | // 质检单状态 |
| | | const qualityStatus=[ |
| | | { |
| | | name:'待质检', |
| | | id:1, |
| | | }, |
| | | { |
| | | name:'已完成', |
| | | id:2, |
| | | } |
| | | ] |
| | | // 退货单状态 |
| | | const returnedStatus=[ |
| | | { |
| | | name:'待发货', |
| | | id:1, |
| | | }, |
| | | { |
| | | name:'待签收', |
| | | id:2, |
| | | }, |
| | | { |
| | | name:'待发货', |
| | | id:3, |
| | | }, |
| | | { |
| | | name:'已完成', |
| | | id:4, |
| | | }, |
| | | ] |
| | | |
| | | export const getDataByType = type => { |
| | | if(type =='purchaseStatus'){ |
| | | return purchaseStatus; |
| | | }else if(type=='qualityStatus'){ |
| | | return qualityStatus; |
| | | }else if(type=='returnedStatus'){ |
| | | return returnedStatus; |
| | | } |
| | | } |
| | |
| | | data |
| | | }) |
| | | } |
| | | // 新建采购类型 |
| | | export function savePurchaseType(data) { |
| | | return request({ |
| | | url: "/api/purchase/purchaseType", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 获取采购类型 |
| | | export function getPurchaseType(data) { |
| | | return request({ |
| | | url: "/api/purchase/purchaseTypeList", |
| | | method: "get", |
| | | data |
| | | }) |
| | | } |
| | |
| | | </template> |
| | | <el-menu-item index="/purchaseManage/purchase">采购订单</el-menu-item> |
| | | <el-menu-item index="/purchaseManage/quality">采购质检单</el-menu-item> |
| | | <el-menu-item index="/purchaseManage/warehouse">采购入库单</el-menu-item> |
| | | <!-- <el-menu-item index="/purchaseManage/warehouse">采购入库单</el-menu-item> --> |
| | | <el-menu-item index="/purchaseManage/returned">采购退货单</el-menu-item> |
| | | </el-submenu> |
| | | <el-submenu index="3"> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="createdAt" label="设为默认"> |
| | | <template slot-scope="scope"> |
| | | <el-switch @change="switchChange(scope,scope.row.isDefault)" v-model="scope.row.isDefault"></el-switch> |
| | | <el-switch @change="switchChange(scope,scope.row[editRow.isDefault])" v-model="scope.row[editRow.isDefault]"></el-switch> |
| | | </template> |
| | | |
| | | </el-table-column> |
| | |
| | | editRow: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | return { |
| | | isDefault:'isDefault' |
| | | }; |
| | | }, |
| | | }, |
| | | workList:{ |
| | |
| | | return { |
| | | editDialogVisible: false, |
| | | isTableShow:true, |
| | | form: {}, |
| | | BomTableData: [1], |
| | | work: 1, |
| | | flag: "add", |
| | | Tabs: "msg", |
| | | tableData: [ |
| | | { |
| | | date: "PEBU", |
| | | name: "PE布", |
| | | number: "21", |
| | | unit: "吨", |
| | | }, |
| | | ], |
| | | rules: { |
| | | id: [{ required: true, message: "请输入物料编码", trigger: "blur" }], |
| | | name: [ |
| | | { required: true, message: "请输入物料名称", trigger: "blur" }, |
| | | |
| | | ], |
| | | specs: [{ required: true, message: "请输入物料规格", trigger: "blur" }], |
| | | type: [{ required: true, message: "请输入物料型号", trigger: "blur" }], |
| | | amount: [ |
| | | { |
| | | required: true, |
| | | message: "请输入数量", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | unit: [ |
| | | { |
| | | required: true, |
| | | message: "请输入单位", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | model: [ |
| | | { required: true, message: "请选择物料类型", trigger: "change" }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | }, |
| | | methods: { |
| | | handleAdd() { |
| | | this.BomTableData.push({name:'',isDefault:false}); |
| | | this.BomTableData.push({name:'',[this.editRow.isDefault]:false,sort:this.BomTableData.length}); |
| | | }, |
| | | handleDelete(scope) { |
| | | this.BomTableData.splice(scope.$index,1) |
| | |
| | | switchChange(scope,val){ |
| | | let arr=[] |
| | | for(let i in this.BomTableData){ |
| | | if(this.BomTableData[i].isDefault){ |
| | | if(this.BomTableData[i][this.editRow.isDefault]){ |
| | | arr.push(i) |
| | | } |
| | | } |
| | |
| | | message: '只能设一个为默认', |
| | | type: "warning", |
| | | }); |
| | | scope.row.isDefault=!val |
| | | scope.row[this.editRow.isDefault]=!val |
| | | } |
| | | }, |
| | | handleConfirmSave() { |
| | | let arr=[] |
| | | for(let i in this.BomTableData){ |
| | | if(this.BomTableData[i].isDefault){ |
| | | if(this.BomTableData[i][this.editRow.isDefault]){ |
| | | arr.push(i) |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | ::v-deep { |
| | | .el-table__footer-wrapper tbody td.el-table__cell { |
| | | background-color: #fff; |
| | | text-align: right; |
| | | .el-table__footer-wrapper { |
| | | tbody td.el-table__cell{ |
| | | background-color: #fff; |
| | | } |
| | | // .cell{ |
| | | // &:nth-last-child(3){ |
| | | // text-align:right; |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | |
| | | <script> |
| | | import { deletePurchase } from "@/api/purchaseManage/purchase"; |
| | | import { getDataByType } from "@/api/data"; |
| | | export default { |
| | | name: "DetailSupplier", |
| | | props: { |
| | |
| | | tableList: {}, |
| | | showSummary:{ |
| | | show: true, |
| | | sumProp: ["number", "total"], |
| | | mergeNumber: 4, |
| | | sumProp: ["amount", "total"], |
| | | mergeNumber: 5, |
| | | totalName:'小计' |
| | | }, |
| | | purchaseStatusList:getDataByType('purchaseStatus'), |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | mounted() {}, |
| | | computed: {}, |
| | | methods: { |
| | | getpurchaseStatus(val) { |
| | | if (val) { |
| | | for (let i in this.purchaseStatusList) { |
| | | if (this.purchaseStatusList[i].id == val) { |
| | | return this.purchaseStatusList[i].name; |
| | | } |
| | | } |
| | | } else { |
| | | return "--"; |
| | | } |
| | | }, |
| | | // email 通知下单 |
| | | emailClick() {}, |
| | | // 删除 |
| | |
| | | }, |
| | | { |
| | | leftStr: "采购单状态", |
| | | leftValue: item.contact_name, |
| | | leftValue: this.getpurchaseStatus(item.status), |
| | | rightStr: "采购负责人", |
| | | rightValue: item.contact_position, |
| | | }, |
| | |
| | | }, |
| | | { |
| | | leftStr: "到货仓库", |
| | | leftValue: item.sales_resources, |
| | | leftValue: item.warehouse, |
| | | rightStr: "", |
| | | rightValue: "", |
| | | }, |
| | |
| | | tableInfomation: item.productList?item.productList:[], |
| | | selectIndex: true, |
| | | tableColumn: [ |
| | | { label: "产品名称", prop: "name", min: 190, isCommonClick: true }, |
| | | { label: "产品编码", prop: "number", min: 130, isCommonClick: true }, |
| | | { label: "产品名称", prop: "name", min: 160, }, |
| | | { label: "产品编码", prop: "number", min: 130, }, |
| | | { label: "计量单位", prop: "unit", min: 130 }, |
| | | { label: "规格型号", prop: "specifications", min: 130 }, |
| | | { label: "数量", prop: "amount", min: 130 }, |
| | |
| | | > |
| | | <el-option |
| | | v-for="ele in plcBrandList" |
| | | :key="ele.id" |
| | | :key="ele.name" |
| | | :label="ele.name" |
| | | :value="ele.name" |
| | | :value="ele.ID" |
| | | ></el-option> |
| | | </el-select> |
| | | <i |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="单据来源" prop="number"> |
| | | <el-form-item label="单据来源" prop="orderSource"> |
| | | <el-input |
| | | v-model="editConfig.infomation.number" |
| | | v-model="editConfig.infomation.orderSource" |
| | | disabled |
| | | placeholder="请填写" |
| | | ></el-input> |
| | |
| | | <div class="table-bottom-l"> |
| | | <el-form-item label="整单折扣" prop="member_id"> |
| | | <el-select |
| | | v-model="editConfig.infomation.fieldName" |
| | | v-model="editConfig.infomation.wholeDiscountType" |
| | | placeholder="请选择" |
| | | filterable |
| | | > |
| | |
| | | <div class="table-bottom-r"> |
| | | <el-form-item label="" prop="member_id"> |
| | | <el-input |
| | | v-model="editConfig.infomation.number" |
| | | v-model="editConfig.infomation.wholeDiscount" |
| | | size="mini" |
| | | placeholder="请填写" |
| | | ></el-input> |
| | |
| | | <div class="table-bottom-l"> |
| | | <el-form-item label="调整" prop="member_id"> |
| | | <el-select |
| | | v-model="editConfig.infomation.fieldName" |
| | | v-model="editConfig.infomation.priceAdjustmentType" |
| | | placeholder="请选择" |
| | | filterable |
| | | > |
| | |
| | | <div class="table-bottom-r"> |
| | | <el-form-item label="" prop="member_id"> |
| | | <el-input |
| | | v-model="editConfig.infomation.number" |
| | | v-model="editConfig.infomation.priceAdjustment" |
| | | size="mini" |
| | | placeholder="请填写" |
| | | ></el-input> |
| | |
| | | </div> |
| | | <div class="table-bottom-item"> |
| | | <div class="table-bottom-l">合计</div> |
| | | <div class="table-bottom-r">26000.00</div> |
| | | <div class="table-bottom-r">{{ editConfig.infomation.realTotalPrice }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | ref="editDialog" |
| | | @sucessSet="handleGetBomKindDictList" |
| | | @handleConfirmSave="handleConfirmSave" |
| | | :editRow="editRow" |
| | | :workList="plcBrandList" |
| | | title="采购类型" |
| | | ></BomDialog> |
| | |
| | | import { |
| | | addPurchase, |
| | | updatePurchase, |
| | | savePurchaseType, |
| | | getPurchaseType, |
| | | } from "@/api/purchaseManage/purchase"; |
| | | // import { |
| | | // postGetUnitDictList, |
| | | // postGetSaveSUnitDict, |
| | | // } from "@/api/purchaseManage/purchase"; |
| | | |
| | | import SelectSupplierDialog from "@/views/purchaseManage/purchase/components/SelectSupplierDialog"; |
| | | export default { |
| | | name: "QuotationDialog", |
| | |
| | | return { |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | purchaseTypeId:[{ required: true, message: "请选择", trigger: "change" }], |
| | | supplierName: [{ required: true, message: "请选择", trigger: "change" }], |
| | | phone: [ |
| | | { |
| | |
| | | trigger: "change", |
| | | }, |
| | | { validator: this.validatorPhone, trigger: "change" }, |
| | | ], |
| | | wholeDiscount: [ |
| | | { |
| | | required: false, |
| | | message: "请填写", |
| | | trigger: "change", |
| | | }, |
| | | { validator: this.validatorNum, trigger: "change" }, |
| | | ], |
| | | priceAdjustment: [ |
| | | { |
| | | required: false, |
| | | message: "请填写", |
| | | trigger: "change", |
| | | }, |
| | | { validator: this.validatorNumThree, trigger: "change" }, |
| | | ], |
| | | }, |
| | | productTableList: {}, |
| | |
| | | isNoProduct: true, |
| | | clientList: [], |
| | | plcBrandList:[], |
| | | editRow:{ |
| | | isDefault:'pin' |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | 'editCommonConfig.visible':{ |
| | | immediate:true, |
| | | handler:function(){ |
| | | |
| | | this.setTableForm(); |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | validatorNum(rule, value, callback) { |
| | | if (value) { |
| | | if (value == undefined || value == null) { |
| | | callback(new Error("请输入有效数字")); |
| | | } else { |
| | | var reg = /^\+?[0-9]\d*$/; |
| | | if (!reg.test(value)) { |
| | | callback(new Error("请填写不小于0的数字")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | validatorNumThree(rule, value, callback){ |
| | | if(value){ |
| | | if(value==undefined||value==null){ |
| | | callback(new Error("请输入有效数字")); |
| | | }else{ |
| | | let reg2=/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/ |
| | | if(!reg2.test(value)){ |
| | | callback(new Error('请填写2位小数的数字')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | }else{ |
| | | callback() |
| | | } |
| | | }, |
| | | // PLC配置设置 |
| | | handleShow() { |
| | | // this.handleGetBomKindDictList(); |
| | | this.handleGetBomKindDictList(); |
| | | this.$refs.editDialog.editDialogVisible = true; |
| | | }, |
| | | // PLC配置 |
| | | handleGetBomKindDictList(val) { |
| | | console.log(val,'val') |
| | | // postGetUnitDictList().then((res) => { |
| | | // this.plcBrandList = res.data; |
| | | // if (val) { |
| | | // for (let i in this.plcBrandList) { |
| | | // if (this.plcBrandList[i].isDefault) { |
| | | // this.form.unit = this.form.unit |
| | | // ? this.form.unit |
| | | // : this.plcBrandList[i].name; |
| | | // this.$set(this.form, "unit", this.form.unit); |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | // }); |
| | | getPurchaseType().then((res) => { |
| | | this.plcBrandList = res.data; |
| | | if (val) { |
| | | for (let i in this.plcBrandList) { |
| | | if (this.plcBrandList[i][this.editRow.isDefault]) { |
| | | this.editConfig.infomation.purchaseTypeId = this.editConfig.infomation.purchaseTypeId |
| | | ? this.editConfig.infomation.purchaseTypeId |
| | | : this.plcBrandList[i].ID; |
| | | this.$set(this.editConfig.infomation, "purchaseTypeId", this.editConfig.infomation.purchaseTypeId); |
| | | |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | handleConfirmSave(data) { |
| | | console.log(data,'data') |
| | | // postGetSaveSUnitDict({ data: data }).then((res) => { |
| | | // if (res.code == 200) { |
| | | // this.$message({ |
| | | // message: "操作成功!", |
| | | // type: "success", |
| | | // }); |
| | | // this.$refs.editDialog.editDialogVisible = false; |
| | | // this.handleGetBomKindDictList(); |
| | | // } |
| | | // }); |
| | | savePurchaseType(data).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: "操作成功!", |
| | | type: "success", |
| | | }); |
| | | this.$refs.editDialog.editDialogVisible = false; |
| | | this.handleGetBomKindDictList(true); |
| | | } |
| | | }); |
| | | }, |
| | | validatorPhone(rule, value, callback) { |
| | | if (value) { |
| | |
| | | }); |
| | | }, |
| | | saveParams() { |
| | | debugger |
| | | let data =JSON.parse(JSON.stringify(this.editConfig.infomation)); |
| | | let params = { |
| | | productList:this.tableData, |
| | |
| | | supplierId:this.supplierId||0, |
| | | signingDate:data.signingDate||'', |
| | | remark:data.remark, |
| | | purchaseTypeId:this.purchaseTypeId||0, |
| | | orderSource:data.orderSource||'', |
| | | purchaseTypeId:data.purchaseTypeId||0, |
| | | phone:data.phone||'', |
| | | name:data.name||'', |
| | | deliveryDate:data.deliveryDate||'', |
| | | contact:data.contact |
| | | contact:data.contact, |
| | | wholeDiscountType:data.wholeDiscountType, |
| | | wholeDiscount:Number(data.wholeDiscount), |
| | | priceAdjustmentType:data.priceAdjustmentType, |
| | | priceAdjustment:Number(data.priceAdjustment), |
| | | realTotalPrice:data.realTotalPrice||'', |
| | | } |
| | | }; |
| | | if(data.ID){ |
| | |
| | | { |
| | | label: "产品名称", |
| | | prop: "name", |
| | | min: 170, |
| | | productName: true, |
| | | isRequird: true, |
| | | }, |
| | |
| | | { label: "描述", prop: "remark", input: true }, |
| | | ], |
| | | }; |
| | | this.handleGetBomKindDictList(true); |
| | | }, |
| | | // 产品列表输入 |
| | | inputContent(val, prop, row) { |
| | |
| | | @selCommonClick="selCommonClick" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="状态" width="120"> |
| | | <template slot-scope="scope"> |
| | | {{ getpurchaseStatus(scope.row.status) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="120" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" @click="editClick(scope.row)" style="margin-right: 5px" |
| | |
| | | visible: false, |
| | | infomation: {} |
| | | }, |
| | | search_map: {}, |
| | | search:'', |
| | | editRow:{}, |
| | | editConfig: { |
| | | visible: false, |
| | |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | getpurchaseStatus(val) { |
| | | if (val) { |
| | | for (let i in this.purchaseStatusList) { |
| | | if (this.purchaseStatusList[i].id == val) { |
| | | return this.purchaseStatusList[i].name; |
| | | } |
| | | } |
| | | } else { |
| | | return "--"; |
| | | } |
| | | }, |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | |
| | | tableColumn: [ |
| | | { label: "采购单号", prop: "number", min: 150, isCommonClick: true }, |
| | | { label: "采购单名称", prop: "name", min: 130, isCommonClick: true}, |
| | | { label: "单据类型", prop: "contact_name", min: 130 }, |
| | | { label: "单据类型", prop: "orderType", min: 130 }, |
| | | { label: "供应商名称", prop: "contact", min: 130 }, |
| | | { label: "采购数量", prop: "sales_resources", min: 130 }, |
| | | { label: "收货仓库", prop: "province", min: 130 }, |
| | | { label: "经办人", prop: "city", min: 130 }, |
| | | { label: "制单人", prop: "member_name", min: 130 }, |
| | | { label: "状态", prop: "member_name", min: 130 }, |
| | | { label: "采购数量", prop: "quantity", min: 130 }, |
| | | { label: "收货仓库", prop: "warehouse", min: 130 }, |
| | | { label: "经办人", prop: "handledBy", min: 130 }, |
| | | { label: "制单人", prop: "creator", min: 130 }, |
| | | ] |
| | | } |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | | await getPurchaseList({ |
| | | keyword: this.search_map, |
| | | keyword: this.search, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }) |
| | |
| | | // 搜索 |
| | | searchClick(val, content) { |
| | | console.log(val, content) |
| | | this.search_map = { |
| | | [val.value]: content |
| | | } |
| | | this.search = content |
| | | this.getData() |
| | | }, |
| | | resetClick() { |
| | | this.search_map = {} |
| | | this.search = '' |
| | | this.getData() |
| | | }, |
| | | // 新建 |
| | |
| | | this.editConfig.title = "创建" |
| | | this.editConfig.infomation = { |
| | | productList:[], |
| | | purchaseTypeId:'', |
| | | supplierId:'', |
| | | supplierName:'', |
| | | orderSource:'手动创建', |
| | | name:'', |
| | | contact:'', |
| | | phone:'', |
| | | signingDate:'', |
| | | remark:'', |
| | | purchaseTypeId:'', |
| | | phone:'', |
| | | name:'', |
| | | deliveryDate:'', |
| | | contact:'' |
| | | remark:'', |
| | | } |
| | | }, |
| | | |
| | |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.infomation = { |
| | | productList:res.data.productList, |
| | | ...res.data.purchase |
| | | supplierName:res.data.purchase.supplier.name, |
| | | ...res.data.purchase, |
| | | } |
| | | }else{ |
| | | this.$message.error(res.msg?res.msg+',':''+'获取信息失败!') |
| | |
| | | ref="tableListRef" |
| | | :table-list="tableList" |
| | | @selCommonClick="selCommonClick" |
| | | @getSelectArray="getSelectArray" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="状态" width="120"> |
| | | <template slot-scope="scope"> |
| | | {{ getQualityStatus(scope.row.member_name) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="120" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="qualityClick(scope.row)" type="text" size="small">去质检</el-button> |
| | |
| | | |
| | | <script> |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead" |
| | | import { |
| | | getPurchaseList,getPurchaseInfo,submitPurchase, |
| | | } from "@/api/purchaseManage/purchase"; |
| | | import DetailSupplier from "@/views/purchaseManage/quality/DetailSupplier" |
| | | |
| | | import { getDataByType } from "@/api/data"; |
| | | export default { |
| | | name: "SupplierManage", |
| | | props: {}, |
| | |
| | | visible: false, |
| | | infomation: {} |
| | | }, |
| | | search_map: {} |
| | | search: {}, |
| | | qualityStatusList:getDataByType('qualityStatus'), |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | getQualityStatus(val) { |
| | | if (val) { |
| | | for (let i in this.qualityStatusList) { |
| | | if (this.qualityStatusList[i].id == val) { |
| | | return this.qualityStatusList[i].name; |
| | | } |
| | | } |
| | | } else { |
| | | return "--"; |
| | | } |
| | | }, |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | |
| | | { label: "到货仓库", prop: "sales_resources", min: 130 }, |
| | | { label: "质检数量", prop: "province", min: 130 }, |
| | | { label: "检验员", prop: "city", min: 130 }, |
| | | { label: "状态", prop: "member_name", min: 110 }, |
| | | // { label: "状态", prop: "member_name", min: 110 }, |
| | | { label: "质检时间", prop: "member_name", min: 150 }, |
| | | ] |
| | | } |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | | await getSalesLeadsList({ |
| | | search_map: this.search_map, |
| | | await getPurchaseList({ |
| | | keyword: this.search, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }) |
| | | .then((res) => { |
| | | const list = res.data.list.map((item) => { |
| | | return { |
| | | ...item, |
| | | province: item.Province.name, |
| | | city: item.City.name, |
| | | sales_resources: item.sales_sources.name, |
| | | member_name: item.member.username |
| | | } |
| | | }) |
| | | const list = res.data.data.list |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.count |
| | | this.pagerOptions.totalCount = res.data.data.total |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | |
| | | // 搜索 |
| | | searchClick(val, content) { |
| | | console.log(val, content) |
| | | this.search_map = { |
| | | [val.value]: content |
| | | } |
| | | this.search = content |
| | | this.getData() |
| | | }, |
| | | resetClick() { |
| | | this.search_map = {} |
| | | this.search = '' |
| | | this.getData() |
| | | }, |
| | | |
| | |
| | | }) |
| | | .then(() => { |
| | | console.log("dddd") |
| | | getDeleteSalesLeads({ ids: this.selValueList }).then((response) => { |
| | | submitPurchase({ ids: this.selValueList }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("确认发货成功") |
| | | this.getData() |
| | |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | getSelectArray(val) { |
| | | this.selValueList = [] |
| | | const list = val.map((item) => { |
| | | return item.id |
| | | }) |
| | | this.selValueList = list |
| | | }, |
| | | |
| | | // 详情 |
| | | selCommonClick(row) { |
| | | console.log(row) |
| | | this.commonDetail.visible = true |
| | | this.commonDetail.infomation = { ...row } |
| | | getPurchaseInfo({id:row.ID}).then((res) => { |
| | | if (res.code == 200) { |
| | | this.commonDetail.visible = true |
| | | this.commonDetail.infomation = { |
| | | productList:res.data.productList, |
| | | ...res.data.purchase |
| | | } |
| | | }else{ |
| | | this.$message.error(res.msg?res.msg+',':''+'获取信息失败!') |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | ref="tableListRef" |
| | | :table-list="tableList" |
| | | @selCommonClick="selCommonClick" |
| | | @getSelectArray="getSelectArray" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="状态" width="120"> |
| | | <template slot-scope="scope"> |
| | | {{ getReturnedStatus(scope.row.member_name) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="confirmClick(scope.row)" type="text" size="small">确认发货</el-button> |
| | |
| | | |
| | | <script> |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead" |
| | | import { |
| | | getPurchaseList,getPurchaseInfo,submitPurchase, |
| | | } from "@/api/purchaseManage/purchase"; |
| | | import DetailSupplier from "@/views/purchaseManage/returned/DetailSupplier" |
| | | |
| | | import { getDataByType } from "@/api/data"; |
| | | export default { |
| | | name: "SupplierManage", |
| | | props: {}, |
| | |
| | | visible: false, |
| | | infomation: {} |
| | | }, |
| | | search_map: {} |
| | | search: '', |
| | | returnedStatusList:getDataByType('returnedStatus'), |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | getReturnedStatus(val) { |
| | | if (val) { |
| | | for (let i in this.returnedStatusList) { |
| | | if (this.returnedStatusList[i].id == val) { |
| | | return this.returnedStatusList[i].name; |
| | | } |
| | | } |
| | | } else { |
| | | return "--"; |
| | | } |
| | | }, |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | |
| | | { label: "经办人", prop: "city", min: 130 }, |
| | | { label: "制单人", prop: "member_name", min: 130 }, |
| | | { label: "退货日期", prop: "member_name", min: 150 }, |
| | | { label: "状态", prop: "member_name", min: 110 } |
| | | // { label: "状态", prop: "member_name", min: 110 } |
| | | ] |
| | | } |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | | await getSalesLeadsList({ |
| | | search_map: this.search_map, |
| | | await getPurchaseList({ |
| | | keyword: this.search, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }) |
| | | .then((res) => { |
| | | const list = res.data.list.map((item) => { |
| | | return { |
| | | ...item, |
| | | province: item.Province.name, |
| | | city: item.City.name, |
| | | sales_resources: item.sales_sources.name, |
| | | member_name: item.member.username |
| | | } |
| | | }) |
| | | const list = res.data.data.list |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.count |
| | | this.pagerOptions.totalCount = res.data.total |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | |
| | | // 搜索 |
| | | searchClick(val, content) { |
| | | console.log(val, content) |
| | | this.search_map = { |
| | | [val.value]: content |
| | | } |
| | | this.search = content |
| | | |
| | | this.getData() |
| | | }, |
| | | resetClick() { |
| | | this.search_map = {} |
| | | this.search = '' |
| | | this.getData() |
| | | }, |
| | | |
| | |
| | | }) |
| | | .then(() => { |
| | | console.log("dddd") |
| | | getDeleteSalesLeads({ ids: this.selValueList }).then((response) => { |
| | | submitPurchase({ ids: this.selValueList }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("确认发货成功") |
| | | this.getData() |
| | |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | getSelectArray(val) { |
| | | this.selValueList = [] |
| | | const list = val.map((item) => { |
| | | return item.id |
| | | }) |
| | | this.selValueList = list |
| | | }, |
| | | |
| | | // 详情 |
| | | selCommonClick(row) { |
| | | console.log(row) |
| | | this.commonDetail.visible = true |
| | | this.commonDetail.infomation = { ...row } |
| | | getPurchaseInfo({id:row.ID}).then((res) => { |
| | | if (res.code == 200) { |
| | | this.commonDetail.visible = true |
| | | this.commonDetail.infomation = { |
| | | productList:res.data.productList, |
| | | ...res.data.purchase |
| | | } |
| | | }else{ |
| | | this.$message.error(res.msg?res.msg+',':''+'获取信息失败!') |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |