|
|
|
|
@ -42,18 +42,18 @@
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="拟稿人" name="empIdName">
|
|
|
|
|
<a-input-search v-model:value="formState.empIdName" placeholder="请选择拟稿人" readonly @search="onSearch"/>
|
|
|
|
|
<a-form-item label="拟稿人" name="empName">
|
|
|
|
|
<a-input-search v-model:value="formState.empName" placeholder="请选择拟稿人" readonly @search="onSearchUser"/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="拟稿人所属部门" name="bDeptIdName">
|
|
|
|
|
<a-input-search v-model:value="formState.bDeptIdName" placeholder="请选择拟稿人" readonly @search="onSearch"/>
|
|
|
|
|
<a-form-item label="拟稿人所属部门" name="bDeptName">
|
|
|
|
|
<a-input-search v-model:value="formState.bDeptName" placeholder="请选择拟稿人部门" readonly @search="onSearch"/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="拟稿人所属公司" name="comIdName">
|
|
|
|
|
<a-input-search v-model:value="formState.comIdName" placeholder="请选择拟稿人" readonly @search="onSearch"/>
|
|
|
|
|
<a-form-item label="拟稿人所属公司" name="comName">
|
|
|
|
|
<a-input v-model:value="formState.comName" disabled/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
@ -87,7 +87,8 @@
|
|
|
|
|
</a-card>
|
|
|
|
|
</a-form>
|
|
|
|
|
</div>
|
|
|
|
|
<customerListModal @register="register" selectType="radio" @success="handleSuccess"/>
|
|
|
|
|
<deptUserModal @register="register" @success="handleSuccess"/>
|
|
|
|
|
<deptListModal @register="registerDept" @success="handleSuccessDept" />
|
|
|
|
|
</a-spin>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -102,13 +103,18 @@
|
|
|
|
|
import type { Rule } from 'ant-design-vue/es/form';
|
|
|
|
|
import { getDictionary } from '/@/api/sales/Customer';
|
|
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
|
|
import { addLngScore,updateLngScore,getLngScore } from '/@/api/sales/ScoreCustomer';
|
|
|
|
|
import { addLngAppro,updateLngAppro,getLngAppro,getCompDept } from '/@/api/approve/Appro';
|
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
import { getAppEnvConfig } from '/@/utils/env';
|
|
|
|
|
import { message } from 'ant-design-vue';
|
|
|
|
|
import UploadList from '/@/components/Form/src/components/UploadList.vue';
|
|
|
|
|
import customerListModal from '/@/components/common/customerListModal.vue';
|
|
|
|
|
import deptUserModal from '/@/components/common/deptUserModal.vue';
|
|
|
|
|
import deptListModal from '/@/components/common/deptListModal.vue';
|
|
|
|
|
|
|
|
|
|
import { Modal } from 'ant-design-vue';
|
|
|
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
|
|
|
const userStore = useUserStore();
|
|
|
|
|
const userInfo = userStore.getUserInfo;
|
|
|
|
|
|
|
|
|
|
const tableName = 'Appro';
|
|
|
|
|
const columnName = 'Appro'
|
|
|
|
|
@ -143,14 +149,15 @@
|
|
|
|
|
dateAppro: dayjs(new Date()),
|
|
|
|
|
});
|
|
|
|
|
const [register, { openModal:openModal}] = useModal();
|
|
|
|
|
const [registerDept, { openModal:openModalDept}] = useModal();
|
|
|
|
|
const rules: Record<string, Rule[]> = {
|
|
|
|
|
title: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
|
|
|
typeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
|
|
|
securityCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
|
|
|
urgencyCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
|
|
|
empIdName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
|
|
|
bDeptIdName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
|
|
|
comIdName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
|
|
|
empName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
|
|
|
bDeptName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
|
|
|
comName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
|
|
|
dateAppro: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
|
|
|
content: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
|
|
|
|
|
|
|
|
@ -191,6 +198,9 @@
|
|
|
|
|
getOption()
|
|
|
|
|
if (pageId.value) {
|
|
|
|
|
getInfo(pageId.value)
|
|
|
|
|
} else {
|
|
|
|
|
formState.empName = userInfo.name
|
|
|
|
|
formState.empId = userInfo.id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
@ -200,7 +210,7 @@
|
|
|
|
|
async function getInfo(id) {
|
|
|
|
|
spinning.value = true
|
|
|
|
|
try {
|
|
|
|
|
let data = await getLngScore(id)
|
|
|
|
|
let data = await getLngAppro(id)
|
|
|
|
|
spinning.value = false
|
|
|
|
|
Object.assign(formState, {...data})
|
|
|
|
|
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
|
|
|
|
@ -214,14 +224,27 @@
|
|
|
|
|
optionSelect.securityCodeList = await getDictionary('LNG_SECRET')
|
|
|
|
|
optionSelect.urgencyCodeList = await getDictionary('LNG_URGEN')
|
|
|
|
|
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
const onSearch = (val)=> {
|
|
|
|
|
openModalDept(true,{isUpdate: false})
|
|
|
|
|
}
|
|
|
|
|
const onSearchUser = (val)=> {
|
|
|
|
|
openModal(true,{isUpdate: false})
|
|
|
|
|
}
|
|
|
|
|
const handleSuccess = (val) => {
|
|
|
|
|
formState.cpCode = val[0].cuCode
|
|
|
|
|
formState.classCode = val[0].classCode
|
|
|
|
|
formState.cpCodeName = val[0].cuName
|
|
|
|
|
formState.empName = val[0].name
|
|
|
|
|
formState.empId = val[0].id
|
|
|
|
|
}
|
|
|
|
|
const handleSuccessDept = (val) => {
|
|
|
|
|
formState.bDeptName = val[0].name
|
|
|
|
|
formState.bDeptId = val[0].id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function close() {
|
|
|
|
|
@ -240,7 +263,7 @@
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
spinning.value = true;
|
|
|
|
|
let request = !formState.id ? addLngScore :updateLngScore
|
|
|
|
|
let request = !formState.id ? addLngAppro :updateLngAppro
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const data = await request(obj);
|
|
|
|
|
|