Commit 2bf3d1df48a56ca71093d6112e818b602cf3ec5f

Authored by boyang
1 parent cfeaf8a0

审核调试122501

src/views/project/approve/ProfitFieldPanel.vue 0 → 100644
  1 +<template>
  2 + <BasicTable @register="registerTable" className="p-0">
  3 + <template #bodyCell="{ column, record }">
  4 + <template v-if="column.key === 'action'">
  5 + <TableAction
  6 + :actions="[
  7 + {
  8 + label: '详情',
  9 + // icon: 'ic:outline-delete-outline',
  10 + onClick: handleDetail.bind(null, record),
  11 + },
  12 + ]"
  13 + />
  14 + </template>
  15 + </template>
  16 + </BasicTable>
  17 + <BasicDrawer
  18 + width="500"
  19 + :showFooter="!isApproved && (role === ROLE.ADMIN || role === ROLE.BUSINESS)"
  20 + @register="registerDrawer"
  21 + title="申请信息"
  22 + okText="通过"
  23 + @ok="handleTrue"
  24 + >
  25 + <BaseInfo :baseInfos="baseInfos" />
  26 + <div>{{ fieldInfos.baseFields.join(' , ') }}</div>
  27 + <template #appendFooter>
  28 + <a-button @click="handleFalse"> 不通过</a-button>
  29 + </template>
  30 + </BasicDrawer>
  31 + <MsgModal v-if="msgVisible" @msg-modal-close="handleMsgModalClose" />
  32 +</template>
  33 +<script lang="ts">
  34 + import MsgModal from './MsgModal.vue';
  35 + import { computed, defineComponent, ref } from 'vue';
  36 + import { BasicTable, useTable, TableAction } from '/@/components/Table';
  37 + import { BasicDrawer, useDrawer } from '/@/components/Drawer';
  38 + import { approveAuditApi, getApprovedListApi, getWaitListApi } from '/@/api/project/approve';
  39 + import { getAuditApply, getApplyList } from '/@/api/project/invoice';
  40 + import {
  41 + FIELDS_BASE_INFO,
  42 + FIELDS_INSPECTION_INFO,
  43 + FIELDS_PROFIT_INFO,
  44 + FIELDS_REPORT_INFO,
  45 + FIELDS_TRACK_STAGE_INFO,
  46 + } from '../order/tableData';
  47 + import { find, isEmpty } from 'lodash-es';
  48 + import { ROLE } from '../order//type.d';
  49 + import { useUserStoreWithOut } from '/@/store/modules/user';
  50 + import BaseInfo from './BaseInfo.vue';
  51 + import { createImgPreview } from '/@/components/Preview';
  52 + import { getFormConfig } from './data';
  53 +
  54 + const userStore = useUserStoreWithOut();
  55 +
  56 + export default defineComponent({
  57 + components: {
  58 + BasicTable,
  59 + BasicDrawer,
  60 + TableAction,
  61 + BaseInfo,
  62 + MsgModal,
  63 + },
  64 + props: {
  65 + isApproved: { type: Boolean },
  66 + },
  67 + setup(props) {
  68 + // visible 用于msgModal显示隐藏
  69 + const msgVisible = ref(false);
  70 +
  71 + const checkedKeys = ref<Array<string | number>>([]);
  72 + const currentKey = ref('1');
  73 + const [registerDrawer, { openDrawer, closeDrawer }] = useDrawer();
  74 + const fieldInfos = ref({
  75 + baseFields: [],
  76 + });
  77 + const baseInfos = ref({});
  78 + const id = ref('');
  79 +
  80 + let columns = [
  81 + {
  82 + title: '申请人',
  83 + dataIndex: 'createBy',
  84 + width: 150,
  85 + },
  86 + {
  87 + title: '审核字段类型',
  88 + dataIndex: 'auditRoleCodes',
  89 + width: 150,
  90 + customRender: (column) => {
  91 + const { record } = column || {};
  92 + return record?.auditRoleCodes.includes('business_user')
  93 + ? '(基本/跟单/质检)模块'
  94 + : '(利润/项目报告书)模块';
  95 + },
  96 + },
  97 + {
  98 + title: '内部编号',
  99 + dataIndex: 'innerNo',
  100 + width: 150,
  101 + customRender: (column) => {
  102 + const { record } = column || {};
  103 + return record?.orderBaseInfo?.innerNo;
  104 + },
  105 + },
  106 +
  107 + {
  108 + title: '项目号',
  109 + dataIndex: 'projectNoPrefix',
  110 + width: 150,
  111 + },
  112 + {
  113 + title: '申请原因',
  114 + dataIndex: 'applyRemark',
  115 + width: 150,
  116 + },
  117 + ];
  118 +
  119 + if (props.isApproved) {
  120 + columns = columns.concat([
  121 + {
  122 + title: '状态',
  123 + dataIndex: 'status',
  124 + width: 150,
  125 + customRender: (column) => {
  126 + const { record } = column || {};
  127 +
  128 + return record.status === 10 ? '通过' : '拒绝';
  129 + },
  130 + },
  131 + { title: '拒绝原因', dataIndex: 'refuseRemark', width: 250 },
  132 + ]);
  133 + }
  134 + const [registerTable, { reload }] = useTable({
  135 + scroll: false,
  136 + api: props.isApproved ? getApprovedListApi : getWaitListApi,
  137 + searchInfo: { type: 0 },
  138 + columns,
  139 + useSearchForm: true,
  140 + formConfig: getFormConfig('true'),
  141 + rowKey: 'id',
  142 + actionColumn: {
  143 + width: 160,
  144 + title: 'Action',
  145 + dataIndex: 'action',
  146 + // slots: { customRender: 'action' },
  147 + },
  148 + });
  149 +
  150 + function onSelect(record, selected) {
  151 + if (selected) {
  152 + checkedKeys.value = [...checkedKeys.value, record.id];
  153 + } else {
  154 + checkedKeys.value = checkedKeys.value.filter((id) => id !== record.id);
  155 + }
  156 + }
  157 + function onSelectAll(selected, selectedRows, changeRows) {
  158 + const changeIds = changeRows.map((item) => item.id);
  159 + if (selected) {
  160 + checkedKeys.value = [...checkedKeys.value, ...changeIds];
  161 + } else {
  162 + checkedKeys.value = checkedKeys.value.filter((id) => {
  163 + return !changeIds.includes(id);
  164 + });
  165 + }
  166 + }
  167 + function handleEdit(record, e) {
  168 + e?.stopPropagation();
  169 + return false;
  170 + }
  171 +
  172 + function handleProfitModal() {}
  173 +
  174 + async function handleDetail(data) {
  175 + fieldInfos.value = {
  176 + baseFields: [],
  177 + };
  178 + openDrawer(true, { data });
  179 + baseInfos.value = FIELDS_BASE_INFO.map((field) => {
  180 + return {
  181 + label: field.label,
  182 + value: data.orderBaseInfo[field.field],
  183 + };
  184 + }).filter((item) => !!item.value);
  185 + }
  186 +
  187 + // async function handleDetail(data) {
  188 + // fieldInfos.value = {
  189 + // auditRoleCodes: data.auditRoleCodes,
  190 + // baseFields: [],
  191 + // reportFields: [],
  192 + // profitFields: [],
  193 + // inspectionStageFields: [],
  194 + // trackStageFields: [],
  195 + // };
  196 + // openDrawer(true, { data });
  197 +
  198 + // !isEmpty(data.fieldInfos.baseFields) &&
  199 + // Object.entries(data.fieldInfos.baseFields)?.map(([key, value]) => {
  200 + // if (value === 'UN_LOCKED') {
  201 + // const obj = find(FIELDS_BASE_INFO, { field: key });
  202 + // fieldInfos.value.baseFields.push(obj?.label);
  203 + // }
  204 + // });
  205 + // !isEmpty(data.fieldInfos.reportFields) &&
  206 + // Object.entries(data.fieldInfos.reportFields).map(([key, value]) => {
  207 + // if (value === 'UN_LOCKED') {
  208 + // const obj = find(FIELDS_REPORT_INFO, { field: key });
  209 + // fieldInfos.value.reportFields.push(obj?.label);
  210 + // }
  211 + // });
  212 + // !isEmpty(data.fieldInfos.profitAnalysisFields) &&
  213 + // Object.entries(data.fieldInfos.profitAnalysisFields).map(([key, value]) => {
  214 + // if (value === 'UN_LOCKED') {
  215 + // const obj = find(FIELDS_PROFIT_INFO, { field: key });
  216 + // fieldInfos.value.profitFields.push(obj?.label);
  217 + // }
  218 + // });
  219 +
  220 + // !isEmpty(data.fieldInfos.trackStageFields) &&
  221 + // Object.entries(data.fieldInfos.trackStageFields).map(([key, value]) => {
  222 + // if (value === 'UN_LOCKED') {
  223 + // const obj = find(FIELDS_TRACK_STAGE_INFO, { field: key });
  224 + // fieldInfos.value.trackStageFields.push(obj?.label);
  225 + // }
  226 + // });
  227 +
  228 + // !isEmpty(data.fieldInfos.inspectionStageFields) &&
  229 + // Object.entries(data.fieldInfos.inspectionStageFields).map(([key, value]) => {
  230 + // if (value === 'UN_LOCKED') {
  231 + // const obj = find(FIELDS_INSPECTION_INFO, { field: key });
  232 + // fieldInfos.value.inspectionStageFields.push(obj?.label);
  233 + // }
  234 + // });
  235 +
  236 + // id.value = data.id;
  237 + // baseInfos.value = FIELDS_BASE_INFO.map((field) => {
  238 + // return {
  239 + // label: field.label,
  240 + // value: data.orderBaseInfo[field.field],
  241 + // };
  242 + // }).filter((item) => !!item.value);
  243 + // }
  244 +
  245 + async function handleTrue() {
  246 + await approveAuditApi({ status: 10, id: id.value });
  247 + reload();
  248 + closeDrawer();
  249 + }
  250 +
  251 + async function handleFalse() {
  252 + msgVisible.value = true;
  253 + }
  254 +
  255 + const role = computed(() => {
  256 + return userStore.getUserInfo?.roleSmallVO?.code;
  257 + });
  258 +
  259 + // 定义MsgModalClose的事件,方便子组件调用
  260 + const handleMsgModalClose = async (data) => {
  261 + if (data) {
  262 + await approveAuditApi({ status: 20, id: id.value, refuseRemark: data });
  263 + reload();
  264 + closeDrawer();
  265 + }
  266 + msgVisible.value = false;
  267 + };
  268 +
  269 + const handlePreview = (url) => {
  270 + createImgPreview({ imageList: [url], defaultWidth: 500 });
  271 + return false;
  272 + };
  273 +
  274 + return {
  275 + handleProfitModal,
  276 + registerTable,
  277 + checkedKeys,
  278 + currentKey,
  279 + onSelect,
  280 + handleEdit,
  281 + onSelectAll,
  282 + handleDetail,
  283 + registerDrawer,
  284 + fieldInfos,
  285 + baseInfos,
  286 + handleTrue,
  287 + handleFalse,
  288 + ROLE,
  289 + role,
  290 + msgVisible,
  291 + handleMsgModalClose,
  292 + handlePreview,
  293 + };
  294 + },
  295 + });
  296 +</script>
