|
@@ -21,32 +21,32 @@
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="供应商(supplier)" v-bind="validateInfos.supplierName" id="SaleOrderForm-supplierName" name="supplierName">
|
|
|
- <a-input v-model:value="formData.supplierName" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <JSelectInput v-model:value="formData.supplier" placeholder="请选择" allow-clear :options="supplierOption" @change="changeSupplier"></JSelectInput>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="产品分类(production class)" v-bind="validateInfos.productionClass" id="SaleOrderForm-productionClass" name="productionClass">
|
|
|
- <a-input v-model:value="formData.productionClass" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <JSelectInput v-model:value="formData.productionClass" placeholder="请选择" :options="classOption" ></JSelectInput>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="机型(model)" v-bind="validateInfos.model" id="SaleOrderForm-model" name="model">
|
|
|
- <a-input v-model:value="formData.model" placeholder="请输入" allow-clear ></a-input>
|
|
|
+ <JDictSelectTag v-model:value="formData.model" placeholder="请选择" dictCode="model_typer"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="厂家(maker)" v-bind="validateInfos.maker" id="SaleOrderForm-maker" name="maker">
|
|
|
- <a-input v-model:value="formData.maker" placeholder="请输入厂家(maker)" allow-clear ></a-input>
|
|
|
+ <JDictSelectTag v-model:value="formData.maker" placeholder="请选择" dictCode="factory"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="货位(goods allocation)" v-bind="validateInfos.goodsAllocation" id="SaleOrderForm-goodsAllocation" name="goodsAllocation">
|
|
|
- <a-input v-model:value="formData.goodsAllocation" placeholder="请输入货位(goods allocation)" allow-clear ></a-input>
|
|
|
+ <JDictSelectTag v-model:value="formData.goodsAllocation" placeholder="请选择" dictCode="goods_allocation"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="仓库(warehouse)" v-bind="validateInfos.warehouse" id="SaleOrderForm-warehouse" name="warehouse">
|
|
|
- <a-input v-model:value="formData.warehouse" placeholder="请输入仓库(warehouse)" allow-clear ></a-input>
|
|
|
+ <JDictSelectTag v-model:value="formData.warehouse" placeholder="请选择" dictCode="warehouse"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
@@ -67,14 +67,15 @@
|
|
|
|
|
|
<!-- 子表单区域 -->
|
|
|
<a-tabs v-model:activeKey="activeKey" animated style=" padding: 24px;padding-top: 0px;">
|
|
|
- <a-tab-pane tab="其他日苦 - 船明细(ship details)" key="purInShip" :forceRender="true">
|
|
|
+ <a-tab-pane tab="其他入库 - 船明细(ship details)" key="otherInShip" :forceRender="true">
|
|
|
+ <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectShip"> 选择船(select ship)</a-button>
|
|
|
<j-vxe-table
|
|
|
:keep-source="true"
|
|
|
resizable
|
|
|
- ref="purInShipTableRef"
|
|
|
- :loading="purInShipTable.loading"
|
|
|
- :columns="purInShipTable.columns"
|
|
|
- :dataSource="purInShipTable.dataSource"
|
|
|
+ ref="otherInShipTableRef"
|
|
|
+ :loading="otherInShipTable.loading"
|
|
|
+ :columns="otherInShipTable.columns"
|
|
|
+ :dataSource="otherInShipTable.dataSource"
|
|
|
:height="340"
|
|
|
:disabled="disabled"
|
|
|
:rowNumber="true"
|
|
@@ -113,6 +114,7 @@
|
|
|
<BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesModalRef"></BaseShipArchiveAccessoriesModal>
|
|
|
<SelectPrpductModal ref="SelectPrpductModalRef" @selectProduct ='addProduct'></SelectPrpductModal>
|
|
|
<SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal> <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
|
|
|
+ <SelectShipSModal ref="SelectShipSModalRef" @select="addShip"></SelectShipSModal>
|
|
|
</a-spin>
|
|
|
</template>
|
|
|
|
|
@@ -120,14 +122,16 @@
|
|
|
import { defineComponent, ref, reactive, computed, toRaw} from 'vue';
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
|
|
|
- import { queryPurInFormShipFormShippTable, querystockInByMainId, queryDataById, saveOrUpdate} from '../otherInForm.api';
|
|
|
+ import { queryOtherInFormShipFormShippTable, querystockInByMainId, queryDataById, saveOrUpdate} from '../otherInForm.api';
|
|
|
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
|
|
|
import {otherInShipColumns, stockInColumns} from '../otherInForm.data';
|
|
|
import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
|
|
|
import SelectPrpductModal from '../../../publicComponents/SelectPrpductModal.vue';
|
|
|
import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
|
|
|
+ import SelectShipSModal from '../../../publicComponents/SelectShipSModal.vue';
|
|
|
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 { Form, message } from 'ant-design-vue';
|
|
|
import moment from 'moment';
|
|
@@ -141,7 +145,9 @@
|
|
|
JDictSelectTag,
|
|
|
BaseShipArchiveAccessoriesModal,
|
|
|
SelectProjectModal,
|
|
|
- SelectPrpductModal
|
|
|
+ SelectPrpductModal,
|
|
|
+ SelectShipSModal,
|
|
|
+ JSelectInput
|
|
|
},
|
|
|
props:{
|
|
|
formDisabled:{
|
|
@@ -153,13 +159,16 @@
|
|
|
},
|
|
|
emits:['success'],
|
|
|
setup(props, {emit}) {
|
|
|
+ var classOption = ref([]);
|
|
|
+ var supplierOption = ref([]);
|
|
|
const loading = ref(false);
|
|
|
const formRef = ref();
|
|
|
const SelectProjectModalRef = ref()
|
|
|
const SelectPrpductModalRef = ref()
|
|
|
- const purInShipTableRef = ref();
|
|
|
+ const SelectShipSModalRef = ref();
|
|
|
+ const otherInShipTableRef = ref();
|
|
|
const BaseShipArchiveAccessoriesModalRef = ref();
|
|
|
- const purInShipTable = reactive<Record<string, any>>({
|
|
|
+ const otherInShipTable = reactive<Record<string, any>>({
|
|
|
loading: false,
|
|
|
columns: otherInShipColumns,
|
|
|
dataSource: []
|
|
@@ -170,19 +179,17 @@
|
|
|
columns: stockInColumns,
|
|
|
dataSource: []
|
|
|
});
|
|
|
- const activeKey = ref('purInShip');
|
|
|
+ const activeKey = ref('otherInShip');
|
|
|
const formData = reactive<Record<string, any>>({
|
|
|
id: '',
|
|
|
status: undefined,
|
|
|
delFlag: undefined,
|
|
|
- sourceCode:'',
|
|
|
billCode:'',
|
|
|
billDate: moment(new Date()).format('YYYY-MM-DD'),
|
|
|
project: '',
|
|
|
projectName:'',
|
|
|
supplier:"",
|
|
|
- supplierName:'',
|
|
|
- delivery: '',
|
|
|
+ supplierName:'',
|
|
|
productionClass: '',
|
|
|
model:'',
|
|
|
maker: '',
|
|
@@ -190,8 +197,6 @@
|
|
|
warehouse:'',
|
|
|
notes:'',
|
|
|
attachs:'',
|
|
|
- arrivalDetails:'',
|
|
|
- typr:'1'
|
|
|
});
|
|
|
//表单验证
|
|
|
const validatorRules = reactive({
|
|
@@ -221,18 +226,22 @@
|
|
|
|
|
|
function add() {
|
|
|
resetFields();
|
|
|
- purInShipTable.dataSource = [];
|
|
|
+ otherInShipTable.dataSource = [];
|
|
|
stockInTable.dataSource = [];
|
|
|
- activeKey.value = 'purInShip'
|
|
|
+ activeKey.value = 'otherInShip'
|
|
|
+ getSupplierOption()
|
|
|
+ getOptiom()
|
|
|
}
|
|
|
async function edit(row) {
|
|
|
//主表数据
|
|
|
await queryMainData(row.id);
|
|
|
//子表数据
|
|
|
- const purInShipDataList = await queryPurInFormShipFormShippTable(row['id']);
|
|
|
- purInShipTable.dataSource = [...purInShipDataList];
|
|
|
+ const otherInShipDataList = await queryOtherInFormShipFormShippTable(row['id']);
|
|
|
+ otherInShipTable.dataSource = [...otherInShipDataList];
|
|
|
const stockInDataList = await querystockInByMainId(row['id']);
|
|
|
stockInTable.dataSource = [...stockInDataList];
|
|
|
+ getSupplierOption()
|
|
|
+ getOptiom()
|
|
|
}
|
|
|
|
|
|
async function queryMainData(id) {
|
|
@@ -249,8 +258,8 @@
|
|
|
}
|
|
|
|
|
|
const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
|
|
|
- 'storePurchaseInShip': purInShipTableRef,
|
|
|
- 'storePurchaseInDetails': stockInTableRef,
|
|
|
+ 'storePurchaseOtherShip': otherInShipTableRef,
|
|
|
+ 'storePurchaseOtherDetails': stockInTableRef,
|
|
|
});
|
|
|
|
|
|
async function getFormData() {
|
|
@@ -296,7 +305,7 @@
|
|
|
let url = '/purCode/purDeliveryNote/queryPurDeliveryNodeShipByMainId'
|
|
|
defHttp.get({url:url,params}, { isTransformResponse: false }).then(res=>{
|
|
|
if(res){
|
|
|
- purInShipTable.dataSource = res.result
|
|
|
+ otherInShipTable.dataSource = res.result
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -324,17 +333,76 @@
|
|
|
}
|
|
|
}
|
|
|
function addProduct(data){
|
|
|
+ debugger
|
|
|
data.map(item=>{
|
|
|
item.productClass = item.classId_dictText
|
|
|
item.productCode = item.code
|
|
|
item.productId = item.id
|
|
|
})
|
|
|
- var arrProduct = data.concat(purOrderFormShipFormProductTable.dataSource)
|
|
|
- purOrderFormShipFormProductTable.dataSource=arrProduct
|
|
|
+ var arrProduct = data.concat(stockInTable.dataSource)
|
|
|
+ stockInTable.dataSource=arrProduct
|
|
|
}
|
|
|
function selectProductList(){
|
|
|
SelectPrpductModalRef.value.getTable()
|
|
|
}
|
|
|
+ function selectShip(){
|
|
|
+ SelectShipSModalRef.value.getTable()
|
|
|
+ }
|
|
|
+ function addShip(data){
|
|
|
+ var arr = data.concat(otherInShipTable.dataSource)
|
|
|
+ arr.map(item=>item.shipowner = item.relateCustomer)
|
|
|
+ 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){
|
|
|
+ if(prop){
|
|
|
+ supplierOption.value.map(item=>{
|
|
|
+ if(item.value==prop){
|
|
|
+ formData.supplierName = item.label
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }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
|
|
@@ -344,8 +412,8 @@
|
|
|
formData[key] = value;
|
|
|
}
|
|
|
return {
|
|
|
- purInShipTableRef,
|
|
|
- purInShipTable,
|
|
|
+ otherInShipTableRef,
|
|
|
+ otherInShipTable,
|
|
|
stockInTableRef,
|
|
|
stockInTable,
|
|
|
validatorRules,
|
|
@@ -370,7 +438,13 @@
|
|
|
addProject,
|
|
|
selectProductList,
|
|
|
SelectPrpductModalRef,
|
|
|
- addProduct
|
|
|
+ addProduct,
|
|
|
+ selectShip,
|
|
|
+ SelectShipSModalRef,
|
|
|
+ addShip,
|
|
|
+ supplierOption,
|
|
|
+ changeSupplier,
|
|
|
+ classOption
|
|
|
}
|
|
|
}
|
|
|
});
|