| src/api/collaborativeApproval/shipmentReview.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/collaborativeApproval/shipmentReview/fileList.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/collaborativeApproval/shipmentReview/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/salesManagement/salesLedger/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/api/collaborativeApproval/shipmentReview.js
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,21 @@ // åè´§å®¡æ¹ import request from "@/utils/request"; // è·åå货审æ¹å表 export function getShipmentApprovalList(query) { return request({ url: '/shipmentApproval/listPage', method: 'get', params: query, }) } // åè´§ç³è¯·æ¹å // /shipmentApproval/update export function approveShipment(query) { return request({ url: '/shipmentApproval/update', method: 'post', data: query, }) } src/views/collaborativeApproval/shipmentReview/fileList.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,43 @@ <template> <el-dialog v-model="dialogVisible" title="éä»¶" width="40%" :before-close="handleClose"> <el-table :data="tableData" border height="40vh"> <el-table-column label="éä»¶åç§°" prop="name" min-width="400" show-overflow-tooltip /> <el-table-column fixed="right" label="æä½" width="100" align="center"> <template #default="scope"> <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">ä¸è½½</el-button> <el-button link type="primary" size="small" @click="lookFile(scope.row)">é¢è§</el-button> </template> </el-table-column> </el-table> </el-dialog> <filePreview ref="filePreviewRef" /> </template> <script setup> import { ref } from 'vue' import filePreview from '@/components/filePreview/index.vue' const dialogVisible = ref(false) const tableData = ref([]) const { proxy } = getCurrentInstance(); const filePreviewRef = ref() const handleClose = () => { dialogVisible.value = false } const open = (list) => { dialogVisible.value = true tableData.value = list } const downLoadFile = (row) => { proxy.$download.name(row.url); } const lookFile = (row) => { filePreviewRef.value.open(row.url) } defineExpose({ open }) </script> <style></style> src/views/collaborativeApproval/shipmentReview/index.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,340 @@ <template> <div class="app-container"> <div class="search_form"> <div> <span class="search_title">éå®ååå·ï¼</span> <el-input v-model="searchForm.salesContractNo" style="width: 240px" placeholder="请è¾å ¥éå®ååå·æç´¢" @change="handleQuery" clearable :prefix-icon="Search" /> <span class="search_title ml10">审æ¹ç¶æï¼</span> <el-select v-model="searchForm.approveStatus" clearable @change="handleQuery" style="width: 240px"> <el-option label="å¾ å®¡æ ¸" :value="2" /> <el-option label="å®¡æ ¸æå" :value="3" /> <el-option label="å®¡æ ¸å¤±è´¥" :value="4" /> </el-select> <el-button type="primary" @click="handleQuery" style="margin-left: 10px" >æç´¢</el-button > </div> <div> <!-- <el-button type="primary" @click="openForm('add')">æ°å¢</el-button>--> <el-button @click="handleOut">导åº</el-button> <!-- <el-button type="danger" plain @click="handleDelete">å é¤</el-button>--> </div> </div> <div class="table_list"> <PIMTable rowKey="id" :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true" @selection-change="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination" :total="page.total" ></PIMTable> </div> <info-form-dia ref="infoFormDia" @close="handleQuery" :approveType="approveType"></info-form-dia> <approval-dia ref="approvalDia" @close="handleQuery"></approval-dia> <FileList ref="fileListRef" /> </div> </template> <script setup> import FileList from "./fileList.vue"; import { Search } from "@element-plus/icons-vue"; import {onMounted, ref} from "vue"; import {ElMessageBox} from "element-plus"; import InfoFormDia from "@/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue"; import ApprovalDia from "@/views/collaborativeApproval/approvalProcess/components/approvalDia.vue"; import {getShipmentApprovalList, approveShipment} from "@/api/collaborativeApproval/shipmentReview.js"; // import {approveProcessDelete, approveProcessListPage} from "@/api/collaborativeApproval/approvalProcess.js"; import useUserStore from "@/store/modules/user"; import { userListNoPage } from "@/api/system/user.js"; // å®ä¹ç»ä»¶æ¥æ¶çprops const props = defineProps({ approveType: { type: [Number, String], default: 6 } }); const userList = ref([]); const userStore = useUserStore(); const data = reactive({ searchForm: { approveId: "", approveStatus: "", }, }); const { searchForm } = toRefs(data); const tableColumn = ref([ { label: "审æ¹ç¶æ", prop: "approveStatus", dataType: "tag", width: 100, formatData: (params) => { if (params === 2) { return "å¾ å®¡æ ¸"; } else if (params === 3) { return "å®¡æ ¸å®æ"; } else if (params === 4) { return "å®¡æ ¸é©³å"; } else { return 'æªç¥ç¶æ'; } }, formatType: (params) => { if (params === 0) { return "warning"; } else if (params === 2) { return "info"; } else if (params === 3) { return "success"; } else if (params === 4) { return "danger"; } else { return 'danger'; } }, }, { label: "éå®ååå·", prop: "salesContractNo", width: 170 }, { label: "客æ·åç§°", prop: "customerName", width: 200 }, { label: "产å大类", prop: "productCategory", width: 200 }, { label: "è§æ ¼åå·", prop: "specificationModel", width: 220 }, { label: "ç³è¯·äºº", prop: "approveUserId", width: 120, align: "center", formatData:(params)=>{ const user = userList.value.find(item => item.userId === params) return user ? user.nickName : '--' } }, { label: "车çå·", prop: "shippingCarNumber", width: 120, }, { label: "ç³è¯·äºº", prop: "approveUserId", width: 120, }, { label: "ç³è¯·æ¥æ", prop: "executionDate", width: 200 }, { label: "å½å审æ¹äºº", prop: "salesman", width: 120 }, { dataType: "action", label: "æä½", align: "center", fixed: "right", width: 120, operation: [ { name: "éè¿", type: "text", clickFun: (row) => { handleApproval("éè¿", row); }, disabled: (row) => row.approveStatus !== 2 }, { name: "驳å", type: "text", clickFun: (row) => { handleApproval("驳å", row); }, disabled: (row) => row.approveStatus !== 2 }, // { // name: "ç¼è¾", // type: "text", // clickFun: (row) => { // openForm("edit", row); // }, // disabled: (row) => row.approveStatus == 2 || row.approveStatus == 1 || row.approveStatus == 4 // }, // { // name: "å®¡æ ¸", // type: "text", // clickFun: (row) => { // openApprovalDia("approval", row); // }, // disabled: (row) => row.approveUserCurrentId == null || row.approveStatus == 2 || row.approveStatus == 3 || row.approveStatus == 4 || row.approveUserCurrentId !== userStore.id // }, // { // name: "详æ ", // type: "text", // clickFun: (row) => { // openApprovalDia('view', row); // }, // }, // { // name: "éä»¶", // type: "text", // clickFun: (row) => { // downLoadFile(row); // }, // }, ], }, ]); const tableData = ref([]); const selectedRows = ref([]); const tableLoading = ref(false); const page = reactive({ current: 1, size: 100, total: 0 }); const infoFormDia = ref() const approvalDia = ref() const { proxy } = getCurrentInstance() // æ¥è¯¢å表 /** æç´¢æé®æä½ */ const handleQuery = () => { page.current = 1; getList(); }; const fileListRef = ref(null) const downLoadFile = (row) => { fileListRef.value.open(row.commonFileList) } const pagination = (obj) => { page.current = obj.page; page.size = obj.limit; getList(); }; const getList =async () => { let userLists = await userListNoPage(); userList.value = userLists.data; tableLoading.value = true; getShipmentApprovalList({...page, ...searchForm.value,approveType:props.approveType}).then(res => { tableLoading.value = false; tableData.value = res.data.records page.total = res.data.total; }).catch(err => { tableLoading.value = false; }) }; // å¯¼åº const handleOut = () => { const type = Number(props.approveType || 6) const urlMap = { 0: "/shipmentApproval/export", } const url = urlMap[type] || urlMap[0] const nameMap = { 0: "åè´§å®¡æ ¸è¡¨", } const fileName = nameMap[type] || nameMap[0] proxy.download(url, {}, `${fileName}.xlsx`) } // è¡¨æ ¼éæ©æ°æ® const handleSelectionChange = (selection) => { selectedRows.value = selection; }; // æå¼æ°å¢ãç¼è¾å¼¹æ¡ const openForm = (type, row) => { nextTick(() => { infoFormDia.value?.openDialog(type, row) }) }; // æå¼æ°å¢æ£éªå¼¹æ¡ const openApprovalDia = (type, row) => { nextTick(() => { approvalDia.value?.openDialog(type, row) }) }; // å®¡æ ¸éè¿/驳å const handleApproval = (name = "å®¡æ ¸",row) => { ElMessageBox.confirm(`éä¸çå 容å°è¢«${name}ï¼æ¯å¦ç¡®è®¤${name}ï¼`, "æç¤º", { confirmButtonText: "确认", cancelButtonText: "åæ¶", type: "warning", }).then(async()=>{ let res = await approveShipment({ id: row.id, approveStatus: name === "éè¿" ? 3 : 4 }); if(res.code === 200){ proxy.$modal.msgSuccess(`${name}æå`); }else{ proxy.$modal.msgError(`${name}失败`); } await getList() }).catch(err=>{ proxy.$modal.msgError(`æªç¥é误,请è系管çå`); }) }; // å é¤ const handleDelete = () => { let ids = []; if (selectedRows.value.length > 0) { ids = selectedRows.value.map((item) => item.approveId); } else { proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); return; } ElMessageBox.confirm("éä¸çå 容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "导åº", { confirmButtonText: "确认", cancelButtonText: "åæ¶", type: "warning", }) .then(() => { approveProcessDelete(ids).then((res) => { proxy.$modal.msgSuccess("å 餿å"); getList(); }); }) .catch(() => { proxy.$modal.msg("已忶"); }); }; onMounted(() => { getList(); }); </script> <style scoped></style> src/views/salesManagement/salesLedger/index.vue
@@ -50,11 +50,50 @@ <el-table-column label="产å大类" prop="productCategory" /> <el-table-column label="è§æ ¼åå·" prop="specificationModel" /> <el-table-column label="åä½" prop="unit" /> <el-table-column label="çäº§ç¶æ" width="100px" align="center"> <template #default="scope"> <el-tag v-if="scope.row.productionStatus === '已宿'" type="success">已宿</el-tag> <el-tag v-if="scope.row.productionStatus === 'ç产ä¸'" type="warning">ç产ä¸</el-tag> <el-tag v-if="scope.row.productionStatus === 'æªå¼å§'" type="danger">æªå¼å§</el-tag> <el-tag v-if="!scope.row.productionStatus" type="info">ææ ç¶æ</el-tag> </template> </el-table-column> <el-table-column label="产åç¶æ" width="100px" align="center"> <template #default="scope"> <el-tag v-if="scope.row.approveStatus === 0" type="info">æªåºåº</el-tag> <el-tag v-if="scope.row.approveStatus === 1" type="success">å·²åºåº</el-tag> <el-tag v-if="scope.row.approveStatus === 2" type="warning">å®¡æ ¸ä¸</el-tag> <el-tag v-if="scope.row.approveStatus === 3" type="success">å®¡æ ¸æå</el-tag> <el-tag v-if="scope.row.approveStatus === 4" type="danger">å®¡æ ¸å¤±è´¥</el-tag> </template> </el-table-column> <el-table-column label="å货车ç" minWidth="100px" align="center"> <template #default="scope"> <div> <el-tag type="success" v-if="scope.row.shippingCarNumber">{{ scope.row.shippingCarNumber }}</el-tag> <el-tag v-else type="info">æªåè´§</el-tag> </div> </template> </el-table-column> <el-table-column label="åè´§æ¥æ" minWidth="100px" align="center"> <template #default="scope"> <div> <div v-if="scope.row.shippingDate">{{ scope.row.shippingDate }}</div> <el-tag v-else type="info">æªåè´§</el-tag> </div> </template> </el-table-column> <el-table-column label="æ°é" prop="quantity" /> <el-table-column label="ç¨ç(%)" prop="taxRate" /> <el-table-column label="å«ç¨åä»·(å )" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" /> <el-table-column label="å«ç¨æ»ä»·(å )" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" /> <el-table-column label="ä¸å«ç¨æ»ä»·(å )" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" /> <!--æä½--> <el-table-column Width="60px" label="æä½" align="center"> <template #default="scope"> <el-button :disabled="scope.row.approveStatus===2 || scope.row.approveStatus===5" link type="primary" size="small" @click="openDeliveryForm(scope.row)">åè´§</el-button> </template> </el-table-column> </el-table> </template> </el-table-column> @@ -70,12 +109,12 @@ <el-table-column label="å½å ¥äºº" prop="entryPersonName" width="100" show-overflow-tooltip /> <el-table-column label="å½å ¥æ¥æ" prop="entryDate" width="120" show-overflow-tooltip /> <el-table-column label="ç¾è®¢æ¥æ" prop="executionDate" width="120" show-overflow-tooltip /> <el-table-column fixed="right" label="æä½" min-width="200" align="center"> <el-table-column fixed="right" label="æä½" min-width="100" align="center"> <template #default="scope"> <el-button link type="primary" size="small" @click="openForm('edit', scope.row)">ç¼è¾</el-button> <!-- <el-button link type="primary" size="small" @click="openForm('view', scope.row)">详æ </el-button>--> <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">éä»¶</el-button> <el-button link type="primary" size="small" @click="openDeliveryForm(scope.row)">åè´§</el-button> <!-- <el-button link type="primary" size="small" @click="openDeliveryForm(scope.row)">åè´§</el-button>--> </template> </el-table-column> </el-table> @@ -442,6 +481,15 @@ </el-form-item> </el-col> </el-row> <el-row :gutter="30"> <el-col :span="24"> <el-form-item label="审æ¹äººï¼" prop="approverId"> <el-select v-model="deliveryForm.approverId" placeholder="è¯·éæ©å®¡æ¹äºº" clearable :disabled="operationType === 'view'"> <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" /> </el-select> </el-form-item> </el-col> </el-row> </el-form> <template #footer> <div class="dialog-footer"> @@ -601,6 +649,11 @@ shippingCarNumber: [ { required: true, message: "请è¾å ¥å货车çå·", trigger: "blur" } ], approverId:[ { required: true,message: "", } ] }, }); const { deliveryForm, deliveryRules } = toRefs(deliveryFormData); @@ -628,7 +681,9 @@ page.size = obj.limit; getList(); }; const getList = () => { const getList =async () => { let userLists = await userListNoPage(); userList.value = userLists.data; tableLoading.value = true; const { entryDate, ...rest } = searchForm; ledgerListPage({ ...rest, ...page }) @@ -709,23 +764,31 @@ productSelectedRows.value = selectedRows; }; const expandedRowKeys = ref([]); // å±å¼è¡ const expandChange = (row, expandedRows) => { if (expandedRows.length > 0) { // å±å¼è¡ï¼å§ç»åªå±å¼ä¸è¡ï¼ const expandChange = (row) => { const rowKey = row.id; const isExpanded = expandedRowKeys.value.includes(rowKey); if (isExpanded) { // å½åè¡å·²å±å¼ -> æ¶èµ· expandedRowKeys.value = []; try { productList({ salesLedgerId: row.id, type: 1 }).then((res) => { const index = tableData.value.findIndex((item) => item.id === row.id); if (index > -1) { tableData.value[index].children = res.data; } expandedRowKeys.value.push(row.id); }); } catch (error) { console.log(error); } } else { expandedRowKeys.value = []; return; } // å±å¼å½åè¡åï¼å æ¶èµ·å ¶å®è¡ expandedRowKeys.value = []; try { productList({ salesLedgerId: row.id, type: 1 }).then((res) => { const index = tableData.value.findIndex((item) => item.id === row.id); if (index > -1) { tableData.value[index].children = res.data; } // åªä¿çå½åè¿ä¸è¡å¤äºå±å¼ç¶æ expandedRowKeys.value = [rowKey]; }); } catch (error) { console.log(error); } }; // 主表åè®¡æ¹æ³ @@ -749,8 +812,6 @@ operationType.value = type; form.value = {}; productData.value = []; let userLists = await userListNoPage(); userList.value = userLists.data; customerList().then((res) => { customerOption.value = res; }); @@ -1524,16 +1585,12 @@ // æå¼åè´§å¼¹æ¡ const openDeliveryForm = (row) => { getProductInventory({ salesLedgerId: row.id, type:1 }).then((res) => { currentDeliveryRow.value = row; deliveryForm.value = { shippingDate: getCurrentDate(), shippingCarNumber: "", }; deliveryFormVisible.value = true; }).catch(err => { ElMessage.error(err.msg); }); currentDeliveryRow.value = row; deliveryForm.value = { shippingDate: "", // ç§»é¤é»è®¤å¼è®¾ç½® shippingCarNumber: "", }; deliveryFormVisible.value = true; }; // æäº¤å货表å @@ -1541,7 +1598,9 @@ proxy.$refs["deliveryFormRef"].validate((valid) => { if (valid) { addShippingInfo({ salesLedgerId: currentDeliveryRow.value.id, approverId:deliveryForm.value.approverId, salesLedgerId: currentDeliveryRow.value.salesLedgerId, salesLedgerProductId: currentDeliveryRow.value.id, shippingDate: deliveryForm.value.shippingDate, shippingCarNumber: deliveryForm.value.shippingCarNumber, }) @@ -1549,6 +1608,7 @@ proxy.$modal.msgSuccess("åè´§æå"); closeDeliveryDia(); getList(); expandedRowKeys.value = []; }) .catch(() => { proxy.$modal.msgError("å货失败ï¼è¯·éè¯");