src/views/project/approve/index.vue
@@ -34,6 +34,18 @@ @@ -34,6 +34,18 @@
34 > 34 >
35 <PayPanel /> 35 <PayPanel />
36 </a-tab-pane> 36 </a-tab-pane>
  37 + <a-tab-pane
  38 + key="11"
  39 + tab="分析表字段审核"
  40 + v-if="
  41 + role == ROLE.FINANCE ||
  42 + role == ROLE.ADMIN ||
  43 + role == ROLE.BUSINESS ||
  44 + role == ROLE.TRACKER
  45 + "
  46 + >
  47 + <ProfitFieldPanel />
  48 + </a-tab-pane>
37 <a-tab-pane key="2" tab="字段已审核" v-if="role !== ROLE.FINANCE"> 49 <a-tab-pane key="2" tab="字段已审核" v-if="role !== ROLE.FINANCE">
38 <FieldPanel isApproved /> 50 <FieldPanel isApproved />
39 </a-tab-pane> 51 </a-tab-pane>
@@ -67,6 +79,18 @@ @@ -67,6 +79,18 @@
67 > 79 >
68 <PayPanel isApproved /> 80 <PayPanel isApproved />
69 </a-tab-pane> 81 </a-tab-pane>
  82 + <a-tab-pane
  83 + key="12"
  84 + tab="分析表字段已审核"
  85 + v-if="
  86 + role == ROLE.FINANCE ||
  87 + role == ROLE.ADMIN ||
  88 + role == ROLE.BUSINESS ||
  89 + role == ROLE.TRACKER
  90 + "
  91 + >
  92 + <ProfitFieldPanel isApproved />
  93 + </a-tab-pane>
70 </a-tabs> 94 </a-tabs>
71 </div> 95 </div>
72 </template> 96 </template>
@@ -79,6 +103,7 @@ @@ -79,6 +103,7 @@
79 import FieldPanel from './FieldPanel.vue'; 103 import FieldPanel from './FieldPanel.vue';
80 import ReceivePanel from './ReceivePanel.vue'; 104 import ReceivePanel from './ReceivePanel.vue';
81 import PayPanel from './PayPanel.vue'; 105 import PayPanel from './PayPanel.vue';
  106 + import ProfitFieldPanel from './ProfitFieldPanel.vue';
82 import { useOrderStoreWithOut } from '/@/store/modules/order'; 107 import { useOrderStoreWithOut } from '/@/store/modules/order';
83 import { useUserStoreWithOut } from '/@/store/modules/user'; 108 import { useUserStoreWithOut } from '/@/store/modules/user';
84 109
@@ -98,6 +123,7 @@ @@ -98,6 +123,7 @@
98 ProfitPanel, 123 ProfitPanel,
99 ReceivePanel, 124 ReceivePanel,
100 PayPanel, 125 PayPanel,
  126 + ProfitFieldPanel,
