|
|
|
@ -5,33 +5,64 @@
|
|
|
|
|
<a-row> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input v-decorator="['supplierId']" placeholder="请输入供应商" ></a-input> |
|
|
|
|
<!-- <a-input v-decorator="['supplierId']" placeholder="请输入供应商" ></a-input>--> |
|
|
|
|
<a-auto-complete |
|
|
|
|
v-decorator="['supplierId']" placeholder="请输入供应商" |
|
|
|
|
:data-source="bigSupplierId" |
|
|
|
|
@select="onSelectRake" |
|
|
|
|
@search="onSearchSupplier" |
|
|
|
|
/> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="物料描述" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input v-decorator="['merchandiseNewsId']" placeholder="请输入物料详情" ></a-input> |
|
|
|
|
<!-- <a-input v-decorator="['merchandiseNewsId']" placeholder="请输入物料详情" ></a-input>--> |
|
|
|
|
<a-auto-complete |
|
|
|
|
v-decorator="['merchandiseNewsId']" placeholder="请输入物料详情" |
|
|
|
|
:data-source="bigMerchandiseId" |
|
|
|
|
@select="onSearchMerchandiseNews" |
|
|
|
|
@search="onSearch" |
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="物料组名称" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input v-decorator="['descriptionId']" placeholder="请输入品名类" ></a-input> |
|
|
|
|
<!-- <a-input v-decorator="['descriptionId']" placeholder="请输入品名类" ></a-input>--> |
|
|
|
|
<a-auto-complete |
|
|
|
|
v-decorator="['descriptionId']" placeholder="请输入品名类" |
|
|
|
|
:data-source="bigId" |
|
|
|
|
@select="onSelectRake" |
|
|
|
|
@search="onSearch" |
|
|
|
|
/> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="库存地点" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<!-- <a-input v-decorator="['inventoryAddress']" placeholder="请输入库存地点" ></a-input>--> |
|
|
|
|
<a-select placeholder="请选择库存地点" v-decorator="['inventoryAddress']"> |
|
|
|
|
<a-select-option v-for="(item,index) in bigId" :key="index" :value="item.id">{{item.supplierName}}</a-select-option> |
|
|
|
|
</a-select> |
|
|
|
|
<!-- <a-select placeholder="请选择库存地点" v-decorator="['inventoryAddress']">--> |
|
|
|
|
<!-- <a-select-option v-for="(item,index) in bigId" :key="index" :value="item.id">{{item.supplierName}}</a-select-option>--> |
|
|
|
|
<!-- </a-select>--> |
|
|
|
|
<a-auto-complete |
|
|
|
|
placeholder="请选择库存地点" v-decorator="['inventoryAddress']" |
|
|
|
|
:data-source="bigIdRake" |
|
|
|
|
@select="onSelectRake" |
|
|
|
|
@search="onSearchRake" |
|
|
|
|
/> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<!-- <a-input v-decorator="['unit']" placeholder="请输入单位" ></a-input>--> |
|
|
|
|
<a-select placeholder="请选择库存地点" v-decorator="['unit']"> |
|
|
|
|
<a-select-option v-for="(item,index) in bigId" :key="index" :value="item.id">{{item.supplierName}}</a-select-option> |
|
|
|
|
</a-select> |
|
|
|
|
<!-- <a-select placeholder="请选择库存地点" v-decorator="['unit']">--> |
|
|
|
|
<!-- <a-select-option v-for="(item,index) in bigId" :key="index" :value="item.id">{{item.supplierName}}</a-select-option>--> |
|
|
|
|
<!-- </a-select>--> |
|
|
|
|
<a-auto-complete |
|
|
|
|
placeholder="请选择库存地点" v-decorator="['inventoryAddress']" |
|
|
|
|
:data-source="bigIdUnit" |
|
|
|
|
@select="onSelectRake" |
|
|
|
|
@search="onSearchRake" |
|
|
|
|
/> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<!-- <a-col :span="8">--> |
|
|
|
@ -89,8 +120,16 @@
|
|
|
|
|
}, |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
bigIdRake:[], |
|
|
|
|
bigIdUnit:[], |
|
|
|
|
|
|
|
|
|
form: this.$form.createForm(this), |
|
|
|
|
bigId:[], |
|
|
|
|
bigIdList:[], |
|
|
|
|
bigMerchandiseId:[], |
|
|
|
|
bigMerchandiseIdList:[], |
|
|
|
|
bigSupplierId: [], |
|
|
|
|
bigSupplierIdList:[], |
|
|
|
|
model: {}, |
|
|
|
|
labelCol: { |
|
|
|
|
xs: { span: 24 }, |
|
|
|
@ -106,7 +145,11 @@
|
|
|
|
|
url: { |
|
|
|
|
add: "/materialstorage/processMaterialStorage/add", |
|
|
|
|
edit: "/materialstorage/processMaterialStorage/edit", |
|
|
|
|
queryById: "/materialstorage/processMaterialStorage/queryById" |
|
|
|
|
queryById: "/materialstorage/processMaterialStorage/queryById", |
|
|
|
|
addressUrl:"/materialstorage/processMaterialStorage/materialStorageAddress", |
|
|
|
|
descriptionRake: "/description/processDescription/list", |
|
|
|
|
supplierId: "/supplier/processSupplier/list", |
|
|
|
|
merchandiseNewsList: "/merchandisenews/processMerchandiseNews/list", |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -132,8 +175,111 @@
|
|
|
|
|
created () { |
|
|
|
|
//如果是流程中表单,则需要加载流程表单data |
|
|
|
|
this.showFlowData(); |
|
|
|
|
this.fetchDataRake(); |
|
|
|
|
this.fetchData(); |
|
|
|
|
this.fetchDataSupplier(); |
|
|
|
|
this.fetchDataMerchandiseNews() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
onSearchSupplier(searchText) { //供应商 |
|
|
|
|
console.log(searchText) |
|
|
|
|
// this.dataSource = !searchText ? [] : [searchText]; |
|
|
|
|
this.fetchDataSupplier(searchText); |
|
|
|
|
}, |
|
|
|
|
onSearchRake(searchText) { //存储地 |
|
|
|
|
console.log(searchText) |
|
|
|
|
// this.dataSource = !searchText ? [] : [searchText]; |
|
|
|
|
this.fetchDataRake(searchText); |
|
|
|
|
}, |
|
|
|
|
onSearch(searchText) { //物料组 |
|
|
|
|
console.log(searchText) |
|
|
|
|
// this.dataSource = !searchText ? [] : [searchText]; |
|
|
|
|
this.fetchData(searchText); |
|
|
|
|
}, |
|
|
|
|
onSearchMerchandiseNews(searchText) { //物料信息 |
|
|
|
|
console.log(searchText) |
|
|
|
|
// this.dataSource = !searchText ? [] : [searchText]; |
|
|
|
|
this.fetchDataMerchandiseNews(searchText); |
|
|
|
|
}, |
|
|
|
|
onSelectRake(value) { |
|
|
|
|
console.log('onSelect', value); |
|
|
|
|
}, |
|
|
|
|
fetchDataMerchandiseNews (value){ |
|
|
|
|
//查询大品类数据 |
|
|
|
|
let par = { |
|
|
|
|
delFlag: 0, |
|
|
|
|
merchandiseName: value, |
|
|
|
|
pageSize: 100 |
|
|
|
|
} |
|
|
|
|
this.bigMerchandiseId = []; |
|
|
|
|
getAction(this.url.merchandiseNewsList,par).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|
console.log(res.result); |
|
|
|
|
// this.bigId = res.result.records; |
|
|
|
|
res.result.records.forEach( item => { |
|
|
|
|
this.bigMerchandiseId.push(item.merchandiseName); |
|
|
|
|
}) |
|
|
|
|
this.bigMerchandiseIdList = res.result.records; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
fetchData(value){ |
|
|
|
|
//查询大品类数据 |
|
|
|
|
let par = { |
|
|
|
|
delFlag: 0, |
|
|
|
|
descriptionName: value, |
|
|
|
|
pageSize: 100 |
|
|
|
|
} |
|
|
|
|
this.bigId = []; |
|
|
|
|
getAction(this.url.descriptionRake,par).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|
console.log(res.result); |
|
|
|
|
// this.bigId = res.result.records; |
|
|
|
|
res.result.records.forEach( item => { |
|
|
|
|
this.bigId.push(item.descriptionName); |
|
|
|
|
}) |
|
|
|
|
this.bigIdList = res.result.records; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
fetchDataSupplier(value){ |
|
|
|
|
//查询大品类数据 |
|
|
|
|
let par = { |
|
|
|
|
delFlag: 0, |
|
|
|
|
state: 0, |
|
|
|
|
supplierName: value, |
|
|
|
|
pageSize: 100 |
|
|
|
|
} |
|
|
|
|
this.bigSupplierId = []; |
|
|
|
|
getAction(this.url.supplierId,par).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|
// console.log("bigSupplierIdId") |
|
|
|
|
// console.log(res.result.records); |
|
|
|
|
// this.bigId = res.result.records; |
|
|
|
|
res.result.records.forEach( item => { |
|
|
|
|
this.bigSupplierId.push(item.supplierName); |
|
|
|
|
}) |
|
|
|
|
this.bigSupplierIdList = res.result.records; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
fetchDataRake(http,value){ |
|
|
|
|
//查询大品类数据 |
|
|
|
|
let par = { |
|
|
|
|
inventoryAddress: value, |
|
|
|
|
pageSize: 100 |
|
|
|
|
} |
|
|
|
|
this.bigIdRake = []; |
|
|
|
|
getAction(this.url.addressUrl,par).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|
// console.log(res.result); |
|
|
|
|
// this.bigId = res.result.records; |
|
|
|
|
res.result.forEach( item => { |
|
|
|
|
this.bigIdRake.push(item.inventoryAddress); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
add () { |
|
|
|
|
this.edit({}); |
|
|
|
|
}, |
|
|
|
@ -172,7 +318,9 @@
|
|
|
|
|
method = 'put'; |
|
|
|
|
} |
|
|
|
|
let formData = Object.assign(this.model, values); |
|
|
|
|
this.dispose(formData); |
|
|
|
|
console.log("表单提交数据",formData) |
|
|
|
|
|
|
|
|
|
httpAction(httpurl,formData,method).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|
that.$message.success(res.message); |
|
|
|
@ -187,6 +335,27 @@
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
dispose(item){ |
|
|
|
|
// console.log(this.bigSupplierIdList); |
|
|
|
|
// console.log(this.bigIdList); |
|
|
|
|
// console.log(this.bigMerchandiseIdList); |
|
|
|
|
this.bigSupplierIdList.forEach( is => { // 供应商 |
|
|
|
|
if(is.supplierName === item.supplierId){ |
|
|
|
|
item.supplierId = is.id; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.bigIdList.forEach(is =>{ |
|
|
|
|
if(is.descriptionName === item.descriptionId){ |
|
|
|
|
item.descriptionId = is.id; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.bigMerchandiseIdList.forEach(is =>{ |
|
|
|
|
if(is.merchandiseName === item.merchandiseNewsId){ |
|
|
|
|
item.merchandiseNewsId = is.id; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
popupCallback(row){ |
|
|
|
|
this.form.setFieldsValue(pick(row,'supplierId','merchandiseNewsId','descriptionId','inventoryAddress','unit','delFlag','delTime')) |
|
|
|
|
}, |
|
|
|
|