客户需求
This commit is contained in:
@ -2,17 +2,17 @@
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="计划日期" name="datePlan">
|
||||
<a-date-picker v-model:value="formState.datePlan" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择计划日期" />
|
||||
<a-date-picker v-model:value="formState.datePlan" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择计划日期" @change="datePlanChange" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="合同" name="kName">
|
||||
<a-input-search v-model:value="formState.kName" :disabled="isDisable" placeholder="请选择合同" readonly @search="onSearch"/>
|
||||
<a-input-search v-model:value="formState.kName" :disabled="isDisable" placeholder="请选择合同" readonly @search="onSearch"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="下载点" name="fullName" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
{{ formState.fullName }}
|
||||
<a-col :span="8">
|
||||
<a-form-item label="下载点" name="pointDelyName" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<a-input-search v-model:value="formState.pointDelyName" :disabled="isDisable" placeholder="请选择下载点" readonly @search="onSearchUpLoad"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -89,17 +89,27 @@
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<ContractSalesListModal @register="registerContractSales" @success="handleSuccessContractSales" selectType="radio" />
|
||||
<ContractDemandListModal @register="registerContract" @success="handleSuccessContract" />
|
||||
<upLoadDemandListModal @register="registerUpLoad" @success="handleSuccessUpLoad" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||
import ContractSalesListModal from '/@/components/common/ContractSalesListModal.vue';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
|
||||
import ContractDemandListModal from '/@/components/common/ContractDemandListModal.vue';
|
||||
import upLoadDemandListModal from '/@/components/common/upLoadDemandListModal.vue';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { message } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import { getCompDept } from '/@/api/approve/Appro';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { getLngPngDemandContractList, getLngPngDemandPointDely } from '/@/api/dayPlan/Demand';
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
const { t } = useI18n();
|
||||
const [registerContractSales, { openModal:openModalContractSales}] = useModal();
|
||||
const [registerContract, { openModal:openModalContractSales}] = useModal();
|
||||
const [registerUpLoad, { openModal:openModalUpLoad}] = useModal();
|
||||
const props = defineProps({
|
||||
formObj: {},
|
||||
list: [],
|
||||
@ -119,6 +129,12 @@
|
||||
]);
|
||||
const formState = reactive({})
|
||||
const dataList = ref([])
|
||||
const contractList = ref([])
|
||||
const pointDelyList = ref([])
|
||||
onMounted(async () =>{
|
||||
const res = await getCompDept(userInfo.id)
|
||||
formState.cuCode = res?.comp?.code
|
||||
})
|
||||
async function numChange () {
|
||||
let num = 0;
|
||||
let num1 = 1;
|
||||
@ -129,11 +145,46 @@
|
||||
formState.qtySalesGj = num
|
||||
formState.qtySalesM3 = num1
|
||||
}
|
||||
const onSearch = (val)=> {
|
||||
openModalContractSales(true,{isUpdate: false})
|
||||
const datePlanChange = async (val) => {
|
||||
if (!val) return
|
||||
let obj = {
|
||||
cuCode:formState.cuCode,
|
||||
datePlan: dayjs(formState.datePlan).format('YYYY-MM-DD')
|
||||
}
|
||||
let res = await getLngPngDemandContractList(obj)
|
||||
contractList.value = res || []
|
||||
if (contractList.value.length == 1) {
|
||||
formState.kName = contractList.value[0].kName
|
||||
formState.ksId = contractList.value[0].id
|
||||
}
|
||||
}
|
||||
const handleSuccessContractSales = (val) => {
|
||||
|
||||
const onSearch = (val)=> {
|
||||
if (!formState.datePlan) {
|
||||
message.warn('请选择计划日期')
|
||||
return
|
||||
}
|
||||
openModalContractSales(true,{isUpdate: false, list: contractList.value})
|
||||
}
|
||||
const handleSuccessContract = async(val) => {
|
||||
formState.kName = val[0].kName
|
||||
formState.ksId = val[0].id
|
||||
let res = await getLngPngDemandPointDely({kId: formState.ksId})
|
||||
pointDelyList.value = res || []
|
||||
if (pointDelyList.value.length == 1) {
|
||||
formState.pointDelyName = contractList.value[0].kName
|
||||
formState.pointDelyCode = contractList.value[0].id
|
||||
}
|
||||
}
|
||||
const onSearchUpLoad = (val)=> {
|
||||
if (!formState.kName) {
|
||||
message.warn('请选择合同')
|
||||
return
|
||||
}
|
||||
openModalUpLoad(true,{isUpdate: false, list: pointDelyList.value})
|
||||
}
|
||||
const handleSuccessUpLoad = (val) => {
|
||||
formState.kName = val[0].kName
|
||||
formState.ksId = val[0].id
|
||||
}
|
||||
const disabledDateStart = (current) => {
|
||||
const today = new Date();
|
||||
|
||||
@ -51,7 +51,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '版本号',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 100,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -60,12 +60,12 @@ export const columns: BasicColumn[] = [
|
||||
title: '计划日期',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'pointDelyCode',
|
||||
dataIndex: 'pointDelyName',
|
||||
title: '下载点',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
@ -110,7 +110,7 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'ksId',
|
||||
dataIndex: 'ksName',
|
||||
title: '合同',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
@ -135,22 +135,12 @@ export const columns: BasicColumn[] = [
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'id',
|
||||
title: 'id',
|
||||
dataIndex: 'approName',
|
||||
title: '审批状态',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'orgId',
|
||||
title: 'orgId',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 100,
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
|
||||
@ -78,9 +78,9 @@
|
||||
|
||||
const tableRef = ref();
|
||||
//所有按钮
|
||||
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true},{"name":"快速导入","code":"import","icon":"ant-design:import-outlined","isDefault":true,"isUse":true},{"name":"快速导出","code":"export","icon":"ant-design:export-outlined","isDefault":true,"isUse":true},{"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
|
||||
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true,"type":"primary"},{"name":"提交","code":"submit","icon":"ant-design:check-outlined","isDefault":true,"isUse":true},{"name":"撤回","code":"back","icon":"ant-design:rollback-outlined","isDefault":true,"isUse":true},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true},{"name":"快速导入","code":"import","icon":"ant-design:import-outlined","isDefault":true,"isUse":true},{"name":"快速导出","code":"export","icon":"ant-design:export-outlined","isDefault":true,"isUse":true},{"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":true,"isUse":true},{"name":"取消","code":"update","icon":"ant-design:close-outlined","isDefault":true,"isUse":true},{"name":"对比","code":"compare","icon":"ant-design:file-done-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
|
||||
//展示在列表内的按钮
|
||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord', 'update', 'back', 'compare', 'submit', 'cancel']);
|
||||
const buttonConfigs = computed(()=>{
|
||||
return filterButtonAuth(buttons.value);
|
||||
})
|
||||
@ -131,7 +131,7 @@
|
||||
showResetButton: true,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableRef.value.setToolBarWidth();
|
||||
@ -206,7 +206,7 @@
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/Demand/0/createForm',
|
||||
path: '/dayPlan/Demand/createForm',
|
||||
query: {
|
||||
formPath: 'dayPlan/Demand',
|
||||
formName: formName,
|
||||
|
||||
Reference in New Issue
Block a user