|
...
|
...
|
@@ -5,8 +5,11 @@ |
|
|
|
<a-form-model ref="form" :model="model" :rules="validatorRules">
|
|
|
|
<a-row>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="订货单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCompany">
|
|
|
|
<a-input v-model="model.orderCompany" placeholder="请输入订货单位"></a-input>
|
|
|
|
<a-form-model-item label="订货单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCompany" >
|
|
|
|
<!-- <a-input v-model="model.orderCompany" placeholder="请输入订货单位"></a-input> -->
|
|
|
|
<a-select size="small" v-model="model.orderCompany" placeholder="请输入订货单位" allowClear show-search :filter-option="filterOption" mode="SECRET_COMBOBOX_MODE_DO_NOT_USE">
|
|
|
|
<a-select-option v-for="(item,index) in orderCompanyList" :key="index" :value="item">{{ item }}</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
...
|
...
|
@@ -16,7 +19,10 @@ |
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
|
|
<a-form-model-item label="产品名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
|
|
|
|
<a-input v-model="model.productName" placeholder="请输入产品名称"></a-input>
|
|
|
|
<!-- <a-input v-model="model.productName" placeholder="请输入产品名称"></a-input> -->
|
|
|
|
<a-select size="small" v-model="model.productName" placeholder="请输入产品名称" allowClear show-search :filter-option="filterOptionProductName" mode="SECRET_COMBOBOX_MODE_DO_NOT_USE">
|
|
|
|
<a-select-option v-for="(item,index) in productNameList" :key="index" :value="item">{{ item }}</a-select-option>
|
|
|
|
</a-select>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :span="24">
|
|
...
|
...
|
@@ -74,7 +80,7 @@ |
|
|
|
import { httpAction } from '@/api/manage'
|
|
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
|
import { duplicateCheck } from '@/api/api'
|
|
|
|
import {listProductType} from '@/api/ProductTpye'
|
|
|
|
import {listProductType,getOrderCompanyList,getProductNameList} from '@/api/ProductTpye'
|
|
|
|
import moment from 'moment'
|
|
|
|
|
|
|
|
export default {
|
|
...
|
...
|
@@ -128,14 +134,16 @@ export default { |
|
|
|
url: {
|
|
|
|
add: "/order_form/tblOrderForm/add",
|
|
|
|
edit: "/order_form/tblOrderForm/edit",
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
productNameList:[],
|
|
|
|
orderCompanyList:[]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
// this.model.status = '未下单'
|
|
|
|
//备份model原始值
|
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
add() {
|
|
...
|
...
|
@@ -145,6 +153,8 @@ export default { |
|
|
|
this.model = Object.assign({}, record);
|
|
|
|
this.visible = true;
|
|
|
|
this.loadTree()
|
|
|
|
this.loadOrderCompanyList()
|
|
|
|
this.loadProductNameList()
|
|
|
|
},
|
|
|
|
loadTree(){
|
|
|
|
var that = this;
|
|
...
|
...
|
@@ -155,6 +165,46 @@ export default { |
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
loadOrderCompanyList(){
|
|
|
|
getOrderCompanyList().then((res)=>{
|
|
|
|
if(res.success){
|
|
|
|
this.orderCompanyList = res.result
|
|
|
|
console.log('getOrderCompanyList',res)
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
loadProductNameList(){
|
|
|
|
getProductNameList().then((res)=>{
|
|
|
|
if(res.success){
|
|
|
|
this.productNameList = res.result
|
|
|
|
console.log('getProductNameList',res)
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
filterOption(input, option) {
|
|
|
|
// console.log(input)
|
|
|
|
// var temp = option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
// if(temp){
|
|
|
|
// return temp
|
|
|
|
// }else{
|
|
|
|
// this.model.orderCompany = input
|
|
|
|
// }
|
|
|
|
return (
|
|
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
);
|
|
|
|
},
|
|
|
|
filterOptionProductName(input, option) {
|
|
|
|
// console.log(input)
|
|
|
|
// var temp = option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
// if(temp){
|
|
|
|
// return temp
|
|
|
|
// }else{
|
|
|
|
// this.model.productName = input
|
|
|
|
// }
|
|
|
|
return (
|
|
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
);
|
|
|
|
},
|
|
|
|
close() {
|
|
|
|
this.$emit('close');
|
|
|
|
this.visible = false;
|
|
...
|
...
|
@@ -165,10 +215,10 @@ export default { |
|
|
|
// 触发表单验证
|
|
|
|
this.$refs.form.validate(valid => {
|
|
|
|
if (valid) {
|
|
|
|
if(!this.model.pics && !this.model.files){
|
|
|
|
this.$message.warning("请上传主料图片或主料图文件!")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
//if(!this.model.pics && !this.model.files){
|
|
|
|
//this.$message.warning("请上传主料图片或主料图文件!")
|
|
|
|
//return
|
|
|
|
//}
|
|
|
|
// console.log(this.model)
|
|
|
|
// return
|
|
|
|
that.confirmLoading = true;
|
...
|
...
|
|