|
@@ -1,10 +1,12 @@
|
|
|
-import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
|
|
|
-import ImageUpload from '@/components/file-upload'
|
|
|
+import { required } from '@/components/template/rules_verify.js'
|
|
|
import { listPageV2 } from '@/api/auxiliaryFittings/supplier'
|
|
|
+import { goodsPurchaseList, goodsPurchaseDetail } from '@/api/goodsPurchasedStored.js'
|
|
|
+import ImageUpload from '@/components/file-upload'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- gysList: []
|
|
|
+ gysList: [],
|
|
|
+ cgrkOrder: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -62,8 +64,18 @@ export default {
|
|
|
onChange={val => {
|
|
|
if (val) {
|
|
|
this.formData['venderName'] = this.gysList.find(item => item.venderId == val).venderName
|
|
|
+ if (!!~['merchandisePurchaseReturn'].indexOf(this?.$route?.name)) {
|
|
|
+ this.cgrkOrder = []
|
|
|
+ this.formData.items = []
|
|
|
+ this.getCgrkOrder()
|
|
|
+ }
|
|
|
} else {
|
|
|
this.formData['venderName'] = ''
|
|
|
+ if (!!~['merchandisePurchaseReturn'].indexOf(this?.$route?.name)) {
|
|
|
+ this.cgrkOrder = []
|
|
|
+ this.formData.items = []
|
|
|
+ this.formData.goodsPurchaseId = ''
|
|
|
+ }
|
|
|
}
|
|
|
}}
|
|
|
>
|
|
@@ -77,7 +89,7 @@ export default {
|
|
|
{!!~['merchandisePurchaseReturn'].indexOf(this?.$route?.name) ? (
|
|
|
<el-descriptions-item label="采购入库单">
|
|
|
<div class="redbordererr">
|
|
|
- <el-form-item label="" lebel-width="0px" prop={`venderId`} rules={required}>
|
|
|
+ <el-form-item label="" lebel-width="0px" prop={`goodsPurchaseId`} rules={required}>
|
|
|
<el-select
|
|
|
style="width:100%"
|
|
|
value={this.formData.goodsPurchaseId}
|
|
@@ -86,9 +98,52 @@ export default {
|
|
|
}}
|
|
|
placeholder="请选择"
|
|
|
disabled={!!~['SAVE', 'WAIT', 'OK', 'FAIL'].indexOf(this.formData.status)}
|
|
|
+ filterable={true}
|
|
|
+ clearable={true}
|
|
|
+ onChange={val => {
|
|
|
+ this.formData.items = []
|
|
|
+ if (val) {
|
|
|
+ goodsPurchaseDetail({ id: val }).then(res => {
|
|
|
+ this.formData.items = res.data.items.map(item => ({
|
|
|
+ brandId: item.brandId,
|
|
|
+ brandName: item.brandName,
|
|
|
+ mainId: item.mainId,
|
|
|
+ mainName: item.mainName,
|
|
|
+ smallId: item.smallId,
|
|
|
+ smallName: item.smallName,
|
|
|
+ goodsMaterialId: item.goodsMaterialId,
|
|
|
+ goodsMaterialName: item.goodsMaterialName,
|
|
|
+ specsName: item.specsName,
|
|
|
+ unit: item.unit,
|
|
|
+ insideQty: item.insideQty,
|
|
|
+ outQty: item.outQty,
|
|
|
+ partsQty: item.partsQty,
|
|
|
+ qty: item.qty,
|
|
|
+ price: item.price,
|
|
|
+ amount: item.amount,
|
|
|
+ stockQty: item.stockQty,
|
|
|
+ retQty: '',
|
|
|
+ retInsideQty: '',
|
|
|
+ retOutQty: '',
|
|
|
+ retPartsQty: '',
|
|
|
+ insideCodeQty: '',
|
|
|
+ outCodeQty: '',
|
|
|
+ partsCodeQty: '',
|
|
|
+ retAmount: '',
|
|
|
+ details: {}
|
|
|
+ }))
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }}
|
|
|
>
|
|
|
- {[].map(item => (
|
|
|
- <el-option key={item.id} label={item.label} value={item.id}></el-option>
|
|
|
+ {this.cgrkOrder.map(item => (
|
|
|
+ <el-option
|
|
|
+ key={item.id}
|
|
|
+ label={`${item.id} | 销售金额:${item.totalAmount || '-'} | 入库时间:${
|
|
|
+ item.examineTime || '-'
|
|
|
+ }`}
|
|
|
+ value={item.id}
|
|
|
+ ></el-option>
|
|
|
))}
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -183,6 +238,18 @@ export default {
|
|
|
}).then(res => {
|
|
|
this.gysList = res.data.records
|
|
|
})
|
|
|
+ },
|
|
|
+ getCgrkOrder() {
|
|
|
+ if (this.formData.venderId) {
|
|
|
+ goodsPurchaseList({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: -1,
|
|
|
+ params: [{ param: 'a.vender_id', compare: '=', value: this.formData.venderId }]
|
|
|
+ }).then(res => {
|
|
|
+ this.cgrkOrder = res.data.records
|
|
|
+ console.log(res.data.records)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|