101 }, 127 },
102 setup() { 128 setup() {
103 const checkedKeys = ref<Array<string | number>>([]); 129 const checkedKeys = ref<Array<string | number>>([]);
src/views/project/finance/financeProfit/ProductProfit/InnerData/ApproveReason.vue 0 → 100644
  1 +<template>
  2 + <BasicModal
  3 + v-bind="$attrs"
  4 + destroyOnClose
  5 + @register="register"
  6 + title="申请原因"
  7 + :helpMessage="['提示1', '提示2']"
  8 + @open-change="handleShow"
  9 + :bodyStyle="{ height: '200px' }"
  10 + @ok="handleOk"
  11 + z-index="9999"
  12 + >
  13 + <a-textarea v-model:value="input" :rows="7" />
  14 + </BasicModal>
  15 +</template>
  16 +<script lang="ts" setup>
  17 + import { ref, watch } from 'vue';
  18 + import { BasicModal, useModalInner } from '@/components/Modal';
  19 + import { orderAuth } from '/@/api/project/order';
  20 + import { getPackageApplyEdit } from '/@/api/project/invoice';
  21 +
  22 + const emit = defineEmits(['success']);
  23 + const input = ref('');
  24 + const baseFieldValues = ref();
  25 + const [register, { setModalProps, redoModalHeight, closeModal }] = useModalInner(async (data) => {
  26 + baseFieldValues.value = data.data;
  27 + baseFieldValues.value.orderId = data.id;
  28 + });
  29 + async function handleOk() {
  30 + baseFieldValues.value.applyRemark = input.value;
  31 + await getPackageApplyEdit({
  32 + orderId: baseFieldValues.value.orderId,
  33 + productionActualPrice: baseFieldValues.value.productionActualPrice,
  34 + productionDepartmentPredictPrice: baseFieldValues.value.productionDepartmentPredictPrice,
  35 + });
  36 + emit('success');
  37 + setTimeout(() => {
  38 + closeModal();
  39 + }, 50);
  40 + }
  41 + function handleShow() {
  42 + input.value = '';
  43 + closeModal();
  44 + }
  45 +</script>
src/views/project/finance/financeProfit/ProductProfit/InnerData/CheckDetail.vue
@@ -13,8 +13,7 @@ @@ -13,8 +13,7 @@
13 okText="申请" 13 okText="申请"
14 ><input /> 14 ><input />
15 <div> 15 <div>
16 - <template v-if="role === ROLE.ADMIN || role === ROLE.TRACKER">  
17 - <h3>基本信息</h3> 16 + <template v-if="role === ROLE.ADMIN || role === ROLE.FINANCE">
18 <BasicForm @register="registerForm" /> 17 <BasicForm @register="registerForm" />
19 </template> 18 </template>
20 </div> 19 </div>
@@ -24,43 +23,38 @@ @@ -24,43 +23,38 @@
24 <a-button type="primary" @click="onGoFormDetail"> 返回编辑</a-button> 23 <a-button type="primary" @click="onGoFormDetail"> 返回编辑</a-button>
25 </template> --> 24 </template> -->
26 </BasicDrawer> 25 </BasicDrawer>
  26 + <ApproveReason @register="approveReasonRegister" @success="handleCloseModal" />
27 </div> 27 </div>
28 </template> 28 </template>
29 <script lang="ts"> 29 <script lang="ts">
30 import { computed, defineComponent, reactive, ref } from 'vue'; 30 import { computed, defineComponent, reactive, ref } from 'vue';
31 import { BasicForm, useForm } from '/@/components/Form/index'; 31 import { BasicForm, useForm } from '/@/components/Form/index';
32 - import { orderAuth } from '/@/api/project/order'; 32 + import { getPackageApplyEdit } from '/@/api/project/invoice';
33 import { ROLE } from '../../../financeList/type.d'; 33 import { ROLE } from '../../../financeList/type.d';
34 import { useModal } from '/@/components/Modal'; 34 import { useModal } from '/@/components/Modal';
35 - 35 + import ApproveReason from './ApproveReason.vue';
36 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; 36 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
37 import { FIELDS_BASE_INFO } from './tableData'; 37 import { FIELDS_BASE_INFO } from './tableData';
38 import { useUserStoreWithOut } from '/@/store/modules/user'; 38 import { useUserStoreWithOut } from '/@/store/modules/user';
39 39
40 const userStore = useUserStoreWithOut(); 40 const userStore = useUserStoreWithOut();
41 const getSchema = (fields) => 41 const getSchema = (fields) =>
42 - fields  
43 - .map((item) => ({  
44 - field: `${item.field}`,  
45 - dataIndex: `${item.field}`,  
46 - label: item.label,  
47 - component: 'Switch',  
48 - componentProps: {  
49 - checkedValue: 'UN_LOCKED',  
50 - unCheckedValue: 'LOCKED',  
51 - },  
52 - colProps: {  
53 - span: 6,  
54 - },  
55 - }))  
56 - .filter(  
57 - (item) =>  
58 - // item.field !== 'packetPrice' &&  
59 - item.field !== 'exchangeRate' && item.field !== 'profitRate',  
60 - ); 42 + fields.map((item) => ({
  43 + field: `${item.field}`,
  44 + dataIndex: `${item.field}`,
  45 + label: item.label,
  46 + component: 'Switch',
  47 + componentProps: {
  48 + checkedValue: 'UN_LOCKED',
  49 + unCheckedValue: 'LOCKED',
  50 + },
  51 + colProps: {
  52 + span: 8,
  53 + },
  54 + }));
61 55
62 export default defineComponent({ 56 export default defineComponent({
63 - components: { BasicDrawer, BasicForm }, 57 + components: { BasicDrawer, BasicForm, ApproveReason },
64 props: { 58 props: {
65 onGoFormDetail: { 59 onGoFormDetail: {
66 type: Function, 60 type: Function,
@@ -70,17 +64,19 @@ @@ -70,17 +64,19 @@
70 const id = ref(''); 64 const id = ref('');
71 const schemas = getSchema(FIELDS_BASE_INFO); 65 const schemas = getSchema(FIELDS_BASE_INFO);
72 const [registerForm, { getFieldsValue }] = useForm({ 66 const [registerForm, { getFieldsValue }] = useForm({
73 - labelWidth: 120, 67 + labelWidth: 180,
74 schemas, 68 schemas,
75 showActionButtonGroup: false, 69 showActionButtonGroup: false,
76 actionColOptions: { 70 actionColOptions: {
77 span: 24, 71 span: 24,
78 }, 72 },
79 }); 73 });
  74 + const [approveReasonRegister, { openModal: openApproveReasonDrawer }] = useModal();
  75 +
80 const lockFields = reactive({}); 76 const lockFields = reactive({});
81 const [register, { closeDrawer }] = useDrawerInner((data) => { 77 const [register, { closeDrawer }] = useDrawerInner((data) => {
82 Object.assign(lockFields, data.lockFields); 78 Object.assign(lockFields, data.lockFields);
83 - id.value = data.id; 79 + id.value = data.orderId;
84 }); 80 });
85 function handleCloseModal() { 81 function handleCloseModal() {
86 closeDrawer(); 82 closeDrawer();
@@ -92,32 +88,33 @@ @@ -92,32 +88,33 @@
92 88
93 const handleSubmit = async () => { 89 const handleSubmit = async () => {
94 const baseFieldValues = getFieldsValue(); 90 const baseFieldValues = getFieldsValue();
  91 + console.log(baseFieldValues, '5656baseFieldValues');
  92 + openApproveReasonDrawer(true, {
  93 + data: baseFieldValues,
  94 + id: id.value,
  95 + });
  96 + // await getPackageApplyEdit({
  97 + // orderId: id.value,
  98 + // productionActualPrice: baseFieldValues.productionActualPrice,
  99 + // productionDepartmentPredictPrice: baseFieldValues.productionDepartmentPredictPrice,
  100 + // });
  101 + // if (baseFieldValues) {
  102 + // FIELDS_BASE_INFO.map(
  103 + // ({ field }) =>
  104 + // (baseFieldValues[field] =
  105 + // baseFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'),
  106 + // );
  107 + // }
  108 + // const values = Object.assign({ orderId: id.value }, { baseFields: baseFieldValues });
95 109
96 - if (baseFieldValues) {  
97 - FIELDS_BASE_INFO.map(  
98 - ({ field }) =>  
99 - (baseFieldValues[field] =  
100 - baseFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'),  
101 - );  
102 - }  
103 - const values = Object.assign({ orderId: id.value }, { baseFields: baseFieldValues }); 110 + // if (values.baseFields && values.baseFields.packetActualRmbTotalPrice === 'UN_LOCKED') {
  111 + // console.log(values, '5656values1');
  112 + // } else {
  113 + // // await orderAuth(values);
  114 + // console.log(values, '5656values2');
104 115
105 - if (  
106 - values.baseFields &&  
107 - (values.baseFields.projectNo === 'UN_LOCKED' ||  
108 - values.baseFields.productionDepartment === 'UN_LOCKED' ||  
109 - values.baseFields.innerNo === 'UN_LOCKED' ||  
110 - values.baseFields.customerCode === 'UN_LOCKED' ||  
111 - values.baseFields.customerPo === 'UN_LOCKED' ||  
112 - values.baseFields.customerStyle === 'UN_LOCKED')  
113 - ) {  
114 - openReasonModal(true, {  
115 - data: values,  
116 - });  
117 - } else {  
118 - await orderAuth(values);  
119 - closeDrawer();  
120 - } 116 + // closeDrawer();
  117 + // }
121 }; 118 };
122 119
123 return { 120 return {
@@ -126,6 +123,8 @@ @@ -126,6 +123,8 @@
126 registerForm, 123 registerForm,
127 handleSubmit, 124 handleSubmit,
128 handleCloseModal, 125 handleCloseModal,
  126 + approveReasonRegister,
  127 + openApproveReasonDrawer,
129 ROLE, 128 ROLE,
130 role, 129 role,
131 }; 130 };
src/views/project/finance/financeProfit/ProductProfit/InnerData/data.tsx
@@ -3,7 +3,70 @@ import { BasicColumn } from &#39;@/components/Table&#39;; @@ -3,7 +3,70 @@ import { BasicColumn } from &#39;@/components/Table&#39;;
3 import { func } from 'vue-types'; 3 import { func } from 'vue-types';
4 import { h, ref } from 'vue'; 4 import { h, ref } from 'vue';
5 import { FilePptOutlined } from '@ant-design/icons-vue'; 5 import { FilePptOutlined } from '@ant-design/icons-vue';
  6 +import { queryNoOptions } from '/@/api/project/order';
  7 +import { useOrderStoreWithOut } from '/@/store/modules/order';
  8 +import { useOrderInfo } from '/@/hooks/component/order';
6 9
  10 +const innerNoOptions = ref([]);
  11 +const projectNoOptions = ref([]);
  12 +const orderStore = useOrderStoreWithOut();
  13 +const {
  14 + customerCode,
  15 + productionDepartment,
  16 +} = useOrderInfo(orderStore);
  17 +export const searchFormSchema = [
  18 + {
  19 + title: '客户编码',
  20 + dataIndex: 'customerCode',
  21 + width: 150,
  22 + },
  23 + {
  24 + field: 'projectNo',
  25 + label: '项目号',
  26 + component: 'Select',
  27 + colProps: { span: 8 },
  28 +
  29 + componentProps: {
  30 + options: projectNoOptions,
  31 + showSearch: true,
  32 + mode: 'multiple',
  33 + onSearch: async (value: any) => {
  34 + projectNoOptions.value = await queryNoOptions('projectNo', value);
  35 + },
  36 + // onSearch: async (value: any) => {
  37 + // projectNoOptions.value = await queryNoOptions('projectNo', value);
  38 + // },
  39 + },
  40 + },
  41 + {
  42 + field: 'productionDepartment',
  43 + label: '生产科',
  44 + component: 'Select',
  45 + colProps: { span: 8 },
  46 +
  47 + componentProps: {
  48 + mode: 'multiple',
  49 +
  50 + options: productionDepartment,
  51 + showSearch: true,
  52 + },
  53 + },
  54 + {
  55 + field: 'innerNo',
  56 + label: '内部编号',
  57 + component: 'Select',
  58 + colProps: { span: 8 },
  59 +
  60 + componentProps: {
  61 + options: innerNoOptions,
  62 + showSearch: true,
  63 + mode: 'multiple',
  64 + onSearch: async (value: any) => {
  65 + innerNoOptions.value = await queryNoOptions('innerNo', value);
  66 + },
  67 + },
  68 + },
  69 +]
7 // export const COLUMNS = [ 70 // export const COLUMNS = [
8 // { 71 // {
9 // title: '客户编码', 72 // title: '客户编码',
src/views/project/finance/financeProfit/ProductProfit/InnerData/tableData.tsx
@@ -21,74 +21,18 @@ const orderStore = useOrderStoreWithOut(); @@ -21,74 +21,18 @@ const orderStore = useOrderStoreWithOut();
21 // 基本信息 21 // 基本信息
22 export const FIELDS_BASE_INFO = [ 22 export const FIELDS_BASE_INFO = [
23 { 23 {
24 - field: 'customerCode', 24 + field: 'productionDepartmentPredictPrice',
25 component: 'Select', 25 component: 'Select',
26 - labelWidth: 150,  
27 - label: '客户编码',  
28 - rules: [{ required: true }],  
29 - },  
30 - {  
31 - field: 'projectNo',  
32 - component: 'Input',  
33 - labelWidth: 150,  
34 - label: '项目号', 26 + labelWidth: 180,
  27 + label: '生产科预算金额',
35 rules: [{ required: true }], 28 rules: [{ required: true }],
36 }, 29 },
37 { 30 {
38 - field: 'productionDepartment', 31 + field: 'productionActualPrice',
39 component: 'Select', 32 component: 'Select',
40 - // componentProps: {  
41 - // options: productionDepartmentOptions,  
42 - // },  
43 - labelWidth: 150,  
44 - label: '生产科',  
45 - rules: [{ required: true }],  
46 - },  
47 -  
48 - {  
49 - field: 'innerNo',  
50 - component: 'Input',  
51 - labelWidth: 150,  
52 - label: '内部编号',  
53 - rules: [  
54 - { required: true },  
55 - {  
56 - validator: async (rule, value) => {  
57 - if (value.includes(' ')) {  
58 - return Promise.reject();  
59 - }  
60 - return Promise.resolve();  
61 - },  
62 - message: '内容存在空格,请检查',  
63 - trigger: ['change', 'blur'],  
64 - },  
65 - ],  
66 - },  
67 - {  
68 - field: 'customerPo',  
69 - component: 'Input',  
70 labelWidth: 150, 33 labelWidth: 150,
71 - label: '客户po号', 34 + label: '实际发生费用',
72 rules: [{ required: true }], 35 rules: [{ required: true }],
73 }, 36 },
74 - {  
75 - field: 'customerStyle',  
76 - component: 'Input',  
77 - labelWidth: 150,  
78 - label: '客户STYLE',  
79 - rules: [  
80 - { required: true },  
81 - {  
82 - validator: async (rule, value) => {  
83 - if (value.includes(' ')) {  
84 - return Promise.reject();  
85 - }  
86 - return Promise.resolve();  
87 - },  
88 - message: '内容存在空格,请检查',  
89 - trigger: ['change', 'blur'],  
90 - },  
91 - ],  
92 - },  
93 ]; 37 ];
94 38
src/views/project/finance/financeProfit/ProductProfit/InnerProduce/data.tsx
@@ -4,6 +4,9 @@ import { func } from &#39;vue-types&#39;; @@ -4,6 +4,9 @@ import { func } from &#39;vue-types&#39;;
4 import { h, ref } from 'vue'; 4 import { h, ref } from 'vue';
5 import { FilePptOutlined } from '@ant-design/icons-vue'; 5 import { FilePptOutlined } from '@ant-design/icons-vue';
6 import axios from 'axios'; 6 import axios from 'axios';
  7 +import { queryNoOptions } from '/@/api/project/order';
  8 +import { useOrderStoreWithOut } from '/@/store/modules/order';
  9 +import { useOrderInfo } from '/@/hooks/component/order';
7 10
8 // export const COLUMNS = [ 11 // export const COLUMNS = [
9 // { 12 // {
@@ -20,6 +23,73 @@ import axios from &#39;axios&#39;; @@ -20,6 +23,73 @@ import axios from &#39;axios&#39;;
20 // scopedSlots: { customRender: 'name' } 23 // scopedSlots: { customRender: 'name' }
21 // }, 24 // },
22 // ]; 25 // ];
  26 +const innerNoOptions = ref([]);
  27 +const projectNoOptions = ref([]);
  28 +const orderStore = useOrderStoreWithOut();
  29 +const {
  30 + customerCode,
  31 + productionDepartment,
  32 +} = useOrderInfo(orderStore);
  33 +export const searchFormSchema = [
  34 + {
  35 + field: 'customerCode',
  36 + label: '客户编码',
  37 + component: 'Select',
  38 + colProps: { span: 8 },
  39 +
  40 + componentProps: {
  41 + options: customerCode,
  42 + showSearch: true,
  43 + mode: 'multiple',
  44 + },
  45 + },
  46 + {
  47 + field: 'projectNo',
  48 + label: '项目号',
  49 + component: 'Select',
  50 + colProps: { span: 8 },
  51 +
  52 + componentProps: {
  53 + options: projectNoOptions,
  54 + showSearch: true,
  55 + mode: 'multiple',
  56 + onSearch: async (value: any) => {
  57 + projectNoOptions.value = await queryNoOptions('projectNo', value);
  58 + },
  59 + // onSearch: async (value: any) => {
  60 + // projectNoOptions.value = await queryNoOptions('projectNo', value);
  61 + // },
  62 + },
  63 + },
  64 + {
  65 + field: 'productionDepartment',
  66 + label: '生产科',
  67 + component: 'Select',
  68 + colProps: { span: 8 },
  69 +
  70 + componentProps: {
  71 + mode: 'multiple',
  72 +
  73 + options: productionDepartment,
  74 + showSearch: true,
  75 + },
  76 + },
  77 + {
  78 + field: 'innerNo',
  79 + label: '内部编号',
  80 + component: 'Select',
  81 + colProps: { span: 8 },
  82 +
  83 + componentProps: {
  84 + options: innerNoOptions,
  85 + showSearch: true,
  86 + mode: 'multiple',
  87 + onSearch: async (value: any) => {
  88 + innerNoOptions.value = await queryNoOptions('innerNo', value);
  89 + },
  90 + },
  91 + },
  92 +]
23 export const COLUMNS = [ 93 export const COLUMNS = [
24 { 94 {
25 title: '客户编码', 95 title: '客户编码',
src/views/project/finance/financeProfit/ProductProfit/InnerProduce/index.vue
@@ -38,16 +38,18 @@ @@ -38,16 +38,18 @@
38 <script setup lang="ts"> 38 <script setup lang="ts">
39 import { BasicTable, useTable, TableAction } from '/@/components/Table'; 39 import { BasicTable, useTable, TableAction } from '/@/components/Table';
40 import { getInnerProduceProfit } from '@/api/project/invoice'; 40 import { getInnerProduceProfit } from '@/api/project/invoice';
41 - import { COLUMNS } from './data'; 41 + import { searchFormSchema, COLUMNS } from './data';
42 import { BasicModal, useModal } from '/@/components/Modal'; 42 import { BasicModal, useModal } from '/@/components/Modal';
43 import { useMessage } from '/@/hooks/web/useMessage'; 43 import { useMessage } from '/@/hooks/web/useMessage';
44 - import { ref } from 'vue'; 44 + import { onMounted, ref } from 'vue';
45 import { useDrawer } from '/@/components/Drawer'; 45 import { useDrawer } from '/@/components/Drawer';
46 import FinanceEdit from './FinanceEdit.vue'; 46 import FinanceEdit from './FinanceEdit.vue';
  47 + import { useOrderStoreWithOut } from '/@/store/modules/order';
47 48
48 const { createMessage } = useMessage(); 49 const { createMessage } = useMessage();
49 const { error } = createMessage; 50 const { error } = createMessage;
50 const message = ref(); 51 const message = ref();
  52 + const orderStore = useOrderStoreWithOut();
51 const [registerFinanceEdit, { openDrawer: openFinanceEdit }] = useDrawer(); 53 const [registerFinanceEdit, { openDrawer: openFinanceEdit }] = useDrawer();
52 const handleOk = (record) => { 54 const handleOk = (record) => {
53 // 修改父组件的状态 55 // 修改父组件的状态
@@ -63,13 +65,19 @@ @@ -63,13 +65,19 @@
63 api: getInnerProduceProfit, 65 api: getInnerProduceProfit,
64 bordered: true, 66 bordered: true,
65 columns: COLUMNS, 67 columns: COLUMNS,
  68 + clickToRowSelect: false,
66 rowKey: 'id', 69 rowKey: 'id',
  70 + formConfig: {
  71 + labelWidth: 120,
  72 + schemas: searchFormSchema,
  73 + autoSubmitOnEnter: true,
  74 + },
67 useSearchForm: true, 75 useSearchForm: true,
68 - // actionColumn: {  
69 - // width: 240,  
70 - // title: 'Action',  
71 - // dataIndex: 'action',  
72 - // }, 76 + showTableSetting: true,
  77 + showIndexColumn: false,
  78 + tableSetting: {
  79 + setting: false,
  80 + },
73 }); 81 });
74 82
75 // function createActions(record: any): any[] { 83 // function createActions(record: any): any[] {
@@ -115,6 +123,10 @@ @@ -115,6 +123,10 @@
115 // ]; 123 // ];
116 // } 124 // }
117 125
  126 + onMounted(async () => {
  127 + await orderStore.getDict();
  128 + });
  129 +
118 function handleFinanceEdit(record) { 130 function handleFinanceEdit(record) {
119 openFinanceEdit(true, { 131 openFinanceEdit(true, {
120 data: record, 132 data: record,
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/ApproveReason.vue 0 → 100644
  1 +<template>
  2 + <BasicModal
  3 + v-bind="$attrs"
  4 + destroyOnClose
  5 + @register="register"
  6 + title="申请原因"
  7 + :helpMessage="['提示1', '提示2']"
  8 + @open-change="handleShow"
  9 + :bodyStyle="{ height: '200px' }"
  10 + @ok="handleOk"
  11 + z-index="9999"
  12 + >
  13 + <a-textarea v-model:value="input" :rows="7" />
  14 + </BasicModal>
  15 +</template>
  16 +<script lang="ts" setup>
  17 + import { ref, watch } from 'vue';
  18 + import { BasicModal, useModalInner } from '@/components/Modal';
  19 + import { orderAuth } from '/@/api/project/order';
  20 + import { getPackageApplyEdit } from '/@/api/project/invoice';
  21 +
  22 + const emit = defineEmits(['success']);
  23 + const input = ref('');
  24 + const baseFieldValues = ref();
  25 + const [register, { setModalProps, redoModalHeight, closeModal }] = useModalInner(async (data) => {
  26 + baseFieldValues.value = data.data;
  27 + baseFieldValues.value.orderId = data.id;
  28 + });
  29 + async function handleOk() {
  30 + baseFieldValues.value.applyRemark = input.value;
  31 + await getPackageApplyEdit({
  32 + orderId: baseFieldValues.value.orderId,
  33 + packetActualRmbTotalPrice: baseFieldValues.value.packetActualRmbTotalPrice,
  34 + applyRemark: baseFieldValues.value.applyRemark,
  35 + });
  36 + emit('success');
  37 + setTimeout(() => {
  38 + closeModal();
  39 + }, 50);
  40 + }
  41 + function handleShow() {
  42 + input.value = '';
  43 + closeModal();
  44 + }
  45 +</script>
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/CheckDetail.vue
@@ -13,8 +13,7 @@ @@ -13,8 +13,7 @@
13 okText="申请" 13 okText="申请"
14 ><input /> 14 ><input />
15 <div> 15 <div>
16 - <template v-if="role === ROLE.ADMIN || role === ROLE.TRACKER">  
17 - <h3>基本信息</h3> 16 + <template v-if="role === ROLE.ADMIN || role === ROLE.FINANCE">
18 <BasicForm @register="registerForm" /> 17 <BasicForm @register="registerForm" />
19 </template> 18 </template>
20 </div> 19 </div>
@@ -24,15 +23,16 @@ @@ -24,15 +23,16 @@
24 <a-button type="primary" @click="onGoFormDetail"> 返回编辑</a-button> 23 <a-button type="primary" @click="onGoFormDetail"> 返回编辑</a-button>
25 </template> --> 24 </template> -->
26 </BasicDrawer> 25 </BasicDrawer>
  26 + <ApproveReason @register="approveReasonRegister" @success="handleCloseModal" />
27 </div> 27 </div>
28 </template> 28 </template>
29 <script lang="ts"> 29 <script lang="ts">
30 import { computed, defineComponent, reactive, ref } from 'vue'; 30 import { computed, defineComponent, reactive, ref } from 'vue';
31 import { BasicForm, useForm } from '/@/components/Form/index'; 31 import { BasicForm, useForm } from '/@/components/Form/index';
32 - import { orderAuth } from '/@/api/project/order'; 32 + import { getPackageApplyEdit } from '/@/api/project/invoice';
33 import { ROLE } from '../../../financeList/type.d'; 33 import { ROLE } from '../../../financeList/type.d';
34 import { useModal } from '/@/components/Modal'; 34 import { useModal } from '/@/components/Modal';
35 - 35 + import ApproveReason from './ApproveReason.vue';
36 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; 36 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
37 import { FIELDS_BASE_INFO } from './tableData'; 37 import { FIELDS_BASE_INFO } from './tableData';
38 import { useUserStoreWithOut } from '/@/store/modules/user'; 38 import { useUserStoreWithOut } from '/@/store/modules/user';
@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
60 ); 60 );
61 61
62 export default defineComponent({ 62 export default defineComponent({
63 - components: { BasicDrawer, BasicForm }, 63 + components: { BasicDrawer, BasicForm, ApproveReason },
64 props: { 64 props: {
65 onGoFormDetail: { 65 onGoFormDetail: {
66 type: Function, 66 type: Function,
@@ -70,17 +70,20 @@ @@ -70,17 +70,20 @@
70 const id = ref(''); 70 const id = ref('');
71 const schemas = getSchema(FIELDS_BASE_INFO); 71 const schemas = getSchema(FIELDS_BASE_INFO);
72 const [registerForm, { getFieldsValue }] = useForm({ 72 const [registerForm, { getFieldsValue }] = useForm({
73 - labelWidth: 120, 73 + labelWidth: 180,
74 schemas, 74 schemas,
75 showActionButtonGroup: false, 75 showActionButtonGroup: false,
76 actionColOptions: { 76 actionColOptions: {
77 span: 24, 77 span: 24,
78 }, 78 },
79 }); 79 });
  80 + const [approveReasonRegister, { openModal: openApproveReasonDrawer }] = useModal();
  81 +
80 const lockFields = reactive({}); 82 const lockFields = reactive({});
81 const [register, { closeDrawer }] = useDrawerInner((data) => { 83 const [register, { closeDrawer }] = useDrawerInner((data) => {
  84 + console.log(data, '5656datach');
82 Object.assign(lockFields, data.lockFields); 85 Object.assign(lockFields, data.lockFields);
83 - id.value = data.id; 86 + id.value = data.orderId;
84 }); 87 });
85 function handleCloseModal() { 88 function handleCloseModal() {
86 closeDrawer(); 89 closeDrawer();
@@ -92,32 +95,32 @@ @@ -92,32 +95,32 @@
92 95
93 const handleSubmit = async () => { 96 const handleSubmit = async () => {
94 const baseFieldValues = getFieldsValue(); 97 const baseFieldValues = getFieldsValue();
  98 + console.log(baseFieldValues, '5656baseFieldValues');
  99 + openApproveReasonDrawer(true, {
  100 + data: baseFieldValues,
  101 + id: id.value,
  102 + });
  103 + // await getPackageApplyEdit({
  104 + // orderId: id.value,
  105 + // packetActualRmbTotalPrice: baseFieldValues.packetActualRmbTotalPrice,
  106 + // });
  107 + // if (baseFieldValues) {
  108 + // FIELDS_BASE_INFO.map(
  109 + // ({ field }) =>
  110 + // (baseFieldValues[field] =
  111 + // baseFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'),
  112 + // );
  113 + // }
  114 + // const values = Object.assign({ orderId: id.value }, { baseFields: baseFieldValues });
95 115
96 - if (baseFieldValues) {  
97 - FIELDS_BASE_INFO.map(  
98 - ({ field }) =>  
99 - (baseFieldValues[field] =  
100 - baseFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'),  
101 - );  
102 - }  
103 - const values = Object.assign({ orderId: id.value }, { baseFields: baseFieldValues }); 116 + // if (values.baseFields && values.baseFields.packetActualRmbTotalPrice === 'UN_LOCKED') {
  117 + // console.log(values, '5656values1');
  118 + // } else {
  119 + // // await orderAuth(values);
  120 + // console.log(values, '5656values2');
104 121
105 - if (  
106 - values.baseFields &&  
107 - (values.baseFields.projectNo === 'UN_LOCKED' ||  
108 - values.baseFields.productionDepartment === 'UN_LOCKED' ||  
109 - values.baseFields.innerNo === 'UN_LOCKED' ||  
110 - values.baseFields.customerCode === 'UN_LOCKED' ||  
111 - values.baseFields.customerPo === 'UN_LOCKED' ||  
112 - values.baseFields.customerStyle === 'UN_LOCKED')  
113 - ) {  
114 - openReasonModal(true, {  
115 - data: values,  
116 - });  
117 - } else {  
118 - await orderAuth(values);  
119 - closeDrawer();  
120 - } 122 + // closeDrawer();
  123 + // }
121 }; 124 };
122 125
123 return { 126 return {
@@ -126,6 +129,8 @@ @@ -126,6 +129,8 @@
126 registerForm, 129 registerForm,
127 handleSubmit, 130 handleSubmit,
128 handleCloseModal, 131 handleCloseModal,
  132 + approveReasonRegister,
  133 + openApproveReasonDrawer,
129 ROLE, 134 ROLE,
130 role, 135 role,
131 }; 136 };
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/data.tsx
@@ -3,7 +3,70 @@ import { BasicColumn } from &#39;@/components/Table&#39;; @@ -3,7 +3,70 @@ import { BasicColumn } from &#39;@/components/Table&#39;;
3 import { func } from 'vue-types'; 3 import { func } from 'vue-types';
4 import { h, ref } from 'vue'; 4 import { h, ref } from 'vue';
5 import { FilePptOutlined } from '@ant-design/icons-vue'; 5 import { FilePptOutlined } from '@ant-design/icons-vue';
  6 +import { queryNoOptions } from '/@/api/project/order';
  7 +import { useOrderStoreWithOut } from '/@/store/modules/order';
  8 +import { useOrderInfo } from '/@/hooks/component/order';
6 9
  10 +const innerNoOptions = ref([]);
  11 +const projectNoOptions = ref([]);
  12 +const orderStore = useOrderStoreWithOut();
  13 +const {
  14 + customerCode,
  15 + productionDepartment,
  16 +} = useOrderInfo(orderStore);
  17 +export const searchFormSchema = [
  18 + {
  19 + title: '客户编码',
  20 + dataIndex: 'customerCode',
  21 + width: 150,
  22 + },
  23 + {
  24 + field: 'projectNo',
  25 + label: '项目号',
  26 + component: 'Select',
  27 + colProps: { span: 8 },
  28 +
  29 + componentProps: {
  30 + options: projectNoOptions,
  31 + showSearch: true,
  32 + mode: 'multiple',
  33 + onSearch: async (value: any) => {
  34 + projectNoOptions.value = await queryNoOptions('projectNo', value);
  35 + },
  36 + // onSearch: async (value: any) => {
  37 + // projectNoOptions.value = await queryNoOptions('projectNo', value);
  38 + // },
  39 + },
  40 + },
  41 + {
  42 + field: 'productionDepartment',
  43 + label: '生产科',
  44 + component: 'Select',
  45 + colProps: { span: 8 },
  46 +
  47 + componentProps: {
  48 + mode: 'multiple',
  49 +
  50 + options: productionDepartment,
  51 + showSearch: true,
  52 + },
  53 + },
  54 + {
  55 + field: 'innerNo',
  56 + label: '内部编号',
  57 + component: 'Select',
  58 + colProps: { span: 8 },
  59 +
  60 + componentProps: {
  61 + options: innerNoOptions,
  62 + showSearch: true,
  63 + mode: 'multiple',
  64 + onSearch: async (value: any) => {
  65 + innerNoOptions.value = await queryNoOptions('innerNo', value);
  66 + },
  67 + },
  68 + },
  69 +]
7 // export const COLUMNS = [ 70 // export const COLUMNS = [
8 // { 71 // {
9 // title: '客户编码', 72 // title: '客户编码',
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/tableData.tsx
@@ -21,74 +21,11 @@ const orderStore = useOrderStoreWithOut(); @@ -21,74 +21,11 @@ const orderStore = useOrderStoreWithOut();
21 // 基本信息 21 // 基本信息
22 export const FIELDS_BASE_INFO = [ 22 export const FIELDS_BASE_INFO = [
23 { 23 {
24 - field: 'customerCode', 24 + field: 'packetActualRmbTotalPrice',
25 component: 'Select', 25 component: 'Select',
26 labelWidth: 150, 26 labelWidth: 150,
27 - label: '客户编码', 27 + label: '包装费用实际金额¥',
28 rules: [{ required: true }], 28 rules: [{ required: true }],
29 }, 29 },
30 - {  
31 - field: 'projectNo',  
32 - component: 'Input',  
33 - labelWidth: 150,  
34 - label: '项目号',  
35 - rules: [{ required: true }],  
36 - },  
37 - {  
38 - field: 'productionDepartment',  
39 - component: 'Select',  
40 - // componentProps: {  
41 - // options: productionDepartmentOptions,  
42 - // },  
43 - labelWidth: 150,  
44 - label: '生产科',  
45 - rules: [{ required: true }],  
46 - },  
47 -  
48 - {  
49 - field: 'innerNo',  
50 - component: 'Input',  
51 - labelWidth: 150,  
52 - label: '内部编号',  
53 - rules: [  
54 - { required: true },  
55 - {  
56 - validator: async (rule, value) => {  
57 - if (value.includes(' ')) {  
58 - return Promise.reject();  
59 - }  
60 - return Promise.resolve();  
61 - },  
62 - message: '内容存在空格,请检查',  
63 - trigger: ['change', 'blur'],  
64 - },  
65 - ],  
66 - },  
67 - {  
68 - field: 'customerPo',  
69 - component: 'Input',  
70 - labelWidth: 150,  
71 - label: '客户po号',  
72 - rules: [{ required: true }],  
73 - },  
74 - {  
75 - field: 'customerStyle',  
76 - component: 'Input',  
77 - labelWidth: 150,  
78 - label: '客户STYLE',  
79 - rules: [  
80 - { required: true },  
81 - {  
82 - validator: async (rule, value) => {  
83 - if (value.includes(' ')) {  
84 - return Promise.reject();  
85 - }  
86 - return Promise.resolve();  
87 - },  
88 - message: '内容存在空格,请检查',  
89 - trigger: ['change', 'blur'],  
90 - },  
91 - ],  
92 - },  
93 ]; 30 ];
94 31
src/views/project/finance/financeProfit/ServiceProfit/ServiceProfit/ApproveReason.vue 0 → 100644
  1 +<template>
  2 + <BasicModal
  3 + v-bind="$attrs"
  4 + destroyOnClose
  5 + @register="register"
  6 + title="申请原因"
  7 + :helpMessage="['提示1', '提示2']"
  8 + @open-change="handleShow"
  9 + :bodyStyle="{ height: '200px' }"
  10 + @ok="handleOk"
  11 + z-index="9999"
  12 + >
  13 + <a-textarea v-model:value="input" :rows="7" />
  14 + </BasicModal>
  15 +</template>
  16 +<script lang="ts" setup>
  17 + import { ref, watch } from 'vue';
  18 + import { BasicModal, useModalInner } from '@/components/Modal';
  19 + import { orderAuth } from '/@/api/project/order';
  20 + import { getServiceApplyEdit } from '/@/api/project/invoice';
  21 +
  22 + const emit = defineEmits(['success']);
  23 + const input = ref('');
  24 + const baseFieldValues = ref();
  25 + const [register, { setModalProps, redoModalHeight, closeModal }] = useModalInner(async (data) => {
  26 + baseFieldValues.value = data.data;
  27 + baseFieldValues.value.projectNoPrefix = data.id;
  28 + });
  29 + async function handleOk() {
  30 + baseFieldValues.value.applyRemark = input.value;
  31 + await getServiceApplyEdit({
  32 + projectNoPrefix: baseFieldValues.value.projectNoPrefix,
  33 + actualExchangeRate: baseFieldValues.value.actualExchangeRate,
  34 + developmentCopyRmbTotalPrice: baseFieldValues.value.developmentCopyRmbTotalPrice,
  35 + paidRmbCommission: baseFieldValues.value.paidRmbCommission,
  36 + projectStartTime: baseFieldValues.value.projectStartTime,
  37 + projectEndTime: baseFieldValues.value.projectEndTime,
  38 + spainPaidRmbCommission: baseFieldValues.value.spainPaidRmbCommission,
  39 + applyRemark: baseFieldValues.value.applyRemark,
  40 + });
  41 + emit('success');
  42 + setTimeout(() => {
  43 + closeModal();
  44 + }, 50);
  45 + }
  46 + function handleShow() {
  47 + input.value = '';
  48 + closeModal();
  49 + }
  50 +</script>
src/views/project/finance/financeProfit/ServiceProfit/ServiceProfit/CheckDetail.vue
@@ -13,8 +13,7 @@ @@ -13,8 +13,7 @@
13 okText="申请" 13 okText="申请"
14 ><input /> 14 ><input />
15 <div> 15 <div>
16 - <template v-if="role === ROLE.ADMIN || role === ROLE.TRACKER">  
17 - <h3>基本信息</h3> 16 + <template v-if="role === ROLE.ADMIN || role === ROLE.FINANCE">
18 <BasicForm @register="registerForm" /> 17 <BasicForm @register="registerForm" />
19 </template> 18 </template>
20 </div> 19 </div>
@@ -24,43 +23,38 @@ @@ -24,43 +23,38 @@
24 <a-button type="primary" @click="onGoFormDetail"> 返回编辑</a-button> 23 <a-button type="primary" @click="onGoFormDetail"> 返回编辑</a-button>
25 </template> --> 24 </template> -->
26 </BasicDrawer> 25 </BasicDrawer>
  26 + <ApproveReason @register="approveReasonRegister" @success="handleCloseModal" />
27 </div> 27 </div>
28 </template> 28 </template>
29 <script lang="ts"> 29 <script lang="ts">
30 import { computed, defineComponent, reactive, ref } from 'vue'; 30 import { computed, defineComponent, reactive, ref } from 'vue';
31 import { BasicForm, useForm } from '/@/components/Form/index'; 31 import { BasicForm, useForm } from '/@/components/Form/index';
32 - import { orderAuth } from '/@/api/project/order'; 32 + import { getServiceApplyEdit } from '/@/api/project/invoice';
33 import { ROLE } from '../../../financeList/type.d'; 33 import { ROLE } from '../../../financeList/type.d';
34 import { useModal } from '/@/components/Modal'; 34 import { useModal } from '/@/components/Modal';
35 - 35 + import ApproveReason from './ApproveReason.vue';
36 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; 36 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
37 import { FIELDS_BASE_INFO } from './tableData'; 37 import { FIELDS_BASE_INFO } from './tableData';
38 import { useUserStoreWithOut } from '/@/store/modules/user'; 38 import { useUserStoreWithOut } from '/@/store/modules/user';
39 39
40 const userStore = useUserStoreWithOut(); 40 const userStore = useUserStoreWithOut();
41 const getSchema = (fields) => 41 const getSchema = (fields) =>
42 - fields  
43 - .map((item) => ({  
44 - field: `${item.field}`,  
45 - dataIndex: `${item.field}`,  
46 - label: item.label,  
47 - component: 'Switch',  
48 - componentProps: {  
49 - checkedValue: 'UN_LOCKED',  
50 - unCheckedValue: 'LOCKED',  
51 - },  
52 - colProps: {  
53 - span: 6,  
54 - },  
55 - }))  
56 - .filter(  
57 - (item) =>  
58 - // item.field !== 'packetPrice' &&  
59 - item.field !== 'exchangeRate' && item.field !== 'profitRate',  
60 - ); 42 + fields.map((item) => ({
  43 + field: `${item.field}`,
  44 + dataIndex: `${item.field}`,
  45 + label: item.label,
  46 + component: 'Switch',
  47 + componentProps: {
  48 + checkedValue: 'UN_LOCKED',
  49 + unCheckedValue: 'LOCKED',
  50 + },
  51 + colProps: {
  52 + span: 8,
  53 + },
  54 + }));
61 55
62 export default defineComponent({ 56 export default defineComponent({
63 - components: { BasicDrawer, BasicForm }, 57 + components: { BasicDrawer, BasicForm, ApproveReason },
64 props: { 58 props: {
65 onGoFormDetail: { 59 onGoFormDetail: {
66 type: Function, 60 type: Function,
@@ -70,17 +64,20 @@ @@ -70,17 +64,20 @@
70 const id = ref(''); 64 const id = ref('');
71 const schemas = getSchema(FIELDS_BASE_INFO); 65 const schemas = getSchema(FIELDS_BASE_INFO);
72 const [registerForm, { getFieldsValue }] = useForm({ 66 const [registerForm, { getFieldsValue }] = useForm({
73 - labelWidth: 120, 67 + labelWidth: 180,
74 schemas, 68 schemas,
75 showActionButtonGroup: false, 69 showActionButtonGroup: false,
76 actionColOptions: { 70 actionColOptions: {
77 span: 24, 71 span: 24,
78 }, 72 },
79 }); 73 });
  74 + const [approveReasonRegister, { openModal: openApproveReasonDrawer }] = useModal();
  75 +
80 const lockFields = reactive({}); 76 const lockFields = reactive({});
81 const [register, { closeDrawer }] = useDrawerInner((data) => { 77 const [register, { closeDrawer }] = useDrawerInner((data) => {
  78 + console.log(data, '5656datach');
82 Object.assign(lockFields, data.lockFields); 79 Object.assign(lockFields, data.lockFields);
83 - id.value = data.id; 80 + id.value = data.projectNoPrefix;
84 }); 81 });
85 function handleCloseModal() { 82 function handleCloseModal() {
86 closeDrawer(); 83 closeDrawer();
@@ -92,32 +89,37 @@ @@ -92,32 +89,37 @@
92 89
93 const handleSubmit = async () => { 90 const handleSubmit = async () => {
94 const baseFieldValues = getFieldsValue(); 91 const baseFieldValues = getFieldsValue();
  92 + openApproveReasonDrawer(true, {
  93 + data: baseFieldValues,
  94 + id: id.value,
  95 + });
  96 + console.log(baseFieldValues, '5656baseFieldValues');
  97 + // await getServiceApplyEdit({
  98 + // projectNoPrefix: id.value,
  99 + // actualExchangeRate: baseFieldValues.actualExchangeRate,
  100 + // developmentCopyRmbTotalPrice: baseFieldValues.developmentCopyRmbTotalPrice,
  101 + // paidRmbCommission: baseFieldValues.paidRmbCommission,
  102 + // projectStartTime: baseFieldValues.projectStartTime,
  103 + // projectEndTime: baseFieldValues.projectEndTime,
  104 + // spainPaidRmbCommission: baseFieldValues.spainPaidRmbCommission,
  105 + // });
  106 + // if (baseFieldValues) {
  107 + // FIELDS_BASE_INFO.map(
  108 + // ({ field }) =>
  109 + // (baseFieldValues[field] =
  110 + // baseFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'),
  111 + // );
  112 + // }
  113 + // const values = Object.assign({ orderId: id.value }, { baseFields: baseFieldValues });
95 114
96 - if (baseFieldValues) {  
97 - FIELDS_BASE_INFO.map(  
98 - ({ field }) =>  
99 - (baseFieldValues[field] =  
100 - baseFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'),  
101 - );  
102 - }  
103 - const values = Object.assign({ orderId: id.value }, { baseFields: baseFieldValues }); 115 + // if (values.baseFields && values.baseFields.packetActualRmbTotalPrice === 'UN_LOCKED') {
  116 + // console.log(values, '5656values1');
  117 + // } else {
  118 + // // await orderAuth(values);
  119 + // console.log(values, '5656values2');
104 120
105 - if (  
106 - values.baseFields &&  
107 - (values.baseFields.projectNo === 'UN_LOCKED' ||  
108 - values.baseFields.productionDepartment === 'UN_LOCKED' ||  
109 - values.baseFields.innerNo === 'UN_LOCKED' ||  
110 - values.baseFields.customerCode === 'UN_LOCKED' ||  
111 - values.baseFields.customerPo === 'UN_LOCKED' ||  
112 - values.baseFields.customerStyle === 'UN_LOCKED')  
113 - ) {  
114 - openReasonModal(true, {  
115 - data: values,  
116 - });  
117 - } else {  
118 - await orderAuth(values);  
119 - closeDrawer();  
120 - } 121 + // closeDrawer();
  122 + // }
121 }; 123 };
122 124
123 return { 125 return {
@@ -126,6 +128,8 @@ @@ -126,6 +128,8 @@
126 registerForm, 128 registerForm,
127 handleSubmit, 129 handleSubmit,
128 handleCloseModal, 130 handleCloseModal,
  131 + approveReasonRegister,
  132 + openApproveReasonDrawer,
129 ROLE, 133 ROLE,
130 role, 134 role,
131 }; 135 };
src/views/project/finance/financeProfit/ServiceProfit/ServiceProfit/data.tsx
@@ -4,6 +4,9 @@ import { func } from &#39;vue-types&#39;; @@ -4,6 +4,9 @@ import { func } from &#39;vue-types&#39;;
4 import { h, ref } from 'vue'; 4 import { h, ref } from 'vue';
5 import { FilePptOutlined } from '@ant-design/icons-vue'; 5 import { FilePptOutlined } from '@ant-design/icons-vue';
6 import axios from 'axios'; 6 import axios from 'axios';
  7 +import { queryNoOptions } from '/@/api/project/order';
  8 +import { useOrderStoreWithOut } from '/@/store/modules/order';
  9 +import { useOrderInfo } from '/@/hooks/component/order';
7 10
8 // export const COLUMNS = [ 11 // export const COLUMNS = [
9 // { 12 // {
@@ -20,6 +23,73 @@ import axios from &#39;axios&#39;; @@ -20,6 +23,73 @@ import axios from &#39;axios&#39;;
20 // scopedSlots: { customRender: 'name' } 23 // scopedSlots: { customRender: 'name' }
21 // }, 24 // },
22 // ]; 25 // ];
  26 +const innerNoOptions = ref([]);
  27 +const projectNoOptions = ref([]);
  28 +const orderStore = useOrderStoreWithOut();
  29 +const {
  30 + customerCode,
  31 + productionDepartment,
  32 +} = useOrderInfo(orderStore);
  33 +export const searchFormSchema = [
  34 + {
  35 + field: 'customerCode',
  36 + label: '客户编码',
  37 + component: 'Select',
  38 + colProps: { span: 8 },
  39 +
  40 + componentProps: {
  41 + options: customerCode,
  42 + showSearch: true,
  43 + mode: 'multiple',
  44 + },
  45 + },
  46 + {
  47 + field: 'projectNo',
  48 + label: '项目号',
  49 + component: 'Select',
  50 + colProps: { span: 8 },
  51 +
  52 + componentProps: {
  53 + options: projectNoOptions,
  54 + showSearch: true,
  55 + mode: 'multiple',
  56 + onSearch: async (value: any) => {
  57 + projectNoOptions.value = await queryNoOptions('projectNo', value);
  58 + },
  59 + // onSearch: async (value: any) => {
  60 + // projectNoOptions.value = await queryNoOptions('projectNo', value);
  61 + // },
  62 + },
  63 + },
  64 + {
  65 + field: 'productionDepartment',
  66 + label: '生产科',
  67 + component: 'Select',
  68 + colProps: { span: 8 },
  69 +
  70 + componentProps: {
  71 + mode: 'multiple',
  72 +
  73 + options: productionDepartment,
  74 + showSearch: true,
  75 + },
  76 + },
  77 + {
  78 + field: 'innerNo',
  79 + label: '内部编号',
  80 + component: 'Select',
  81 + colProps: { span: 8 },
  82 +
  83 + componentProps: {
  84 + options: innerNoOptions,
  85 + showSearch: true,
  86 + mode: 'multiple',
  87 + onSearch: async (value: any) => {
  88 + innerNoOptions.value = await queryNoOptions('innerNo', value);
  89 + },
  90 + },
  91 + },
  92 +]
23 export const COLUMNS = [ 93 export const COLUMNS = [
24 { 94 {
25 title: '客户编码', 95 title: '客户编码',
src/views/project/finance/financeProfit/ServiceProfit/ServiceProfit/index.vue
@@ -36,17 +36,19 @@ @@ -36,17 +36,19 @@
36 <script setup lang="ts"> 36 <script setup lang="ts">
37 import { BasicTable, useTable, TableAction } from '/@/components/Table'; 37 import { BasicTable, useTable, TableAction } from '/@/components/Table';
38 import { getServiceProfit } from '@/api/project/invoice'; 38 import { getServiceProfit } from '@/api/project/invoice';
39 - import { COLUMNS } from './data'; 39 + import { searchFormSchema, COLUMNS } from './data';
40 import { BasicModal, useModal } from '/@/components/Modal'; 40 import { BasicModal, useModal } from '/@/components/Modal';
41 import { useMessage } from '/@/hooks/web/useMessage'; 41 import { useMessage } from '/@/hooks/web/useMessage';
42 - import { ref } from 'vue'; 42 + import { onMounted, ref } from 'vue';
43 import { useDrawer } from '/@/components/Drawer'; 43 import { useDrawer } from '/@/components/Drawer';
44 import FinanceEdit from './FinanceEdit.vue'; 44 import FinanceEdit from './FinanceEdit.vue';
45 import CheckDetail from './CheckDetail.vue'; 45 import CheckDetail from './CheckDetail.vue';
  46 + import { useOrderStoreWithOut } from '/@/store/modules/order';
46 47
47 const { createMessage } = useMessage(); 48 const { createMessage } = useMessage();
48 const { error } = createMessage; 49 const { error } = createMessage;
49 const message = ref(); 50 const message = ref();
  51 + const orderStore = useOrderStoreWithOut();
50 const [checkModalRegister, { openDrawer: openCheckDetailDrawer }] = useDrawer(); 52 const [checkModalRegister, { openDrawer: openCheckDetailDrawer }] = useDrawer();
51 const [registerFinanceEdit, { openDrawer: openFinanceEdit }] = useDrawer(); 53 const [registerFinanceEdit, { openDrawer: openFinanceEdit }] = useDrawer();
52 // const handleOk = (record) => { 54 // const handleOk = (record) => {
@@ -63,8 +65,19 @@ @@ -63,8 +65,19 @@
63 api: getServiceProfit, 65 api: getServiceProfit,
64 bordered: true, 66 bordered: true,
65 columns: COLUMNS, 67 columns: COLUMNS,
  68 + clickToRowSelect: false,
66 rowKey: 'id', 69 rowKey: 'id',
  70 + formConfig: {
  71 + labelWidth: 120,
  72 + schemas: searchFormSchema,
  73 + autoSubmitOnEnter: true,
  74 + },
67 useSearchForm: true, 75 useSearchForm: true,
  76 + showTableSetting: true,
  77 + showIndexColumn: false,
  78 + tableSetting: {
  79 + setting: false,
  80 + },
68 actionColumn: { 81 actionColumn: {
69 width: 240, 82 width: 240,
70 title: 'Action', 83 title: 'Action',
@@ -115,6 +128,10 @@ @@ -115,6 +128,10 @@
115 ]; 128 ];
116 } 129 }
117 130
  131 + onMounted(async () => {
  132 + await orderStore.getDict();
  133 + });
  134 +
118 function handleFinanceEdit(record) { 135 function handleFinanceEdit(record) {
119 console.log(record, '5656reer'); 136 console.log(record, '5656reer');
120 openFinanceEdit(true, { 137 openFinanceEdit(true, {
src/views/project/finance/financeProfit/ServiceProfit/ServiceProfit/tableData.tsx
@@ -21,74 +21,46 @@ const orderStore = useOrderStoreWithOut(); @@ -21,74 +21,46 @@ const orderStore = useOrderStoreWithOut();
21 // 基本信息 21 // 基本信息
22 export const FIELDS_BASE_INFO = [ 22 export const FIELDS_BASE_INFO = [
23 { 23 {
24 - field: 'customerCode', 24 + field: 'developmentCopyRmbTotalPrice',
25 component: 'Select', 25 component: 'Select',
26 labelWidth: 150, 26 labelWidth: 150,
27 - label: '客户编码', 27 + label: '研发复制费合计¥',
28 rules: [{ required: true }], 28 rules: [{ required: true }],
29 }, 29 },
30 { 30 {
31 - field: 'projectNo',  
32 - component: 'Input', 31 + field: 'projectStartTime',
  32 + component: 'Select',
33 labelWidth: 150, 33 labelWidth: 150,
34 - label: '项目', 34 + label: '项目开始时间',
35 rules: [{ required: true }], 35 rules: [{ required: true }],
36 }, 36 },
37 { 37 {
38 - field: 'productionDepartment', 38 + field: 'projectEndTime',
39 component: 'Select', 39 component: 'Select',
40 - // componentProps: {  
41 - // options: productionDepartmentOptions,  
42 - // },  
43 labelWidth: 150, 40 labelWidth: 150,
44 - label: '生产科', 41 + label: '项目结束时间',
45 rules: [{ required: true }], 42 rules: [{ required: true }],
46 }, 43 },
47 -  
48 { 44 {
49 - field: 'innerNo',  
50 - component: 'Input', 45 + field: 'spainPaidRmbCommission',
  46 + component: 'Select',
51 labelWidth: 150, 47 labelWidth: 150,
52 - label: '内部编号',  
53 - rules: [  
54 - { required: true },  
55 - {  
56 - validator: async (rule, value) => {  
57 - if (value.includes(' ')) {  
58 - return Promise.reject();  
59 - }  
60 - return Promise.resolve();  
61 - },  
62 - message: '内容存在空格,请检查',  
63 - trigger: ['change', 'blur'],  
64 - },  
65 - ], 48 + label: '西班牙已发提成¥',
  49 + rules: [{ required: true }],
66 }, 50 },
67 { 51 {
68 - field: 'customerPo',  
69 - component: 'Input', 52 + field: 'paidRmbCommission',
  53 + component: 'Select',
70 labelWidth: 150, 54 labelWidth: 150,
71 - label: '客户po号', 55 + label: '中国团队已发提成¥',
72 rules: [{ required: true }], 56 rules: [{ required: true }],
73 }, 57 },
74 { 58 {
75 - field: 'customerStyle',  
76 - component: 'Input', 59 + field: 'actualExchangeRate',
  60 + component: 'Select',
77 labelWidth: 150, 61 labelWidth: 150,
78 - label: '客户STYLE',  
79 - rules: [  
80 - { required: true },  
81 - {  
82 - validator: async (rule, value) => {  
83 - if (value.includes(' ')) {  
84 - return Promise.reject();  
85 - }  
86 - return Promise.resolve();  
87 - },  
88 - message: '内容存在空格,请检查',  
89 - trigger: ['change', 'blur'],  
90 - },  
91 - ], 62 + label: '实际汇率¥',
  63 + rules: [{ required: true }],
92 }, 64 },
93 ]; 65 ];
94 66