|
@@ -21,12 +21,33 @@
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="供应商(supplier)" v-bind="validateInfos.supplierName" id="SaleOrderForm-supplierName" name="supplierName">
|
|
|
- <JSelectInput v-model:value="formData.supplier" placeholder="请选择" allow-clear :options="supplierOption" @change="changeSupplier"></JSelectInput>
|
|
|
+ <ApiSelect
|
|
|
+ :api="supplierOption"
|
|
|
+ showSearch
|
|
|
+ v-model:value="formData.supplier"
|
|
|
+ :filterOption="true"
|
|
|
+ resultField="records"
|
|
|
+ labelField="name"
|
|
|
+ valueField="id"
|
|
|
+ @change="changeSupplier"
|
|
|
+ :params='{pageSize:-1}'
|
|
|
+ optionFilterProp='label'
|
|
|
+ />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="产品分类(production class)" v-bind="validateInfos.productionClass" id="SaleOrderForm-productionClass" name="productionClass">
|
|
|
- <JSelectInput v-model:value="formData.productionClass" placeholder="请选择" :options="classOption" ></JSelectInput>
|
|
|
+ <ApiSelect
|
|
|
+ :api="ClassList"
|
|
|
+ showSearch
|
|
|
+ v-model:value="formData.productionClass"
|
|
|
+ :filterOption="true"
|
|
|
+ resultField="records"
|
|
|
+ labelField="name"
|
|
|
+ valueField="id"
|
|
|
+ :params='{pageSize:-1}'
|
|
|
+ optionFilterProp='label'
|
|
|
+ />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
@@ -122,7 +143,7 @@
|
|
|
import { defineComponent, ref, reactive, computed, toRaw} from 'vue';
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
|
|
|
- import { queryOtherInFormShipFormShippTable, querystockInByMainId, queryDataById, saveOrUpdate} from '../otherInForm.api';
|
|
|
+ import { queryOtherInFormShipFormShippTable, querystockInByMainId, queryDataById, saveOrUpdate,supplierOption,ClassList} from '../otherInForm.api';
|
|
|
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
|
|
|
import {otherInShipColumns, stockInColumns} from '../otherInForm.data';
|
|
|
import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
|
|
@@ -132,7 +153,7 @@
|
|
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
|
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
|
|
import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
|
|
|
- import { JDictSelectTag} from '/@/components/Form';
|
|
|
+ import { JDictSelectTag,ApiSelect} from '/@/components/Form';
|
|
|
import { Form, message } from 'ant-design-vue';
|
|
|
import moment from 'moment';
|
|
|
const useForm = Form.useForm;
|
|
@@ -147,7 +168,8 @@
|
|
|
SelectProjectModal,
|
|
|
SelectPrpductModal,
|
|
|
SelectShipSModal,
|
|
|
- JSelectInput
|
|
|
+ JSelectInput,
|
|
|
+ ApiSelect
|
|
|
},
|
|
|
props:{
|
|
|
formDisabled:{
|
|
@@ -159,8 +181,6 @@
|
|
|
},
|
|
|
emits:['success'],
|
|
|
setup(props, {emit}) {
|
|
|
- var classOption = ref([]);
|
|
|
- var supplierOption = ref([]);
|
|
|
const loading = ref(false);
|
|
|
const formRef = ref();
|
|
|
const SelectProjectModalRef = ref()
|
|
@@ -229,8 +249,6 @@
|
|
|
otherInShipTable.dataSource = [];
|
|
|
stockInTable.dataSource = [];
|
|
|
activeKey.value = 'otherInShip'
|
|
|
- getSupplierOption()
|
|
|
- getOptiom()
|
|
|
}
|
|
|
async function edit(row) {
|
|
|
//主表数据
|
|
@@ -240,8 +258,6 @@
|
|
|
otherInShipTable.dataSource = [...otherInShipDataList];
|
|
|
const stockInDataList = await querystockInByMainId(row['id']);
|
|
|
stockInTable.dataSource = [...stockInDataList];
|
|
|
- getSupplierOption()
|
|
|
- getOptiom()
|
|
|
}
|
|
|
|
|
|
async function queryMainData(id) {
|
|
@@ -353,55 +369,16 @@
|
|
|
otherInShipTable.dataSource=arr
|
|
|
|
|
|
}
|
|
|
- function getSupplierOption(){
|
|
|
- defHttp
|
|
|
- .get({ url: '/cuspCode/cuspSupplierProfile/list'}, { isTransformResponse: false })
|
|
|
- .then((res) => {
|
|
|
- if (res.success) {
|
|
|
- supplierOption.value = []
|
|
|
- res.result.records.forEach(element => {
|
|
|
- var obj = {
|
|
|
- label: element.name?element.name:'无名称请维护',
|
|
|
- value: element.id?element.id:''
|
|
|
- };
|
|
|
- supplierOption.value.push( obj)
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- // loading.value = false;
|
|
|
- });
|
|
|
- }
|
|
|
- function changeSupplier(prop){
|
|
|
+ async function changeSupplier(prop){
|
|
|
if(prop){
|
|
|
- supplierOption.value.map(item=>{
|
|
|
- if(item.value==prop){
|
|
|
- formData.supplierName = item.label
|
|
|
- }
|
|
|
- })
|
|
|
+ var params={id:formData.supplier}
|
|
|
+ var obj = await supplierOption(params)
|
|
|
+ formData.suppilerName = obj.records[0].name
|
|
|
}else{
|
|
|
formData.supplier = ''
|
|
|
formData.supplierName = ''
|
|
|
}
|
|
|
}
|
|
|
- // 产品分类
|
|
|
- function getOptiom(){
|
|
|
- defHttp.get({ url: 'baseCode/baseProductClass/list'}, { isTransformResponse: false })
|
|
|
- .then((res) => {
|
|
|
- if (res.success) {
|
|
|
- classOption.value = []
|
|
|
- res.result.records.forEach(element => {
|
|
|
- var obj = {
|
|
|
- label: element.name?element.name:'无名称请维护',
|
|
|
- value: element.id?element.id:''
|
|
|
- };
|
|
|
- classOption.value.push( obj)
|
|
|
- });
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- // loading.value = false;
|
|
|
- });
|
|
|
- }
|
|
|
/**
|
|
|
* 值改变事件触发-树控件回调
|
|
|
* @param key
|
|
@@ -441,9 +418,9 @@
|
|
|
selectShip,
|
|
|
SelectShipSModalRef,
|
|
|
addShip,
|
|
|
- supplierOption,
|
|
|
changeSupplier,
|
|
|
- classOption
|
|
|
+ ClassList,
|
|
|
+ supplierOption
|
|
|
}
|
|
|
}
|
|
|
});
|