| | |
| | | let day = String(date.getDate()).padStart(2, "0"); |
| | | return year + "-" + month + "-" + day; |
| | | }, |
| | | // æ°å¢æ¹æ³ï¼å è½½ç©æç¼å·æ°æ® |
| | | async loadMaterielCodes(option) { |
| | | try { |
| | | option.loading = true; |
| | | const { page, pageSize, keyword } = option.pagination; |
| | | const res = await this.http.post("/api/PurchaseOrderDetail/GetPurchaseOrderDetailMaterielCode", { |
| | | warehouseId: this.editFormFields.warehouseId, |
| | | keyword, |
| | | page, |
| | | pageSize |
| | | }, true); |
| | | |
| | | if (res.status) { |
| | | option.pagination.total = res.total || res.data.length; |
| | | const newData = res.data.map(item => ({ key: item, value: item })); |
| | | option.data = page === 1 ? newData : [...option.data, ...newData]; |
| | | } |
| | | } catch (error) { |
| | | this.$error("æ°æ®å 载失败"); |
| | | } finally { |
| | | option.loading = false; |
| | | } |
| | | }, |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { //æ¡æ¶åå§åé
ç½®åï¼ |
| | | this.$nextTick(() => { |
| | | let warehouseIdOption = this.getOption("warehouseId"); |
| | | let materielCodeOption = this.getOption("materielCode"); |
| | | let purchaseOrderNoOption = this.getOption("purchaseOrderNo"); |
| | | let materielQueryOption = this.getOption("materielQuery"); |
| | | warehouseIdOption.onChange=(val,option)=>{ |
| | | this.editFormFields.materielCode = ""; |
| | | materielCodeOption.data = []; |
| | |
| | | this.http.post("/api/PurchaseOrderDetail/GetPurchaseOrderDetailMaterielCode?warehouseId=" + val, {}, true).then( |
| | | source => { |
| | | if (!source.status) return this.$error(source.message); |
| | | this.$nextTick(() => { |
| | | |
| | | for (let i = 0; i < source.data.length; i++) { |
| | | materielCodeOption.data.push({ key: source.data[i], value: source.data[i] }) |
| | | } |
| | | this.refresh(); |
| | | }) |
| | | }) |
| | | } |
| | | materielCodeOption.onChange = (val, option) => { |
| | |
| | | this.http.post("/api/PurchaseOrderDetail/GetPurchaseOrderNos?materielCode=" + val, {}, true).then( |
| | | source => { |
| | | if (!source.status) return this.$error(source.message); |
| | | this.$nextTick(() => { |
| | | for (let i = 0; i < source.data.length; i++) { |
| | | purchaseOrderNoOption.data.push({ key: source.data[i], value: source.data[i] }) |
| | | } |
| | | this.refresh(); |
| | | }); |
| | | }) |
| | | } |
| | | }); |
| | | |
| | | this.columns.push({ |
| | | field: 'æä½', |