|
@@ -10,7 +10,7 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="到货日期(arrival date)" v-bind="validateInfos.arrivalDate" id="SaleOrderForm-arrivalDate" name="arrivalDate">
|
|
|
+ <a-form-item label="到货日期(arrival date)" v-bind="validateInfos.arrivalDate" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-arrivalDate" name="arrivalDate">
|
|
|
<a-date-picker placeholder="请选择到货日期(arrival date)" v-model:value="formData.arrivalDate" value-format="YYYY-MM-DD" style="width: 100%" allow-clear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -20,8 +20,8 @@
|
|
|
</a-form-item>
|
|
|
</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>
|
|
|
+ <a-form-item label="供应商(supplier)" v-bind="validateInfos.supplierName" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-supplierName" name="supplierName">
|
|
|
+ <JSelectInput v-model:value="formData.inquirySuppiler" placeholder="请选择" allow-clear :options="supplierOption" @change="changeSupplier"></JSelectInput>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
@@ -30,7 +30,7 @@
|
|
|
</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-form-item label="产品分类(production class)" v-bind="validateInfos.productionClass" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-productionClass" name="productionClass">
|
|
|
<a-input v-model:value="formData.productionClass" placeholder="请输入" allow-clear disabled ></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -40,7 +40,7 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="厂家(maker)" v-bind="validateInfos.maker" id="SaleOrderForm-maker" name="maker">
|
|
|
+ <a-form-item label="厂家(maker)" v-bind="validateInfos.maker" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-maker" name="maker">
|
|
|
<a-input v-model:value="formData.maker" placeholder="请输入厂家(maker)" allow-clear disabled></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -50,17 +50,17 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="运单号(waybill number)" v-bind="validateInfos.waybillNumber" id="SaleOrderForm-waybillNumber" name="waybillNumber">
|
|
|
- <a-input v-model:value="formData.waybillNumber" placeholder="请输入运单号(waybill number)" allow-clear ></a-input>
|
|
|
+ <a-form-item label="包装要求(package requirement)" v-bind="validateInfos.packagebRequirement" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-packagebRequirement" name="packagebRequirement">
|
|
|
+ <a-input v-model:value="formData.packagebRequirement" placeholder="请输入包装要求(package requirement)" allow-clear disabled></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="包装要求(package requirement)" v-bind="validateInfos.packagebRequirement" id="SaleOrderForm-packagebRequirement" name="packagebRequirement">
|
|
|
- <a-input v-model:value="formData.packagebRequirement" placeholder="请输入包装要求(package requirement)" allow-clear disabled></a-input>
|
|
|
+ <a-form-item label="运单号(waybill number)" v-bind="validateInfos.waybillNumber" id="SaleOrderForm-waybillNumber" name="waybillNumber">
|
|
|
+ <a-input v-model:value="formData.waybillNumber" placeholder="请输入运单号(waybill number)" allow-clear ></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="收件人(recipient)" v-bind="validateInfos.recipient" id="SaleOrderForm-recipient" name="recipient">
|
|
|
+ <a-form-item label="收件人(recipient)" v-bind="validateInfos.recipient" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-recipient" name="recipient">
|
|
|
<a-input v-model:value="formData.recipient" placeholder="请输入收件人(recipient)" allow-clear disabled></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -70,17 +70,17 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="收件人地址(recipient address)" v-bind="validateInfos.recipientAddress" id="SaleOrderForm-recipientAddress" name="recipientAddress">
|
|
|
+ <a-form-item label="收件人地址(recipient address)" v-bind="validateInfos.recipientAddress" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-recipientAddress" name="recipientAddress">
|
|
|
<a-input v-model:value="formData.recipientAddress" placeholder="请输入收件人地址(recipient address)" allow-clear disabled></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="质保条款(warranty terms)" v-bind="validateInfos.warrantyTerms" id="SaleOrderForm-warrantyTerms" name="warrantyTerms">
|
|
|
- <a-input v-model:value="formData.warrantyTerms" placeholder="请输入质保条款(warranty terms)" allow-clear ></a-input>
|
|
|
+ <a-input v-model:value="formData.warrantyTerms" placeholder="请输入质保条款(warranty terms)" allow-clear disabled></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="采购部门(purchase department)" v-bind="validateInfos.purchaseDepartment" id="SaleOrderForm-purchaseDepartment" name="purchaseDepartment">
|
|
|
+ <a-form-item label="采购部门(purchase department)" v-bind="validateInfos.purchaseDepartment" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-purchaseDepartment" name="purchaseDepartment">
|
|
|
<a-input v-model:value="formData.purchaseDepartment" placeholder="请输入" allow-clear disabled></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -90,7 +90,7 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="发票/发货日期(delivery/invoice date)" v-bind="validateInfos.invoiceDate" id="SaleOrderForm-invoiceDate" name="invoiceDate">
|
|
|
+ <a-form-item label="发票/发货日期(delivery/invoice date)" v-bind="validateInfos.invoiceDate" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="SaleOrderForm-invoiceDate" name="invoiceDate">
|
|
|
<a-date-picker placeholder="请选择发票/发货日期(delivery/invoice date)" v-model:value="formData.invoiceDate" value-format="YYYY-MM-DD" style="width: 100%" allow-clear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -100,7 +100,7 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="到货详情(arrival details)" v-bind="validateInfos.arrivalDetails" id="PuechaseInquiryFormForm-arrivalDetails" name="arrivalDetails" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1">
|
|
|
+ <a-form-item label="到货详情(arrival details)" v-bind="validateInfos.arrivalDetails" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="PuechaseInquiryFormForm-arrivalDetails" name="arrivalDetails" >
|
|
|
<JUpload v-model:value="formData.arrivalDetails"></JUpload>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -130,7 +130,7 @@
|
|
|
</j-vxe-table>
|
|
|
</a-tab-pane>
|
|
|
<a-tab-pane tab="到货单 - 到货明细(arrive details)" key="arriveDetailsFormProduct" :forceRender="true">
|
|
|
- <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" > 选择采购单(select purchase order)</a-button>
|
|
|
+ <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectPurchaseOrderList"> 选择采购单(select purchase order)</a-button>
|
|
|
<j-vxe-table
|
|
|
:keep-source="true"
|
|
|
resizable
|
|
@@ -154,6 +154,7 @@
|
|
|
</a-tabs>
|
|
|
<SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
|
|
|
<BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesModalRef"></BaseShipArchiveAccessoriesModal>
|
|
|
+ <SelectPurchaseOrderModal ref="SelectPurchaseOrderModalRef" @selectPurchaseOrder="addAddiveGoods"></SelectPurchaseOrderModal>
|
|
|
</a-spin>
|
|
|
</template>
|
|
|
|
|
@@ -161,11 +162,12 @@
|
|
|
import { defineComponent, ref, reactive, computed, toRaw} from 'vue';
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
|
|
|
- import { queryArriveGoodsShipTable, queryArriveGoodsDetailByMainId, queryDataById, saveOrUpdate} from '../ArriveGoodsForm.api';
|
|
|
+ import { queryArriveGoodsShipTable, queryArriveGoodsDetailByMainId, queryDataById, saveOrUpdate,Supplierlist} from '../ArriveGoodsForm.api';
|
|
|
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
|
|
|
import {ArriveGoodsFormShipColumns, ArriveGoodsDetailColumns} from '../ArriveGoodsForm.data';
|
|
|
import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
|
|
|
import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
|
|
|
+ import SelectPurchaseOrderModal from '../../../publicComponents/SelectPurchaseOrderModal.vue';
|
|
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
|
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
|
|
import { JDictSelectTag} from '/@/components/Form';
|
|
@@ -184,6 +186,7 @@
|
|
|
JSelectInput,
|
|
|
SelectProjectModal,
|
|
|
BaseShipArchiveAccessoriesModal,
|
|
|
+ SelectPurchaseOrderModal,
|
|
|
},
|
|
|
props:{
|
|
|
formDisabled:{
|
|
@@ -201,6 +204,7 @@
|
|
|
const ArriveGoodsFormShipTableRef = ref();
|
|
|
const SelectProjectModalRef = ref()
|
|
|
const BaseShipArchiveAccessoriesModalRef = ref();
|
|
|
+ const SelectPurchaseOrderModalRef = ref();
|
|
|
const ArriveGoodsFormShipFormShipTable = reactive<Record<string, any>>({
|
|
|
loading: false,
|
|
|
columns: ArriveGoodsFormShipColumns,
|
|
@@ -219,10 +223,9 @@
|
|
|
status: undefined,
|
|
|
delFlag: undefined,
|
|
|
sourceCode:'',
|
|
|
- sourceCode2:'',
|
|
|
submit:'',
|
|
|
billCode:'',
|
|
|
- billDate: moment(new Date()).format('YYYY-MM-DD'),
|
|
|
+ arrivalDate: moment(new Date()).format('YYYY-MM-DD'),
|
|
|
project: '',
|
|
|
projectName:'',
|
|
|
supplier:"",
|
|
@@ -231,23 +234,20 @@
|
|
|
productionClass: '',
|
|
|
model: '',
|
|
|
maker: '',
|
|
|
- tradeTerms:'',
|
|
|
- isExport:'',
|
|
|
+ delivery:'',
|
|
|
+ waybillNumber:'',
|
|
|
packagebRequirement:'',
|
|
|
recipient:'',
|
|
|
recipientTel:'',
|
|
|
recipientAddress:'',
|
|
|
- paymentTerms:'',
|
|
|
- delivery:'',
|
|
|
- warrantyPeriod:'',
|
|
|
warrantyTerms:'',
|
|
|
- exchangeRate:'',
|
|
|
- purchaseDepartment:"",
|
|
|
+ purchaseDepartment:'',
|
|
|
purchaseman:'',
|
|
|
- currency:'',
|
|
|
- notes:''
|
|
|
+ invoiceDate:'',
|
|
|
+ notes:'',
|
|
|
+ arrivalDetails:"",
|
|
|
});
|
|
|
-
|
|
|
+ var supplierOption = ref([]);
|
|
|
//表单验证
|
|
|
const validatorRules = reactive({
|
|
|
});
|
|
@@ -256,6 +256,8 @@
|
|
|
const formItemLayout = {
|
|
|
labelCol: {xs: {span: 24}, sm: {span: 5}},
|
|
|
wrapperCol: {xs: {span: 24}, sm: {span: 16}},
|
|
|
+ labelCol1: {xs: {span: 24}, sm: {span: 7}},
|
|
|
+ wrapperCol1: {xs: {span: 24}, sm: {span: 15}},
|
|
|
};
|
|
|
|
|
|
// 表单禁用
|
|
@@ -279,29 +281,7 @@
|
|
|
activeKey.value = 'ArriveGoodsFormShipFormShip'
|
|
|
formData.purchaseman=userStore.getUserInfo.username;
|
|
|
formData.purchaseDepartment = userStore.getUserInfo.orgCode
|
|
|
- }
|
|
|
- // 判断有没有参照的子表
|
|
|
- function isSelect(){
|
|
|
- var arrQuo = [],
|
|
|
- arrCon=[]
|
|
|
- arriveDetailsFormProductTable.dataSource.map(item=>{
|
|
|
- var sign = ''
|
|
|
- sign = item.sourceId?(item.sourceId).substring(0, 3):''
|
|
|
- if(item.sourceId&&sign=='Quo'){
|
|
|
- arrQuo.push(item.sourceId)
|
|
|
- }else if(item.sourceId&&sign=='Con'){
|
|
|
- arrCon.push(item.sourceId)
|
|
|
- }
|
|
|
- })
|
|
|
- if(arrQuo.length==0&&arrCon.length==0){
|
|
|
- formData.sourceCode2 = ''
|
|
|
- formData.sourceCode = ''
|
|
|
- notAllowEdit.value=false
|
|
|
- }else if(arrQuo.length==0){
|
|
|
- formData.sourceCode = ''
|
|
|
- }else if(arrCon.length==0){
|
|
|
- formData.sourceCode2 = ''
|
|
|
- }
|
|
|
+ getSupplierOption()
|
|
|
}
|
|
|
async function edit(row) {
|
|
|
//主表数据
|
|
@@ -311,6 +291,12 @@
|
|
|
ArriveGoodsFormShipFormShipTable.dataSource = [...ArriveGoodsFormShipFormShipDataList];
|
|
|
const arriveDetailsFormProductDataList = await queryArriveGoodsDetailByMainId(row['id']);
|
|
|
arriveDetailsFormProductTable.dataSource = [...arriveDetailsFormProductDataList];
|
|
|
+ getSupplierOption()
|
|
|
+ if(arriveDetailsFormProductTable.dataSource.length!==0){
|
|
|
+ notAllowEdit.value = true
|
|
|
+ }else{
|
|
|
+ notAllowEdit.value = false
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
async function queryMainData(id) {
|
|
@@ -348,7 +334,7 @@
|
|
|
}
|
|
|
|
|
|
async function submitForm() {
|
|
|
- if(formData.sourceCode==''&&formData.sourceCode2==''){
|
|
|
+ if(formData.sourceCode==''){
|
|
|
message.warning('请选择销售订单或报价单')
|
|
|
}else{
|
|
|
const mainData = await getFormData();
|
|
@@ -356,7 +342,7 @@
|
|
|
const values = Object.assign({}, dbData, mainData, subData);
|
|
|
console.log('表单提交数据', values)
|
|
|
const isUpdate = values.id ? true : false
|
|
|
- await saveOrUpdate(values, isUpdate,isRevise);
|
|
|
+ await saveOrUpdate(values, isUpdate);
|
|
|
//关闭弹窗
|
|
|
emit('success');
|
|
|
}
|
|
@@ -372,9 +358,12 @@
|
|
|
function onSearchProject(){
|
|
|
SelectProjectModalRef.value.getTable()
|
|
|
}
|
|
|
- function getShipList(id,status){
|
|
|
+ function selectPurchaseOrderList(){
|
|
|
+ SelectPurchaseOrderModalRef.value.getTable(formData)
|
|
|
+ }
|
|
|
+ function getShipList(id){
|
|
|
let params = {id:id}
|
|
|
- let url = status=='quotation'?'/purCode/purPurchaseQuotation/queryPurPurchaseQuotationShipByMainId':'/saleCode/saleOrder/querySaleOrderShipByMainId'
|
|
|
+ let url = '/purCode/purOrder/queryPurOrderShipByMainId'
|
|
|
defHttp.get({url:url,params}, { isTransformResponse: false }).then(res=>{
|
|
|
if(res){
|
|
|
ArriveGoodsFormShipFormShipTable.dataSource = res.result
|
|
@@ -395,33 +384,78 @@
|
|
|
newArray.splice(prop.rowIndex, 1)
|
|
|
if( arriveDetailsFormProductTable.dataSource.length!==0){
|
|
|
arriveDetailsFormProductTable.dataSource = newArray
|
|
|
- var arrQuo = [],
|
|
|
- arrCon=[]
|
|
|
+ var arr=[]
|
|
|
arriveDetailsFormProductTable.dataSource.map(item=>{
|
|
|
- var sign = ''
|
|
|
- sign = item.sourceId?(item.sourceId).substring(0, 3):''
|
|
|
- if(item.sourceId&&sign=='Quo'){
|
|
|
- arrQuo.push(item.sourceId)
|
|
|
- }else if(item.sourceId&&sign=='Con'){
|
|
|
- arrCon.push(item.sourceId)
|
|
|
+ if(item.sourceId&&item.sourceId!==''){
|
|
|
+ arr.push(item.sourceId)
|
|
|
}
|
|
|
})
|
|
|
- if(arrQuo.length==0&&arrCon.length==0){
|
|
|
- formData.sourceCode2 = ''
|
|
|
+ if(arr.length==0){
|
|
|
formData.sourceCode = ''
|
|
|
notAllowEdit.value=false
|
|
|
- }else if(arrQuo.length==0){
|
|
|
- formData.sourceCode = ''
|
|
|
- }else if(arrCon.length==0){
|
|
|
- formData.sourceCode2 = ''
|
|
|
}
|
|
|
}else{
|
|
|
notAllowEdit.value=false
|
|
|
- formData.sourceCode2 = ''
|
|
|
formData.sourceCode = ''
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ function addAddiveGoods(data){
|
|
|
+ debugger
|
|
|
+ data.map(item=>{
|
|
|
+ item.model = item.childModel
|
|
|
+ })
|
|
|
+ var arr = data.concat(arriveDetailsFormProductTable.dataSource)
|
|
|
+ arriveDetailsFormProductTable.dataSource=arr
|
|
|
+ notAllowEdit.value=true
|
|
|
+ formData.sourceCode =data[0].billCode
|
|
|
+ formData.project = data[0].project
|
|
|
+ formData.projectName = data[0].projectName
|
|
|
+ formData.supplierName = data[0].supplierName
|
|
|
+ formData.supplier= data[0].supplier
|
|
|
+ formData.priority =data[0].priority
|
|
|
+ formData.productionClass =data[0].productionClass
|
|
|
+ formData.model =data[0].headModel
|
|
|
+ formData.maker =data[0].maker
|
|
|
+ formData.delivery = data[0].delivery
|
|
|
+ formData.packagebRequirement = data[0].packagebRequirement
|
|
|
+ formData.recipient = data[0].recipient
|
|
|
+ formData.recipientTel = data[0].recipientTel
|
|
|
+ formData.recipientAddress = data[0].recipientAddress
|
|
|
+ getShipList(data[0].headId)
|
|
|
+ }
|
|
|
+ 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 = ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 值改变事件触发-树控件回调
|
|
|
* @param key
|
|
@@ -456,6 +490,12 @@
|
|
|
BaseShipArchiveAccessoriesModalRef,
|
|
|
viewAccessory,
|
|
|
notAllowEdit,
|
|
|
+ SelectPurchaseOrderModalRef,
|
|
|
+ selectPurchaseOrderList,
|
|
|
+ addAddiveGoods,
|
|
|
+ Supplierlist,
|
|
|
+ changeSupplier,
|
|
|
+ supplierOption
|
|
|
}
|
|
|
}
|
|
|
});
|