加工合同保存
This commit is contained in:
@ -68,7 +68,7 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="业务部门" name="bDeptName">
|
||||
<a-input-search v-model:value="formState.bDeptName" :disabled="isDisable" placeholder="请选择业务部门" readonly @search="onSearch"/>
|
||||
<a-input v-model:value="formState.bDeptName" disabled/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -76,6 +76,11 @@
|
||||
<a-input v-model:value="formState.comName" disabled />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="电话" name="tel">
|
||||
<a-input v-model:value="formState.tel" :disabled="isDisable" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<a-textarea v-model:value="formState.note" :disabled="isDisable" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
@ -156,7 +161,6 @@
|
||||
</a-form>
|
||||
</div>
|
||||
<deptUserModal @register="register" @success="handleSuccess"/>
|
||||
<deptListModal @register="registerDept" @success="handleSuccessDept" />
|
||||
<contractFactListModal @register="registerContractFact" @success="handleSuccessContractFact" />
|
||||
<downloadPointModal @register="registerDownLoad" @success="handleSuccessDownLoad"/>
|
||||
<supplierListModal @register="registerSupplier" @success="handleSuccessSupplier" selectType="radio" />
|
||||
@ -175,7 +179,7 @@
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { addLngContract,updateLngContract, getLngContract } from '/@/api/contract/ContractPurPng';
|
||||
import { addLngContract,updateLngContract, getLngContract } from '/@/api/contract/ContractTransPng';
|
||||
import { getLngAppro,getCompDept } from '/@/api/approve/Appro';
|
||||
import dayjs from 'dayjs';
|
||||
import { h } from 'vue';
|
||||
@ -225,14 +229,12 @@
|
||||
const { t } = useI18n();
|
||||
const formState = reactive({
|
||||
approCode: 'WTJ',
|
||||
typeCode: 'PP',
|
||||
typeCode: 'TP',
|
||||
onlineSign: 'N',
|
||||
cpTableName: 'lng_supplier',
|
||||
curCode: 'CNY',
|
||||
lngContractPurPngList: [{}],
|
||||
});
|
||||
const [register, { openModal:openModal}] = useModal();
|
||||
const [registerDept, { openModal:openModalDept}] = useModal();
|
||||
const [registerContractFact, { openModal:openModalContractFact}] = useModal();
|
||||
const [registerDownLoad, { openModal:openModalDownLoad}] = useModal();
|
||||
const [registerSupplier, { openModal:openModalSupplier}] = useModal();
|
||||
@ -290,6 +292,12 @@
|
||||
() => props.disabled,
|
||||
(val) => {
|
||||
isDisable.value = val
|
||||
if (val) {
|
||||
let idx = columnsPoint.value.findIndex(v=>v.dataIndex == 'operation')
|
||||
idx>-1&&columnsPoint.value.splice(idx, 1)
|
||||
let idx1 = columnsPrice.value.findIndex(v=>v.dataIndex == 'operation')
|
||||
idx1>-1&&columnsPrice.value.splice(idx1, 1)
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
@ -323,15 +331,13 @@
|
||||
spinning.value = false
|
||||
Object.assign(formState, {...data})
|
||||
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
||||
Object.assign(dataListContractFact.value, formState.lngContractFactRelList || [])
|
||||
Object.assign(dataListAppro.value, formState.lngContractApproRelList || [])
|
||||
formState.dateCfmFrom = formState.dateCfmFrom ? dayjs(formState.dateCfmFrom) : null
|
||||
formState.dateCfmTo = formState.dateCfmTo ? dayjs(formState.dateCfmTo) : null
|
||||
Object.assign(dataListContractFact.value, formState.lngContractFactList || [])
|
||||
Object.assign(dataListAppro.value, formState.lngApproVoList || [])
|
||||
Object.assign(dataListPoint.value, formState.lngContractTransPngList || [])
|
||||
Object.assign(dataListPrice.value, formState.lngPriceTransPngDtlList || [])
|
||||
formState.dateSign = formState.dateSign ? dayjs(formState.dateSign) : null
|
||||
formState.dateFrom = formState.dateFrom ? dayjs(formState.dateFrom) : null
|
||||
formState.dateTo = formState.dateTo ? dayjs(formState.dateTo) : null
|
||||
formState.periodTypeCode = (formState?.lngContractPurPngList[0] || {}).periodTypeCode
|
||||
formState.uomCode = (formState?.lngContractPurPngList[0] || {}).uomCode
|
||||
|
||||
dataListAppro.value.forEach(v => {
|
||||
// v.approId = v.id
|
||||
@ -347,16 +353,18 @@
|
||||
optionSelect.curCodeList = await getAllCurrency()
|
||||
|
||||
if (!pageId.value) {
|
||||
const res = await getCompDept(userInfo.id)
|
||||
formState.bDeptName = res?.dept?.name
|
||||
formState.bDeptId = res?.dept?.id
|
||||
|
||||
formState.comName = res?.comp?.name
|
||||
formState.comId = res?.comp?.id
|
||||
getCompDeptInfo(userInfo.id)
|
||||
}
|
||||
|
||||
}
|
||||
const getCompDeptInfo = async (id)=> {
|
||||
const res = await getCompDept(id)
|
||||
formState.bDeptName = res?.dept?.name
|
||||
formState.bDeptId = res?.dept?.id
|
||||
|
||||
formState.comName = res?.comp?.name
|
||||
formState.comId = res?.comp?.id
|
||||
}
|
||||
const getApproList = (val) => {
|
||||
dataListAppro.value = val
|
||||
}
|
||||
@ -394,9 +402,6 @@
|
||||
return endValue.valueOf() <= startValue.valueOf();
|
||||
}
|
||||
|
||||
const onSearch = (val)=> {
|
||||
openModalDept(true,{isUpdate: false})
|
||||
}
|
||||
const onSearchSupplier = () => {
|
||||
openModalSupplier(true,{isUpdate: false})
|
||||
}
|
||||
@ -432,13 +437,7 @@
|
||||
formState.empName = val[0].name
|
||||
formState.empId = val[0].id
|
||||
formState.tel = val[0].mobile
|
||||
}
|
||||
const handleSuccessDept = (val, info) => {
|
||||
formState.bDeptName = val[0].name
|
||||
formState.bDeptId = val[0].id
|
||||
|
||||
formState.comName = info.name
|
||||
formState.comId = info.id
|
||||
getCompDeptInfo(formState.empId)
|
||||
}
|
||||
const handleSuccessSupplier = (val) => {
|
||||
formState.cpCode = val[0].suCode
|
||||
@ -510,10 +509,11 @@
|
||||
|
||||
let obj = {
|
||||
...formState,
|
||||
lngContractPurPngPointList: dataListPoint.value,
|
||||
lngContractTransPngList: dataListPoint.value,
|
||||
lngFileUploadList: dataFile.value,
|
||||
lngContractFactRelList: dataListContractFact.value,
|
||||
lngContractApproRelList: dataListAppro.value,
|
||||
lngPriceTransPngDtlList: dataListPrice.value,
|
||||
approCode: pageType.value=='update' ? 'WTJ' : formState.approCode
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user