Merge branch 'dev_New' into dev_NEW_pro
# Conflicts:
# src/views/productionManagement/processRoute/index.vue
# src/views/productionManagement/processRoute/processRouteItem/index.vue
# src/views/productionManagement/productStructure/Detail/index.vue
# src/views/productionManagement/productionProcess/Edit.vue
# src/views/productionManagement/productionProcess/New.vue
# src/views/productionManagement/productionProcess/index.vue
| | |
| | | // å®¢æ·æ¡£æ¡é¡µé¢æ¥å£ |
| | | import request from '@/utils/request' |
| | | |
| | | // å页æ¥è¯¢ |
| | | export function listCustomer(query) { |
| | | return request({ |
| | | url: '/basic/customer/list', |
| | |
| | | params: query |
| | | }) |
| | | } |
| | | // æ¥è¯¢å®¢æ·æ¡£æ¡è¯¦ç» |
| | | |
| | | // å®¢æ·æ¡£æ¡ç§æµ·æ¥è¯¢ |
| | | export function listCustomerPrivatePool(query) { |
| | | return request({ |
| | | url: '/customerPrivatePool/listPage', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | export function addCustomerPrivatePool(data) { |
| | | return request({ |
| | | url: '/customerPrivatePool/add', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export function addCustomerPrivate(data) { |
| | | return request({ |
| | | url: '/customerPrivate/add', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export function delCustomerPrivate(ids) { |
| | | return request({ |
| | | url: '/customerPrivate/delete', |
| | | method: 'delete', |
| | | data: ids |
| | | }) |
| | | } |
| | | |
| | | export function delCustomerPrivatePool(id) { |
| | | return request({ |
| | | url: '/customerPrivatePool/delete/' + id, |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | export function shareCustomer(data) { |
| | | return request({ |
| | | url: '/customerPrivatePool/together', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export function getCustomer(id) { |
| | | return request({ |
| | | url: '/basic/customer/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // æ°å¢å®¢æ·æ¡£æ¡ |
| | | |
| | | export function getCustomerPrivatePoolById(id) { |
| | | return request({ |
| | | url: '/customerPrivatePool/getbyId/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export function getCustomerPrivatePoolInfo(id) { |
| | | return request({ |
| | | url: '/customerPrivatePool/info/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export function addCustomer(data) { |
| | | return request({ |
| | | url: '/basic/customer/addCustomer', |
| | |
| | | data: data |
| | | }) |
| | | } |
| | | // ä¿®æ¹å®¢æ·æ¡£æ¡ |
| | | |
| | | export function updateCustomer(data) { |
| | | return request({ |
| | | url: '/basic/customer/updateCustomer', |
| | |
| | | data: data |
| | | }) |
| | | } |
| | | // 导åºå®¢æ·æ¡£æ¡ |
| | | |
| | | export function updateCustomerPrivatePool(data) { |
| | | return request({ |
| | | url: '/customerPrivatePool/update', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export function exportCustomer(query) { |
| | | return request({ |
| | | url: '/basic/customer/export', |
| | |
| | | responseType: 'blob' |
| | | }) |
| | | } |
| | | // å é¤å®¢æ·æ¡£æ¡ |
| | | |
| | | export function delCustomer(ids) { |
| | | return request({ |
| | | url: '/basic/customer/delCustomer', |
| | |
| | | }) |
| | | } |
| | | |
| | | |
| | | // æ°å¢å®¢æ·è·è¿ |
| | | export function addCustomerFollow(data) { |
| | | return request({ |
| | | url: '/basic/customer-follow/add', |
| | |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹å®¢æ·è·è¿ |
| | | export function updateCustomerFollow(data) { |
| | | return request({ |
| | | url: '/basic/customer-follow/edit', |
| | | method: 'put', |
| | | data: data, |
| | | }) |
| | | return request({ |
| | | url: '/basic/customer-follow/edit', |
| | | method: 'put', |
| | | data: data, |
| | | }) |
| | | } |
| | | // å é¤å®¢æ·è·è¿ |
| | | |
| | | export function delCustomerFollow(id) { |
| | | return request({ |
| | | url: '/basic/customer-follow/'+id, |
| | | url: '/basic/customer-follow/' + id, |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | // å访æé-æ°å¢/æ´æ° |
| | | export function addReturnVisit(data) { |
| | | return request({ |
| | | url: '/basic/customer-follow/return-visit', |
| | |
| | | data: data |
| | | }) |
| | | } |
| | | // è·åå访æé详æ
|
| | | |
| | | export function getReturnVisit(id) { |
| | | return request({ |
| | | url: '/basic/customer-follow/return-visit/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | } |
| | |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | export function productModelListByUrl(url, query) { |
| | | return request({ |
| | | url, |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | // ç产订å-颿å°è´¦å表 |
| | | export function listMaterialPickingLedger(query) { |
| | | return request({ |
| | | url: "/productOrderMaterial/list", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // ç产订å-ä¿å颿å°è´¦ |
| | | export function saveMaterialPickingLedger(data) { |
| | | return request({ |
| | | url: "/productOrderMaterial/save", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | // ç产订å-é¢æè¯¦æ
å表 |
| | | export function listMaterialPickingDetail(query) { |
| | | return request({ |
| | | url: "/productOrderMaterial/detailList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // ç产订å-è¡¥æè®°å½å表 |
| | | export function listMaterialSupplementRecord(query) { |
| | | return request({ |
| | | url: "/productOrderMaterial/supplementRecord", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // ç产订å-éæç¡®è®¤ |
| | | export function confirmMaterialReturn(data) { |
| | | return request({ |
| | | url: "/productOrderMaterial/confirmReturn", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | // è·åçæºæ£å¨å·¥ä½éæ°æ® |
| | | export function schedulingList(query) { |
| | | return request({ |
| | |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | } |
| | |
| | | responseType: "blob", |
| | | }); |
| | | } |
| | | |
| | | // å·¥å-å½åå·¥åºç©æå°è´¦ |
| | | export function listWorkOrderMaterialLedger(query) { |
| | | return request({ |
| | | url: "/productOrderMaterial/reportMaterials", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // å·¥å-è¡¥æ |
| | | export function addWorkOrderMaterialSupplement(data) { |
| | | return request({ |
| | | url: "/productWorkOrder/material/supplement", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | // å·¥å-éæ |
| | | export function addWorkOrderMaterialReturn(data) { |
| | | return request({ |
| | | url: "/productWorkOrder/material/return", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | // å·¥å-è¡¥æè®°å½ |
| | | export function listWorkOrderMaterialSupplementRecord(query) { |
| | | return request({ |
| | | url: "/productWorkOrder/material/supplementRecord", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // å·¥å-é¢ç¨ï¼æäº¤å®é
é¢ç¨æ°éï¼ |
| | | export function pickWorkOrderMaterial(data) { |
| | | return request({ |
| | | url: "/productWorkOrder/material/pick", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | } |
| | |
| | | const asyncRoutes = filterDynamicRoutes(dynamicRoutes)
|
| | | asyncRoutes.forEach(route => { router.addRoute(route) })
|
| | | this.setRoutes(rewriteRoutes)
|
| | | // å°è´¢å¡ç®¡çè·¯ç±åå¹¶å°ä¾§è¾¹æ
|
| | | this.setSidebarRouters(constantRoutes.concat(sidebarRoutes))
|
| | | this.setDefaultRoutes(sidebarRoutes)
|
| | | this.setTopbarRoutes(defaultRoutes)
|
| | |
| | | import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue"; |
| | | import { Search, Paperclip, Upload } from "@element-plus/icons-vue"; |
| | | import { |
| | | addCustomer, |
| | | delCustomer, |
| | | addCustomerPrivate, |
| | | delCustomerPrivate, |
| | | getCustomer, |
| | | listCustomer, |
| | | updateCustomer, |
| | | getCustomerPrivatePoolById, |
| | | getCustomerPrivatePoolInfo, |
| | | listCustomerPrivatePool, |
| | | updateCustomerPrivatePool, |
| | | addCustomerFollow, |
| | | updateCustomerFollow, |
| | | delCustomerFollow, |
| | |
| | | const negotiationFormRef = ref(); |
| | | const negotiationForm = reactive({ |
| | | customerName: "", |
| | | customerId: "", |
| | | customerPrivatePoolId: "", |
| | | followUpMethod: "", |
| | | followUpLevel: "", |
| | | followUpTime: "", |
| | |
| | | }, |
| | | { |
| | | label: "å°ååèç³»æ¹å¼", |
| | | prop: "addressPhone", |
| | | prop: "companyAddress", |
| | | width: 250, |
| | | }, |
| | | { |
| | |
| | | { |
| | | label: "ç»´æ¤äºº", |
| | | prop: "maintainer", |
| | | }, |
| | | { |
| | | label: "å®¢æ·æ¥æº", |
| | | prop: "type", |
| | | dataType: "tag", |
| | | width: 100, |
| | | formatData: value => { |
| | | if (value === 1 || value === "1") { |
| | | return "å
¬æµ·"; |
| | | } |
| | | return "ç§æµ·"; |
| | | }, |
| | | formatType: value => { |
| | | if (value === 1 || value === "1") { |
| | | return "warning"; |
| | | } |
| | | return "success"; |
| | | }, |
| | | }, |
| | | { |
| | | label: "ç»´æ¤æ¶é´", |
| | |
| | | // 设置ä¸ä¼ ç请æ±å¤´é¨ |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | // ä¸ä¼ çå°å |
| | | url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData", |
| | | url: import.meta.env.VITE_APP_BASE_API + "/customerPrivate/importData", |
| | | // æä»¶ä¸ä¼ åçåè° |
| | | beforeUpload: file => { |
| | | console.log("æä»¶å³å°ä¸ä¼ ", file); |
| | |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | listCustomer({ ...searchForm.value, ...page }).then(res => { |
| | | listCustomerPrivatePool({ ...searchForm.value, ...page }).then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.records; |
| | | page.total = res.total; |
| | | tableData.value = res.data.records; |
| | | page.total = res.data.total; |
| | | }); |
| | | }; |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | |
| | | } |
| | | /** ä¸è½½æ¨¡æ¿ */ |
| | | function importTemplate() { |
| | | proxy.download("/basic/customer/downloadTemplate", {}, "客æ·å¯¼å
¥æ¨¡æ¿.xlsx"); |
| | | proxy.download("/customerPrivate/downloadTemplate", {}, "客æ·å¯¼å
¥æ¨¡æ¿.xlsx"); |
| | | } |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = (type, row) => { |
| | |
| | | userList.value = res.data; |
| | | }); |
| | | if (type === "edit") { |
| | | getCustomer(row.id).then(res => { |
| | | getCustomerPrivatePoolById(row.id).then(res => { |
| | | form.value = { ...res.data }; |
| | | formYYs.value.contactList = res.data.contactPerson |
| | | .split(",") |
| | |
| | | form.value.contactPhone = formYYs.value.contactList |
| | | .map(item => item.contactPhone) |
| | | .join(","); |
| | | addCustomer(form.value).then(res => { |
| | | addCustomerPrivate(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | getList(); |
| | |
| | | form.value.contactPhone = formYYs.value.contactList |
| | | .map(item => item.contactPhone) |
| | | .join(","); |
| | | updateCustomer(form.value).then(res => { |
| | | updateCustomerPrivatePool(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | getList(); |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/basic/customer/export", {}, "å®¢æ·æ¡£æ¡.xlsx"); |
| | | proxy.download("/customerPrivate/export", {}, "å®¢æ·æ¡£æ¡.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | // æ£æ¥æ¯å¦æä»äººç»´æ¤çæ°æ® |
| | | const unauthorizedData = selectedRows.value.filter( |
| | | item => item.maintainer !== userStore.nickName |
| | | item => item.type === 1 || item.type === "1" |
| | | ); |
| | | if (unauthorizedData.length > 0) { |
| | | proxy.$modal.msgWarning("ä¸å¯å é¤ä»äººç»´æ¤çæ°æ®"); |
| | | proxy.$modal.msgWarning("å
¬æµ·åé
ç客æ·ä¸è½å é¤"); |
| | | return; |
| | | } |
| | | ids = selectedRows.value.map(item => item.id); |
| | |
| | | }) |
| | | .then(() => { |
| | | tableLoading.value = true; |
| | | delCustomer(ids) |
| | | .then(res => { |
| | | delCustomerPrivate(ids) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }) |
| | |
| | | if (reminderForm.id) { |
| | | submitvalue.value = { |
| | | id: reminderForm.id, |
| | | customerId: currentCustomerId.value, |
| | | customerPrivatePoolId: reminderForm.id, |
| | | customerPrivatePoolId: currentCustomerId.value, |
| | | isEnabled: reminderForm.reminderSwitch ? 1 : 0, |
| | | content: reminderForm.reminderContent, |
| | | reminderTime: reminderForm.reminderTime, |
| | |
| | | }; |
| | | } else { |
| | | submitvalue.value = { |
| | | customerId: currentCustomerId.value, |
| | | customerPrivatePoolId: currentCustomerId.value, |
| | | isEnabled: reminderForm.reminderSwitch ? 1 : 0, |
| | | content: reminderForm.reminderContent, |
| | | reminderTime: reminderForm.reminderTime, |
| | | remindUserId: userStore.id, |
| | | }; |
| | | } |
| | | |
| | | console.log("æäº¤å访æéæ°æ®:", submitvalue.value); |
| | | |
| | | // è°ç¨æ¥å£ |
| | | addReturnVisit(submitvalue.value) |
| | |
| | | // æå¼æ´½è°è¿åº¦å¼¹çª |
| | | const openNegotiationDialog = row => { |
| | | negotiationForm.customerName = row.customerName; |
| | | negotiationForm.customerId = row.id; |
| | | negotiationForm.customerPrivatePoolId = row.id; |
| | | negotiationForm.followUpMethod = ""; |
| | | negotiationForm.followUpLevel = ""; |
| | | negotiationForm.followUpTime = ""; |
| | | negotiationForm.followerUserName = userStore.nickName; // é»è®¤å½åç»å½äºº |
| | | negotiationForm.content = ""; |
| | | // { |
| | | // "customerId": 152, |
| | | // "followUpMethod": "çµè¯æ²é", |
| | | // "followUpLevel": "没ææå", |
| | | // "followUpTime": "2026-03-04T15:30:00", |
| | | // "followerUserName": "管çåè´¦å·", |
| | | // "content": "111" |
| | | // } |
| | | negotiationDialogVisible.value = true; |
| | | }; |
| | | |
| | |
| | | |
| | | if (isEdit) { |
| | | // ä¿®æ¹æä½ |
| | | console.log("ä¿®æ¹æ´½è°è¿åº¦æ°æ®:", negotiationForm); |
| | | // è¿éå¯ä»¥è°ç¨æ´æ°æ¥å£ |
| | | // å®é
项ç®ä¸éè¦æ ¹æ®å端æ¥å£è¿è¡è°æ´ |
| | | // 示ä¾ï¼updateCustomerFollow(negotiationForm).then(res => { |
| | | // // æ´æ°æ¬å°æ°æ® |
| | | // const index = negotiationForm.editIndex; |
| | | // negotiationRecords.value[index] = { |
| | | // followUpTime: negotiationForm.followUpTime, |
| | | // followUpMethod: negotiationForm.followUpMethod, |
| | | // followUpLevel: negotiationForm.followUpLevel, |
| | | // followerUserName: negotiationForm.followerUserName, |
| | | // content: negotiationForm.content, |
| | | // id: negotiationForm.id, |
| | | // }; |
| | | // proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | // closeNegotiationDialog(); |
| | | // }); |
| | | updateCustomerFollow(negotiationForm).then(res => { |
| | | // æ´æ°æ¬å°æ°æ® |
| | | getCustomer(negotiationForm.customerId).then(res => { |
| | | getCustomer(negotiationForm.customerPrivatePoolId).then(res => { |
| | | // æ´æ°æ¬å°æ°æ® |
| | | negotiationRecords.value = res.data.followUpList || []; |
| | | }); |
| | |
| | | |
| | | // æå¼è¯¦æ
å¼¹çª |
| | | const openDetailDialog = row => { |
| | | // è°ç¨getCustomeræ¥å£è·å客æ·è¯¦æ
|
| | | getCustomer(row.id).then(res => { |
| | | getCustomerPrivatePoolInfo(row.id).then(res => { |
| | | // å¡«å
客æ·åºæ¬ä¿¡æ¯ |
| | | Object.assign(detailForm, res.data); |
| | | |
| | |
| | | // å°å½åè®°å½æ°æ®å¡«å
å°è¡¨å |
| | | Object.assign(negotiationForm, { |
| | | customerName: row.customerName, |
| | | customerId: row.customerId, |
| | | customerPrivatePoolId: row.customerPrivatePoolId, |
| | | followUpMethod: row.followUpMethod, |
| | | followUpLevel: row.followUpLevel, |
| | | followUpTime: row.followUpTime, |
| | |
| | | // }); |
| | | delCustomerFollow(row.id).then(() => { |
| | | // å 餿ååæ´æ°æ¬å°æ°æ® |
| | | getCustomer(row.customerId).then(res => { |
| | | getCustomer(row.customerPrivatePoolId).then(res => { |
| | | // æ´æ°æ¬å°æ°æ® |
| | | negotiationRecords.value = res.data.followUpList || []; |
| | | }); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title">客æ·åç§°ï¼</span> |
| | | <el-input v-model="searchForm.customerName" |
| | | style="width: 240px;margin-right: 10px" |
| | | placeholder="请è¾å
¥" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" /> |
| | | <span class="search_title">客æ·åç±»ï¼</span> |
| | | <el-select v-model="searchForm.customerType" |
| | | placeholder="è¯·éæ©" |
| | | style="width: 240px" |
| | | clearable |
| | | @change="handleQuery"> |
| | | <el-option label="é¶å®å®¢æ·" |
| | | value="é¶å®å®¢æ·" /> |
| | | <el-option label="è¿éå客æ·" |
| | | value="è¿éå客æ·" /> |
| | | </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="info" |
| | | plain |
| | | icon="Upload" |
| | | @click="handleImport">导å
¥</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"></PIMTable> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" |
| | | :title="operationType === 'add' ? 'æ°å¢å®¢æ·ä¿¡æ¯' : 'ç¼è¾å®¢æ·ä¿¡æ¯'" |
| | | width="70%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" |
| | | label-width="140px" |
| | | label-position="top" |
| | | :rules="rules" |
| | | ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客æ·åç§°ï¼" |
| | | prop="customerName"> |
| | | <el-input v-model="form.customerName" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="纳ç¨äººè¯å«å·ï¼" |
| | | prop="taxpayerIdentificationNumber"> |
| | | <el-input v-model="form.taxpayerIdentificationNumber" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
¬å¸å°åï¼" |
| | | prop="companyAddress"> |
| | | <el-input v-model="form.companyAddress" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
¬å¸çµè¯ï¼" |
| | | prop="companyPhone"> |
| | | <el-input v-model="form.companyPhone" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="é¶è¡åºæ¬æ·ï¼" |
| | | prop="basicBankAccount"> |
| | | <el-input v-model="form.basicBankAccount" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="é¶è¡è´¦å·ï¼" |
| | | prop="bankAccount"> |
| | | <el-input v-model="form.bankAccount" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="弿·è¡å·ï¼" |
| | | prop="bankCode"> |
| | | <el-input v-model="form.bankCode" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客æ·åç±»ï¼" |
| | | prop="customerType"> |
| | | <el-select v-model="form.customerType" |
| | | placeholder="è¯·éæ©" |
| | | clearable> |
| | | <el-option label="é¶å®å®¢æ·" |
| | | value="é¶å®å®¢æ·" /> |
| | | <el-option label="è¿éå客æ·" |
| | | value="è¿éå客æ·" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30" |
| | | v-for="(contact, index) in formYYs.contactList" |
| | | :key="index"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è系人ï¼" |
| | | prop="contactPerson"> |
| | | <el-input v-model="contact.contactPerson" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="èç³»çµè¯ï¼" |
| | | prop="contactPhone"> |
| | | <div style="display: flex; align-items: center;width: 100%;"> |
| | | <el-input v-model="contact.contactPhone" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | <el-button @click="removeContact(index)" |
| | | type="danger" |
| | | circle |
| | | style="margin-left: 5px;"> |
| | | <el-icon> |
| | | <Close /> |
| | | </el-icon> |
| | | </el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-button @click="addNewContact" |
| | | style="margin-bottom: 10px;">+ æ°å¢è系人</el-button> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç»´æ¤äººï¼" |
| | | prop="maintainer"> |
| | | <el-select v-model="form.maintainer" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | disabled> |
| | | <el-option v-for="item in userList" |
| | | :key="item.nickName" |
| | | :label="item.nickName" |
| | | :value="item.nickName" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç»´æ¤æ¶é´ï¼" |
| | | prop="maintenanceTime"> |
| | | <el-date-picker style="width: 100%" |
| | | v-model="form.maintenanceTime" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" |
| | | @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="assignDialogVisible" |
| | | title="åé
客æ·" |
| | | width="500px" |
| | | @close="closeAssignDialog"> |
| | | <el-form :model="assignForm" |
| | | :rules="assignRules" |
| | | ref="assignFormRef" |
| | | label-width="100px"> |
| | | <el-form-item label="客æ·åç§°"> |
| | | <el-input v-model="assignForm.customerName" |
| | | disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="åé
人å" |
| | | prop="boundId"> |
| | | <el-select v-model="assignForm.boundId" |
| | | placeholder="è¯·éæ©åé
人å" |
| | | style="width: 100%" |
| | | filterable> |
| | | <el-option v-for="item in userList" |
| | | :key="item.userId || item.nickName" |
| | | :label="item.nickName" |
| | | :value="item.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" |
| | | @click="submitAssignForm">确认</el-button> |
| | | <el-button @click="closeAssignDialog">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="shareDialogVisible" |
| | | title="å
±äº«å®¢æ·" |
| | | width="500px" |
| | | @close="closeShareDialog"> |
| | | <el-form :model="shareForm" |
| | | :rules="shareRules" |
| | | ref="shareFormRef" |
| | | label-width="100px"> |
| | | <el-form-item label="客æ·åç§°"> |
| | | <el-input v-model="shareForm.customerName" |
| | | disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="å
±äº«äººå" |
| | | prop="boundIds"> |
| | | <el-select v-model="shareForm.boundIds" |
| | | placeholder="è¯·éæ©å
±äº«äººå" |
| | | style="width: 100%" |
| | | filterable |
| | | multiple |
| | | collapse-tags |
| | | collapse-tags-tooltip> |
| | | <el-option v-for="item in userList" |
| | | :key="item.userId || item.nickName" |
| | | :label="item.nickName" |
| | | :value="item.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" |
| | | @click="submitShareForm">确认</el-button> |
| | | <el-button @click="closeShareDialog">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- ç¨æ·å¯¼å
¥å¯¹è¯æ¡ --> |
| | | <el-dialog :title="upload.title" |
| | | v-model="upload.open" |
| | | width="400px" |
| | | append-to-body> |
| | | <el-upload ref="uploadRef" |
| | | :limit="1" |
| | | accept=".xlsx, .xls" |
| | | :headers="upload.headers" |
| | | :action="upload.url + '?updateSupport=' + upload.updateSupport" |
| | | :disabled="upload.isUploading" |
| | | :before-upload="upload.beforeUpload" |
| | | :on-progress="upload.onProgress" |
| | | :on-success="upload.onSuccess" |
| | | :on-error="upload.onError" |
| | | :on-change="upload.onChange" |
| | | :auto-upload="false" |
| | | drag> |
| | | <el-icon class="el-icon--upload"><upload-filled /></el-icon> |
| | | <div class="el-upload__text">å°æä»¶æå°æ¤å¤ï¼æ<em>ç¹å»ä¸ä¼ </em></div> |
| | | <template #tip> |
| | | <div class="el-upload__tip text-center"> |
| | | <span>ä»
å
许导å
¥xlsãxlsxæ ¼å¼æä»¶ã</span> |
| | | <el-link type="primary" |
| | | :underline="false" |
| | | style="font-size: 12px; vertical-align: baseline" |
| | | @click="importTemplate">ä¸è½½æ¨¡æ¿</el-link> |
| | | </div> |
| | | </template> |
| | | </el-upload> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" |
| | | @click="submitFileForm">ç¡® å®</el-button> |
| | | <el-button @click="upload.open = false">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- å访æéå¯¹è¯æ¡ --> |
| | | <el-dialog title="å访æé" |
| | | v-model="reminderDialogVisible" |
| | | width="500px" |
| | | @close="closeReminderDialog"> |
| | | <el-form :model="reminderForm" |
| | | label-width="100px" |
| | | :rules="reminderRules" |
| | | ref="reminderFormRef"> |
| | | <el-form-item label="客æ·åç§°ï¼"> |
| | | <el-input v-model="reminderForm.customerName" |
| | | disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="æéå¼å
³ï¼"> |
| | | <el-switch v-model="reminderForm.reminderSwitch" /> |
| | | </el-form-item> |
| | | <el-form-item label="æéå
容ï¼" |
| | | prop="reminderContent"> |
| | | <el-input v-model="reminderForm.reminderContent" |
| | | type="textarea" |
| | | :maxlength="100" |
| | | show-word-limit |
| | | placeholder="请è¾å
¥æéå
容" /> |
| | | </el-form-item> |
| | | <el-form-item label="æéæ¶é´ï¼" |
| | | prop="reminderTime"> |
| | | <el-date-picker v-model="reminderForm.reminderTime" |
| | | type="datetime" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | placeholder="è¯·éæ©æéæ¶é´" |
| | | style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitReminderForm">确认</el-button> |
| | | <el-button @click="closeReminderDialog">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- æ·»å /ä¿®æ¹æ´½è°è¿åº¦å¯¹è¯æ¡ --> |
| | | <el-dialog :title="negotiationForm.editIndex !== undefined ? 'ä¿®æ¹è¿åº¦' : 'æ·»å è¿åº¦'" |
| | | v-model="negotiationDialogVisible" |
| | | width="600px" |
| | | @close="closeNegotiationDialog"> |
| | | <el-form :model="negotiationForm" |
| | | label-width="100px" |
| | | :rules="negotiationRules" |
| | | ref="negotiationFormRef"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è·è¿æ¹å¼ï¼" |
| | | prop="followUpMethod"> |
| | | <el-select v-model="negotiationForm.followUpMethod" |
| | | placeholder="è¯·éæ©" |
| | | style="width: 100%"> |
| | | <el-option label="çµè¯" |
| | | value="çµè¯" /> |
| | | <el-option label="é®ä»¶" |
| | | value="é®ä»¶" /> |
| | | <el-option label="ä¸é¨" |
| | | value="ä¸é¨" /> |
| | | <el-option label="微信" |
| | | value="微信" /> |
| | | <el-option label="å
¶ä»" |
| | | value="å
¶ä»" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è·è¿ç¨åº¦ï¼" |
| | | prop="followUpLevel"> |
| | | <el-select v-model="negotiationForm.followUpLevel" |
| | | placeholder="è¯·éæ©" |
| | | style="width: 100%"> |
| | | <el-option label="æ½å¨å®¢æ·" |
| | | value="æ½å¨å®¢æ·" /> |
| | | <el-option label="忬¡æè®¿" |
| | | value="忬¡æè®¿" /> |
| | | <el-option label="夿¬¡æè®¿" |
| | | value="夿¬¡æè®¿" /> |
| | | <el-option label="æå客æ·" |
| | | value="æå客æ·" /> |
| | | <el-option label="å·²ç¾çº¦å®¢æ·" |
| | | value="å·²ç¾çº¦å®¢æ·" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è·è¿æ¶é´ï¼" |
| | | prop="followUpTime"> |
| | | <el-date-picker v-model="negotiationForm.followUpTime" |
| | | type="datetime" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | placeholder="è¯·éæ©" |
| | | style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è·è¿äººï¼"> |
| | | <el-input v-model="negotiationForm.followerUserName" |
| | | disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form-item label="å
容ï¼" |
| | | prop="content"> |
| | | <el-input v-model="negotiationForm.content" |
| | | type="textarea" |
| | | :rows="4" |
| | | placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitNegotiationForm">确认</el-button> |
| | | <el-button @click="closeNegotiationDialog">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 客æ·è¯¦æ
å¯¹è¯æ¡ --> |
| | | <el-dialog title="客æ·è¯¦æ
" |
| | | v-model="detailDialogVisible" |
| | | width="1000px" |
| | | @close="closeDetailDialog"> |
| | | <!-- 客æ·åºæ¬ä¿¡æ¯ --> |
| | | <div class="detail-section"> |
| | | <h3 class="section-title">客æ·åºæ¬ä¿¡æ¯</h3> |
| | | <div class="info-display"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">客æ·åç§°ï¼</span> |
| | | <span class="info-value">{{ detailForm.customerName }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">客æ·åç±»ï¼</span> |
| | | <span class="info-value">{{ detailForm.customerType }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">纳ç¨äººè¯å«å·ï¼</span> |
| | | <span class="info-value">{{ detailForm.taxpayerIdentificationNumber }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">å
¬å¸çµè¯ï¼</span> |
| | | <span class="info-value">{{ detailForm.companyPhone }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">å
¬å¸å°åï¼</span> |
| | | <span class="info-value">{{ detailForm.companyAddress }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">é¶è¡åºæ¬æ·ï¼</span> |
| | | <span class="info-value">{{ detailForm.basicBankAccount }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">é¶è¡è´¦å·ï¼</span> |
| | | <span class="info-value">{{ detailForm.bankAccount }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">弿·è¡å·ï¼</span> |
| | | <span class="info-value">{{ detailForm.bankCode }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">è系人ï¼</span> |
| | | <span class="info-value">{{ detailForm.contactPerson }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">èç³»çµè¯ï¼</span> |
| | | <span class="info-value">{{ detailForm.contactPhone }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">ç»´æ¤äººï¼</span> |
| | | <span class="info-value">{{ detailForm.maintainer }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">ç»´æ¤æ¶é´ï¼</span> |
| | | <span class="info-value">{{ detailForm.maintenanceTime }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | <!-- æ´½è°è¿åº¦è®°å½ --> |
| | | <div class="detail-section"> |
| | | <div class="section-header"> |
| | | <h3 class="section-title">æ´½è°è¿åº¦è®°å½</h3> |
| | | <el-button type="primary" |
| | | size="small" |
| | | @click="openNegotiationDialog(detailForm)"> |
| | | æ·»å è¿åº¦ |
| | | </el-button> |
| | | </div> |
| | | <el-table :data="negotiationRecords" |
| | | border |
| | | style="width: 100%"> |
| | | <el-table-column prop="followUpTime" |
| | | label="è·è¿æ¶é´" |
| | | width="160" /> |
| | | <el-table-column prop="followUpMethod" |
| | | label="è·è¿æ¹å¼" |
| | | width="100" /> |
| | | <el-table-column prop="followUpLevel" |
| | | label="è·è¿ç¨åº¦" /> |
| | | <el-table-column prop="followerUserName" |
| | | label="è·è¿äºº" |
| | | width="100" /> |
| | | <el-table-column prop="content" |
| | | label="å
容" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="éä»¶" |
| | | width="100" |
| | | align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button type="info" |
| | | link |
| | | @click="openAttachmentDialog(row)"> |
| | | <el-icon> |
| | | <Paperclip /> |
| | | </el-icon> |
| | | éä»¶ |
| | | <!-- {{ row.fileList && row.fileList.length > 0 ? row.fileList.length : 'ä¸ä¼ ' }} --> |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" |
| | | width="150" |
| | | align="center"> |
| | | <template #default="{ row, $index }"> |
| | | <el-button type="primary" |
| | | link |
| | | @click="editNegotiationRecord(row, $index)"> |
| | | ä¿®æ¹ |
| | | </el-button> |
| | | <el-button type="danger" |
| | | link |
| | | @click="deleteNegotiationRecord(row, $index)"> |
| | | å é¤ |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div v-if="negotiationRecords.length === 0" |
| | | class="no-records"> |
| | | ææ æ´½è°è¿åº¦è®°å½ |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="closeDetailDialog">å
³é</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- éä»¶ä¸ä¼ å¼¹çª --> |
| | | <el-dialog title="é件管ç" |
| | | v-model="attachmentDialogVisible" |
| | | width="600px" |
| | | @close="closeAttachmentDialog"> |
| | | <div class="attachment-section"> |
| | | <div class="upload-area"> |
| | | <el-upload ref="attachmentUploadRef" |
| | | :action="getAttachmentUploadUrl()" |
| | | :headers="attachmentUploadHeaders" |
| | | :file-list="currentAttachmentList" |
| | | :on-success="handleAttachmentSuccess" |
| | | :on-error="handleAttachmentError" |
| | | :on-remove="handleAttachmentRemove" |
| | | :before-upload="beforeAttachmentUpload" |
| | | multiple |
| | | :limit="10" |
| | | name="files"> |
| | | <el-button type="primary"> |
| | | <el-icon> |
| | | <Upload /> |
| | | </el-icon> |
| | | ä¸ä¼ éä»¶ |
| | | </el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | æ¯æä¸ä¼ å¾çãææ¡£çæä»¶ï¼å个æä»¶ä¸è¶
è¿50MB |
| | | </div> |
| | | </template> |
| | | </el-upload> |
| | | </div> |
| | | <div v-if="currentAttachmentList.length > 0" |
| | | class="attachment-list"> |
| | | <h4>å·²ä¸ä¼ éä»¶ï¼</h4> |
| | | <el-table :data="currentAttachmentList" |
| | | border |
| | | size="small"> |
| | | <el-table-column prop="name" |
| | | label="æä»¶å" |
| | | show-overflow-tooltip /> |
| | | <el-table-column prop="size" |
| | | label="大å°" |
| | | width="100"> |
| | | <template #default="{ row }"> |
| | | {{ formatFileSize(row.size) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" |
| | | width="120" |
| | | align="center"> |
| | | <template #default="{ row, $index }"> |
| | | <el-button type="primary" |
| | | link |
| | | @click="downloadAttachment(row)"> |
| | | ä¸è½½ |
| | | </el-button> |
| | | <el-button type="danger" |
| | | link |
| | | @click="deleteAttachment(row, $index)"> |
| | | å é¤ |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div v-else |
| | | class="no-attachment"> |
| | | ææ éä»¶ |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="closeAttachmentDialog">å
³é</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, ref, reactive, getCurrentInstance, toRefs } from "vue"; |
| | | import { Search, Paperclip, Upload } from "@element-plus/icons-vue"; |
| | | import { |
| | | addCustomer, |
| | | addCustomerPrivatePool, |
| | | delCustomerPrivatePool, |
| | | delCustomer, |
| | | getCustomer, |
| | | shareCustomer, |
| | | listCustomer, |
| | | updateCustomer, |
| | | addCustomerFollow, |
| | | updateCustomerFollow, |
| | | delCustomerFollow, |
| | | addReturnVisit, |
| | | getReturnVisit, |
| | | } from "@/api/basicData/customerFile.js"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { getToken } from "@/utils/auth.js"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore(); |
| | | const assignDialogVisible = ref(false); |
| | | const assignFormRef = ref(); |
| | | const assignForm = reactive({ |
| | | id: undefined, |
| | | customerName: "", |
| | | boundId: undefined, |
| | | }); |
| | | const assignRules = { |
| | | boundId: [{ required: true, message: "è¯·éæ©åé
人å", trigger: "change" }], |
| | | }; |
| | | const shareDialogVisible = ref(false); |
| | | const shareFormRef = ref(); |
| | | const shareForm = reactive({ |
| | | id: undefined, |
| | | customerName: "", |
| | | boundIds: [], |
| | | }); |
| | | const shareRules = { |
| | | boundIds: [{ required: true, message: "è¯·éæ©å
±äº«äººå", trigger: "change" }], |
| | | }; |
| | | |
| | | // å访æéç¸å
³ |
| | | const reminderDialogVisible = ref(false); |
| | | const reminderFormRef = ref(); |
| | | const currentCustomerId = ref(); |
| | | const reminderForm = reactive({ |
| | | customerName: "", |
| | | reminderSwitch: false, |
| | | reminderContent: "", |
| | | reminderTime: "", |
| | | }); |
| | | const reminderRules = { |
| | | reminderContent: [ |
| | | { required: true, message: "请è¾å
¥æéå
容", trigger: "blur" }, |
| | | ], |
| | | reminderTime: [ |
| | | { required: true, message: "è¯·éæ©æéæ¶é´", trigger: "change" }, |
| | | ], |
| | | }; |
| | | |
| | | // æ´½è°è¿åº¦ç¸å
³ |
| | | const negotiationDialogVisible = ref(false); |
| | | const negotiationFormRef = ref(); |
| | | const negotiationForm = reactive({ |
| | | customerName: "", |
| | | customerId: "", |
| | | followUpMethod: "", |
| | | followUpLevel: "", |
| | | followUpTime: "", |
| | | followerUserName: "", |
| | | content: "", |
| | | }); |
| | | const negotiationRules = { |
| | | followUpMethod: [ |
| | | { required: true, message: "è¯·éæ©è·è¿æ¹å¼", trigger: "change" }, |
| | | ], |
| | | followUpLevel: [ |
| | | { required: true, message: "è¯·éæ©è·è¿ç¨åº¦", trigger: "change" }, |
| | | ], |
| | | followUpTime: [ |
| | | { required: true, message: "è¯·éæ©è·è¿æ¶é´", trigger: "change" }, |
| | | ], |
| | | content: [{ required: true, message: "请è¾å
¥å
容", trigger: "blur" }], |
| | | }; |
| | | |
| | | // 详æ
ç¸å
³ |
| | | const detailDialogVisible = ref(false); |
| | | const detailForm = reactive({ |
| | | customerName: "", |
| | | customerType: "", |
| | | taxpayerIdentificationNumber: "", |
| | | companyPhone: "", |
| | | companyAddress: "", |
| | | basicBankAccount: "", |
| | | bankAccount: "", |
| | | bankCode: "", |
| | | contactPerson: "", |
| | | contactPhone: "", |
| | | maintainer: "", |
| | | maintenanceTime: "", |
| | | }); |
| | | const negotiationRecords = ref([]); |
| | | |
| | | // éä»¶ç¸å
³ |
| | | const attachmentDialogVisible = ref(false); |
| | | const attachmentUploadRef = ref(); |
| | | const currentAttachmentList = ref([]); |
| | | const currentFollowRecord = ref({}); |
| | | const attachmentUploadHeaders = { Authorization: "Bearer " + getToken() }; |
| | | |
| | | // 卿æå»ºä¸ä¼ URL |
| | | const getAttachmentUploadUrl = () => { |
| | | const baseUrl = |
| | | import.meta.env.VITE_APP_BASE_API + "/basic/customer-follow/upload"; |
| | | return currentFollowRecord.value.id |
| | | ? `${baseUrl}/${currentFollowRecord.value.id}` |
| | | : baseUrl; |
| | | }; |
| | | |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "客æ·åç±»", |
| | | prop: "customerType", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "客æ·åç§°", |
| | | prop: "customerName", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "纳ç¨äººè¯å«ç ", |
| | | prop: "taxpayerIdentificationNumber", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "å°ååèç³»æ¹å¼", |
| | | prop: "addressPhone", |
| | | width: 250, |
| | | }, |
| | | { |
| | | label: "è系人", |
| | | prop: "contactPerson", |
| | | }, |
| | | { |
| | | label: "èç³»çµè¯", |
| | | prop: "contactPhone", |
| | | width: 150, |
| | | }, |
| | | // { |
| | | // label: "è·è¿è¿åº¦", |
| | | // prop: "followUpLevel", |
| | | // width: 120, |
| | | // }, |
| | | // { |
| | | // label: "è·è¿æ¶é´", |
| | | // prop: "followUpTime", |
| | | // width: 120, |
| | | // }, |
| | | { |
| | | label: "é¶è¡åºæ¬æ·", |
| | | prop: "basicBankAccount", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "é¶è¡è´¦å·", |
| | | prop: "bankAccount", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "弿·è¡å·", |
| | | prop: "bankCode", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "ç»´æ¤äºº", |
| | | prop: "maintainer", |
| | | }, |
| | | { |
| | | label: "ç»´æ¤æ¶é´", |
| | | prop: "maintenanceTime", |
| | | width: 100, |
| | | }, |
| | | { |
| | | label: "é¢ç¨äºº", |
| | | prop: "usageUserName", |
| | | width: 120, |
| | | fixed: "right", |
| | | }, |
| | | { |
| | | label: "é¢ç¨ç¶æ", |
| | | prop: "usageStatus", |
| | | dataType: "tag", |
| | | width: 100, |
| | | fixed: "right", |
| | | formatData: value => { |
| | | if (value === 1 || value === "1") { |
| | | return "å·²é¢ç¨"; |
| | | } |
| | | return "æªé¢ç¨"; |
| | | }, |
| | | formatType: value => { |
| | | if (value === 1 || value === "1") { |
| | | return "success"; |
| | | } |
| | | return "info"; |
| | | }, |
| | | }, |
| | | { |
| | | label: "å
±äº«äºº", |
| | | prop: "togetherUserNames", |
| | | width: 120, |
| | | fixed: "right", |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 200, |
| | | operation: [ |
| | | { |
| | | name: "åé
", |
| | | type: "text", |
| | | showHide: row => row.usageStatus != 1, |
| | | clickFun: row => { |
| | | openAssignDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "åæ¶", |
| | | type: "text", |
| | | showHide: row => row.usageStatus == 1, |
| | | clickFun: row => { |
| | | recycleCustomer(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "å
񄧮", |
| | | type: "text", |
| | | showHide: row => row.usageStatus == 1, |
| | | clickFun: row => { |
| | | openShareDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: row => { |
| | | openForm("edit", row); |
| | | }, |
| | | }, |
| | | // { |
| | | // name: "详æ
", |
| | | // type: "text", |
| | | // clickFun: row => { |
| | | // openDetailDialog(row); |
| | | // }, |
| | | // }, |
| | | ], |
| | | }, |
| | | ]); |
| | | const tableData = ref([]); |
| | | const selectedRows = ref([]); |
| | | const userList = ref([]); |
| | | const tableLoading = ref(false); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | total: 0, |
| | | }); |
| | | const total = ref(0); |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const operationType = ref(""); |
| | | const dialogFormVisible = ref(false); |
| | | const formYYs = ref({ |
| | | // å
¶ä»å段... |
| | | contactList: [ |
| | | { |
| | | contactPerson: "", |
| | | contactPhone: "", |
| | | }, |
| | | ], |
| | | }); |
| | | const data = reactive({ |
| | | searchForm: { |
| | | customerName: "", |
| | | customerType: "", |
| | | }, |
| | | form: { |
| | | customerName: "", |
| | | taxpayerIdentificationNumber: "", |
| | | companyAddress: "", |
| | | companyPhone: "", |
| | | contactPerson: "", |
| | | contactPhone: "", |
| | | maintainer: "", |
| | | maintenanceTime: "", |
| | | basicBankAccount: "", |
| | | bankAccount: "", |
| | | bankCode: "", |
| | | customerType: "", |
| | | }, |
| | | rules: { |
| | | customerName: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | taxpayerIdentificationNumber: [ |
| | | { required: true, message: "请è¾å
¥", trigger: "blur" }, |
| | | ], |
| | | companyAddress: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | companyPhone: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | // contactPerson: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | // contactPhone: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | maintainer: [{ required: false, message: "è¯·éæ©", trigger: "change" }], |
| | | maintenanceTime: [ |
| | | { required: false, message: "è¯·éæ©", trigger: "change" }, |
| | | ], |
| | | basicBankAccount: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | bankAccount: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | bankCode: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | customerType: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const upload = reactive({ |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±ï¼å®¢æ·å¯¼å
¥ï¼ |
| | | open: false, |
| | | // å¼¹åºå±æ é¢ï¼å®¢æ·å¯¼å
¥ï¼ |
| | | title: "", |
| | | // æ¯å¦ç¦ç¨ä¸ä¼ |
| | | isUploading: false, |
| | | // 设置ä¸ä¼ ç请æ±å¤´é¨ |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | // ä¸ä¼ çå°å |
| | | url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData", |
| | | // æä»¶ä¸ä¼ åçåè° |
| | | beforeUpload: file => { |
| | | console.log("æä»¶å³å°ä¸ä¼ ", file); |
| | | // å¯ä»¥å¨æ¤å¤åæä»¶ç±»åæå¤§å°æ ¡éª |
| | | const isValid = |
| | | file.type === |
| | | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || |
| | | file.name.endsWith(".xlsx") || |
| | | file.name.endsWith(".xls"); |
| | | if (!isValid) { |
| | | proxy.$modal.msgError("åªè½ä¸ä¼ Excel æä»¶"); |
| | | } |
| | | return isValid; |
| | | }, |
| | | // æä»¶ç¶ææ¹åæ¶çåè° |
| | | onChange: (file, fileList) => { |
| | | console.log("æä»¶ç¶ææ¹å", file, fileList); |
| | | }, |
| | | // æä»¶ä¸ä¼ æåæ¶çåè° |
| | | onSuccess: (response, file, fileList) => { |
| | | console.log("ä¸ä¼ æå", response, file, fileList); |
| | | upload.isUploading = false; |
| | | if (response.code === 200) { |
| | | proxy.$modal.msgSuccess("æä»¶ä¸ä¼ æå"); |
| | | upload.open = false; |
| | | proxy.$refs["uploadRef"].clearFiles(); |
| | | getList(); |
| | | } else if (response.code === 500) { |
| | | proxy.$modal.msgError(response.msg); |
| | | } else { |
| | | proxy.$modal.msgWarning(response.msg); |
| | | } |
| | | }, |
| | | // æä»¶ä¸ä¼ 失败æ¶çåè° |
| | | onError: (error, file, fileList) => { |
| | | console.error("ä¸ä¼ 失败", error, file, fileList); |
| | | upload.isUploading = false; |
| | | proxy.$modal.msgError("æä»¶ä¸ä¼ 失败"); |
| | | }, |
| | | // æä»¶ä¸ä¼ è¿åº¦åè° |
| | | onProgress: (event, file, fileList) => { |
| | | console.log("ä¸ä¼ ä¸...", event.percent); |
| | | }, |
| | | }); |
| | | const { searchForm, form, rules } = toRefs(data); |
| | | const addNewContact = () => { |
| | | formYYs.value.contactList.push({ |
| | | contactPerson: "", |
| | | contactPhone: "", |
| | | }); |
| | | }; |
| | | |
| | | const removeContact = index => { |
| | | if (formYYs.value.contactList.length > 1) { |
| | | formYYs.value.contactList.splice(index, 1); |
| | | } |
| | | }; |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | const pagination = obj => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const { total, ...queryPage } = page; |
| | | listCustomer({ ...searchForm.value, ...queryPage }).then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | page.total = res.data.total; |
| | | }); |
| | | }; |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = selection => { |
| | | selectedRows.value = selection; |
| | | }; |
| | | /** æäº¤ä¸ä¼ æä»¶ */ |
| | | function submitFileForm() { |
| | | upload.isUploading = true; |
| | | proxy.$refs["uploadRef"].submit(); |
| | | } |
| | | /** 导å
¥æé®æä½ */ |
| | | function handleImport() { |
| | | upload.title = "客æ·å¯¼å
¥"; |
| | | upload.open = true; |
| | | } |
| | | /** ä¸è½½æ¨¡æ¿ */ |
| | | function importTemplate() { |
| | | proxy.download("/basic/customer/downloadTemplate", {}, "客æ·å¯¼å
¥æ¨¡æ¿.xlsx"); |
| | | } |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = (type, row) => { |
| | | operationType.value = type; |
| | | form.value = {}; |
| | | form.value.maintainer = userStore.nickName; |
| | | formYYs.value.contactList = [ |
| | | { |
| | | contactPerson: "", |
| | | contactPhone: "", |
| | | }, |
| | | ]; |
| | | form.value.maintenanceTime = getCurrentDate(); |
| | | userListNoPage().then(res => { |
| | | userList.value = res.data; |
| | | }); |
| | | if (type === "edit") { |
| | | getCustomer(row.id).then(res => { |
| | | form.value = { ...res.data }; |
| | | formYYs.value.contactList = res.data.contactPerson |
| | | .split(",") |
| | | .map((item, index) => { |
| | | return { |
| | | contactPerson: item, |
| | | contactPhone: res.data.contactPhone.split(",")[index], |
| | | }; |
| | | }); |
| | | }); |
| | | } |
| | | dialogFormVisible.value = true; |
| | | }; |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | if (operationType.value === "edit") { |
| | | submitEdit(); |
| | | } else { |
| | | submitAdd(); |
| | | } |
| | | } |
| | | }); |
| | | }; |
| | | // æäº¤æ°å¢ |
| | | const submitAdd = () => { |
| | | if (formYYs.value.contactList.length < 1) { |
| | | return proxy.$modal.msgWarning("请è³å°æ·»å ä¸ä¸ªè系人"); |
| | | } |
| | | form.value.contactPerson = formYYs.value.contactList |
| | | .map(item => item.contactPerson) |
| | | .join(","); |
| | | form.value.contactPhone = formYYs.value.contactList |
| | | .map(item => item.contactPhone) |
| | | .join(","); |
| | | addCustomer(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | getList(); |
| | | }); |
| | | }; |
| | | // æäº¤ä¿®æ¹ |
| | | const submitEdit = () => { |
| | | form.value.contactPerson = formYYs.value.contactList |
| | | .map(item => item.contactPerson) |
| | | .join(","); |
| | | form.value.contactPhone = formYYs.value.contactList |
| | | .map(item => item.contactPhone) |
| | | .join(","); |
| | | updateCustomer(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | getList(); |
| | | }); |
| | | }; |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef"); |
| | | dialogFormVisible.value = false; |
| | | }; |
| | | const ensureUserList = () => { |
| | | if (userList.value.length) { |
| | | return Promise.resolve(); |
| | | } |
| | | return userListNoPage().then(res => { |
| | | userList.value = res.data || []; |
| | | }); |
| | | }; |
| | | const openAssignDialog = row => { |
| | | assignForm.id = row.id; |
| | | assignForm.customerName = row.customerName; |
| | | assignForm.boundId = undefined; |
| | | ensureUserList().then(() => { |
| | | assignDialogVisible.value = true; |
| | | }); |
| | | }; |
| | | const closeAssignDialog = () => { |
| | | proxy.resetForm("assignFormRef"); |
| | | assignForm.id = undefined; |
| | | assignForm.customerName = ""; |
| | | assignForm.boundId = undefined; |
| | | assignDialogVisible.value = false; |
| | | }; |
| | | const openShareDialog = row => { |
| | | shareForm.id = row.id; |
| | | shareForm.customerName = row.customerName; |
| | | shareForm.boundIds = []; |
| | | ensureUserList().then(() => { |
| | | shareDialogVisible.value = true; |
| | | }); |
| | | }; |
| | | const closeShareDialog = () => { |
| | | proxy.resetForm("shareFormRef"); |
| | | shareForm.id = undefined; |
| | | shareForm.customerName = ""; |
| | | shareForm.boundIds = []; |
| | | shareDialogVisible.value = false; |
| | | }; |
| | | const submitAssignForm = () => { |
| | | proxy.$refs.assignFormRef.validate(valid => { |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | addCustomerPrivatePool({ |
| | | customerId: assignForm.id, |
| | | boundId: assignForm.boundId, |
| | | }).then(() => { |
| | | proxy.$modal.msgSuccess("åé
æå"); |
| | | closeAssignDialog(); |
| | | getList(); |
| | | }); |
| | | }); |
| | | }; |
| | | const submitShareForm = () => { |
| | | proxy.$refs.shareFormRef.validate(valid => { |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | shareCustomer({ |
| | | customerId: shareForm.id, |
| | | boundIds: shareForm.boundIds, |
| | | }).then(() => { |
| | | proxy.$modal.msgSuccess("å
±äº«æå"); |
| | | closeShareDialog(); |
| | | getList(); |
| | | }); |
| | | }); |
| | | }; |
| | | const recycleCustomer = row => { |
| | | ElMessageBox.confirm("ç¡®è®¤åæ¶å®¢æ·â" + row.customerName + "âåï¼", "åæ¶æç¤º", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return delCustomerPrivatePool(row.id); |
| | | }) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("åæ¶æå"); |
| | | getList(); |
| | | }) |
| | | .catch(error => { |
| | | if (error === "cancel" || error === "close") { |
| | | proxy.$modal.msg("已忶"); |
| | | } |
| | | }); |
| | | }; |
| | | // å¯¼åº |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å¯¼åºï¼æ¯å¦ç¡®è®¤å¯¼åºï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/basic/customer/export", {}, "å®¢æ·æ¡£æ¡.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | // æ£æ¥æ¯å¦æä»äººç»´æ¤çæ°æ® |
| | | const unauthorizedData = selectedRows.value.filter( |
| | | item => item.maintainer !== userStore.nickName |
| | | ); |
| | | if (unauthorizedData.length > 0) { |
| | | proxy.$modal.msgWarning("ä¸å¯å é¤ä»äººç»´æ¤çæ°æ®"); |
| | | return; |
| | | } |
| | | ids = selectedRows.value.map(item => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "å é¤æç¤º", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | tableLoading.value = true; |
| | | delCustomer(ids) |
| | | .then(res => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }) |
| | | .finally(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | |
| | | // æå¼å访æéå¼¹çª |
| | | const openReminderDialog = row => { |
| | | currentCustomerId.value = row.id; |
| | | reminderForm.customerName = row.customerName; |
| | | reminderForm.reminderSwitch = false; |
| | | reminderForm.reminderContent = ""; |
| | | reminderForm.reminderTime = ""; |
| | | |
| | | // å°è¯è·åå·²æçå访æé |
| | | getReturnVisit(row.id) |
| | | .then(res => { |
| | | if (res.code === 200 && res.data) { |
| | | reminderForm.reminderSwitch = res.data.isEnabled === 1; |
| | | reminderForm.reminderContent = res.data.content; |
| | | reminderForm.reminderTime = res.data.reminderTime; |
| | | reminderForm.id = res.data.id; |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.error("è·åå访æé失败:", error); |
| | | }); |
| | | |
| | | reminderDialogVisible.value = true; |
| | | }; |
| | | |
| | | // å
³éå访æéå¼¹çª |
| | | const closeReminderDialog = () => { |
| | | proxy.resetForm("reminderFormRef"); |
| | | reminderDialogVisible.value = false; |
| | | }; |
| | | const submitvalue = ref({}); |
| | | |
| | | // æäº¤å访æé |
| | | const submitReminderForm = () => { |
| | | console.log("æäº¤å访æéæ°æ®:", userStore.id, userStore); |
| | | proxy.$refs.reminderFormRef.validate(valid => { |
| | | if (valid) { |
| | | if (reminderForm.id) { |
| | | submitvalue.value = { |
| | | id: reminderForm.id, |
| | | customerId: currentCustomerId.value, |
| | | isEnabled: reminderForm.reminderSwitch ? 1 : 0, |
| | | content: reminderForm.reminderContent, |
| | | reminderTime: reminderForm.reminderTime, |
| | | remindUserId: userStore.id, |
| | | }; |
| | | } else { |
| | | submitvalue.value = { |
| | | customerId: currentCustomerId.value, |
| | | isEnabled: reminderForm.reminderSwitch ? 1 : 0, |
| | | content: reminderForm.reminderContent, |
| | | reminderTime: reminderForm.reminderTime, |
| | | remindUserId: userStore.id, |
| | | }; |
| | | } |
| | | |
| | | console.log("æäº¤å访æéæ°æ®:", submitvalue.value); |
| | | |
| | | // è°ç¨æ¥å£ |
| | | addReturnVisit(submitvalue.value) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("å访æé设置æå"); |
| | | closeReminderDialog(); |
| | | } else { |
| | | proxy.$modal.msgError(res.msg || "设置失败"); |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.error("设置å访æé失败:", error); |
| | | proxy.$modal.msgError("设置失败"); |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // æå¼æ´½è°è¿åº¦å¼¹çª |
| | | const openNegotiationDialog = row => { |
| | | negotiationForm.customerName = row.customerName; |
| | | negotiationForm.customerId = row.id; |
| | | negotiationForm.followUpMethod = ""; |
| | | negotiationForm.followUpLevel = ""; |
| | | negotiationForm.followUpTime = ""; |
| | | negotiationForm.followerUserName = userStore.nickName; // é»è®¤å½åç»å½äºº |
| | | negotiationForm.content = ""; |
| | | // { |
| | | // "customerId": 152, |
| | | // "followUpMethod": "çµè¯æ²é", |
| | | // "followUpLevel": "没ææå", |
| | | // "followUpTime": "2026-03-04T15:30:00", |
| | | // "followerUserName": "管çåè´¦å·", |
| | | // "content": "111" |
| | | // } |
| | | negotiationDialogVisible.value = true; |
| | | }; |
| | | |
| | | // å
³éæ´½è°è¿åº¦å¼¹çª |
| | | const closeNegotiationDialog = () => { |
| | | proxy.resetForm("negotiationFormRef"); |
| | | // æ¸
é¤ç¼è¾ç¶æ |
| | | delete negotiationForm.editIndex; |
| | | delete negotiationForm.id; |
| | | negotiationDialogVisible.value = false; |
| | | }; |
| | | |
| | | // æäº¤æ´½è°è¿åº¦ |
| | | const submitNegotiationForm = () => { |
| | | proxy.$refs.negotiationFormRef.validate(valid => { |
| | | if (valid) { |
| | | // å¤ææ¯æ°å¢è¿æ¯ä¿®æ¹ |
| | | const isEdit = negotiationForm.editIndex !== undefined; |
| | | |
| | | if (isEdit) { |
| | | // ä¿®æ¹æä½ |
| | | console.log("ä¿®æ¹æ´½è°è¿åº¦æ°æ®:", negotiationForm); |
| | | // è¿éå¯ä»¥è°ç¨æ´æ°æ¥å£ |
| | | // å®é
项ç®ä¸éè¦æ ¹æ®å端æ¥å£è¿è¡è°æ´ |
| | | // 示ä¾ï¼updateCustomerFollow(negotiationForm).then(res => { |
| | | // // æ´æ°æ¬å°æ°æ® |
| | | // const index = negotiationForm.editIndex; |
| | | // negotiationRecords.value[index] = { |
| | | // followUpTime: negotiationForm.followUpTime, |
| | | // followUpMethod: negotiationForm.followUpMethod, |
| | | // followUpLevel: negotiationForm.followUpLevel, |
| | | // followerUserName: negotiationForm.followerUserName, |
| | | // content: negotiationForm.content, |
| | | // id: negotiationForm.id, |
| | | // }; |
| | | // proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | // closeNegotiationDialog(); |
| | | // }); |
| | | updateCustomerFollow(negotiationForm).then(res => { |
| | | // æ´æ°æ¬å°æ°æ® |
| | | getCustomer(negotiationForm.customerId).then(res => { |
| | | // æ´æ°æ¬å°æ°æ® |
| | | negotiationRecords.value = res.data.followUpList || []; |
| | | }); |
| | | }); |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | closeNegotiationDialog(); |
| | | } else { |
| | | // æ°å¢æä½ |
| | | console.log("æäº¤æ´½è°è¿åº¦æ°æ®:", negotiationForm); |
| | | addCustomerFollow(negotiationForm).then(res => { |
| | | // æ·»å æååæ´æ°è¯¦æ
页é¢çè¿åº¦è®°å½ |
| | | const newRecord = { |
| | | followUpTime: negotiationForm.followUpTime, |
| | | followUpMethod: negotiationForm.followUpMethod, |
| | | followUpLevel: negotiationForm.followUpLevel, |
| | | followerUserName: negotiationForm.followerUserName, |
| | | content: negotiationForm.content, |
| | | }; |
| | | negotiationRecords.value.unshift(newRecord); |
| | | |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeNegotiationDialog(); |
| | | getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // æå¼è¯¦æ
å¼¹çª |
| | | const openDetailDialog = row => { |
| | | // è°ç¨getCustomeræ¥å£è·å客æ·è¯¦æ
|
| | | getCustomer(row.id).then(res => { |
| | | // å¡«å
客æ·åºæ¬ä¿¡æ¯ |
| | | Object.assign(detailForm, res.data); |
| | | |
| | | // è·åæ´½è°è¿åº¦è®°å½ |
| | | negotiationRecords.value = res.data.followUpList || []; |
| | | |
| | | detailDialogVisible.value = true; |
| | | }); |
| | | }; |
| | | |
| | | // å
³é详æ
å¼¹çª |
| | | const closeDetailDialog = () => { |
| | | detailDialogVisible.value = false; |
| | | }; |
| | | |
| | | // ä¿®æ¹æ´½è°è®°å½ |
| | | const editNegotiationRecord = (row, index) => { |
| | | // å°å½åè®°å½æ°æ®å¡«å
å°è¡¨å |
| | | Object.assign(negotiationForm, { |
| | | customerName: row.customerName, |
| | | customerId: row.customerId, |
| | | followUpMethod: row.followUpMethod, |
| | | followUpLevel: row.followUpLevel, |
| | | followUpTime: row.followUpTime, |
| | | followerUserName: row.followerUserName, |
| | | content: row.content, |
| | | id: row.id, // è®°å½IDç¨äºæ´æ° |
| | | editIndex: index, // è®°å½ç´¢å¼ç¨äºæ¬å°æ´æ° |
| | | }); |
| | | negotiationDialogVisible.value = true; |
| | | }; |
| | | |
| | | // å 餿´½è°è®°å½ |
| | | const deleteNegotiationRecord = (row, index) => { |
| | | ElMessageBox.confirm("ç¡®å®è¦å é¤è¿æ¡æ´½è°è®°å½åï¼", "å é¤æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | // è¿éå¯ä»¥è°ç¨å 餿¥å£ |
| | | // å®é
项ç®ä¸éè¦æ ¹æ®å端æ¥å£è¿è¡è°æ´ |
| | | // 示ä¾ï¼deleteCustomerFollow(row.id).then(() => { |
| | | // negotiationRecords.value.splice(index, 1); |
| | | // proxy.$modal.msgSuccess("å 餿å"); |
| | | // }); |
| | | delCustomerFollow(row.id).then(() => { |
| | | // å 餿ååæ´æ°æ¬å°æ°æ® |
| | | getCustomer(row.customerId).then(res => { |
| | | // æ´æ°æ¬å°æ°æ® |
| | | negotiationRecords.value = res.data.followUpList || []; |
| | | }); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | }); |
| | | // æ¬å°å é¤ï¼æ¨¡æï¼ |
| | | negotiationRecords.value.splice(index, 1); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶å é¤"); |
| | | }); |
| | | }; |
| | | |
| | | // æå¼éä»¶å¼¹çª |
| | | const openAttachmentDialog = row => { |
| | | currentFollowRecord.value = row; |
| | | // 转æ¢ä¸ºç¬¦åElement Plus fileListæ ¼å¼çæ°ç» |
| | | currentAttachmentList.value = (row.fileList || []).map((file, index) => ({ |
| | | name: file.fileName, |
| | | url: file.fileUrl, |
| | | size: file.fileSize, |
| | | id: file.id, |
| | | uid: file.id || index, |
| | | status: "success", |
| | | })); |
| | | |
| | | attachmentDialogVisible.value = true; |
| | | }; |
| | | |
| | | // å
³ééä»¶å¼¹çª |
| | | const closeAttachmentDialog = () => { |
| | | attachmentDialogVisible.value = false; |
| | | currentFollowRecord.value = {}; |
| | | currentAttachmentList.value = []; |
| | | }; |
| | | |
| | | // éä»¶ä¸ä¼ æå |
| | | const handleAttachmentSuccess = (response, file, fileList) => { |
| | | if (response.code === 200) { |
| | | proxy.$modal.msgSuccess("ä¸ä¼ æå"); |
| | | // æ´æ°å½åè®°å½çéä»¶å表 |
| | | currentAttachmentList.value = fileList.map(item => ({ |
| | | name: item.name, |
| | | size: item.size, |
| | | url: item.response?.data?.url || item.url, |
| | | id: item.response?.data?.id, |
| | | uid: item.uid, |
| | | status: "success", |
| | | })); |
| | | // æ´æ°åè®°å½ä¸çfilesåæ®µ |
| | | if (currentFollowRecord.value) { |
| | | currentFollowRecord.value.files = [...currentAttachmentList.value]; |
| | | } |
| | | } else { |
| | | proxy.$modal.msgError(response.msg || "ä¸ä¼ 失败"); |
| | | } |
| | | }; |
| | | |
| | | // éä»¶ä¸ä¼ 失败 |
| | | const handleAttachmentError = (error, file, fileList) => { |
| | | console.error("ä¸ä¼ 失败:", error); |
| | | proxy.$modal.msgError("ä¸ä¼ 失败"); |
| | | }; |
| | | |
| | | // éä»¶ç§»é¤ |
| | | const handleAttachmentRemove = (file, fileList) => { |
| | | currentAttachmentList.value = fileList; |
| | | // æ´æ°åè®°å½ä¸çfilesåæ®µ |
| | | if (currentFollowRecord.value) { |
| | | currentFollowRecord.value.files = [...fileList]; |
| | | } |
| | | }; |
| | | |
| | | // éä»¶ä¸ä¼ åæ ¡éª |
| | | const beforeAttachmentUpload = file => { |
| | | const maxSize = 50 * 1024 * 1024; // 50MB |
| | | if (file.size > maxSize) { |
| | | proxy.$modal.msgError("æä»¶å¤§å°ä¸è½è¶
è¿50MB"); |
| | | return false; |
| | | } |
| | | return true; |
| | | }; |
| | | |
| | | // æ ¼å¼åæä»¶å¤§å° |
| | | const formatFileSize = size => { |
| | | if (size < 1024) { |
| | | return size + " B"; |
| | | } else if (size < 1024 * 1024) { |
| | | return (size / 1024).toFixed(2) + " KB"; |
| | | } else { |
| | | return (size / (1024 * 1024)).toFixed(2) + " MB"; |
| | | } |
| | | }; |
| | | |
| | | // ä¸è½½éä»¶ |
| | | const downloadAttachment = row => { |
| | | if (row.url) { |
| | | // proxy.download(row.url, {}, row.name); |
| | | proxy.$download.name(row.url); |
| | | } else { |
| | | proxy.$modal.msgError("ä¸è½½é¾æ¥ä¸åå¨"); |
| | | } |
| | | }; |
| | | |
| | | // å é¤éä»¶ |
| | | const deleteAttachment = (row, index) => { |
| | | ElMessageBox.confirm("ç¡®å®è¦å é¤è¿ä¸ªéä»¶åï¼", "å é¤æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | // è°ç¨å端æ¥å£å é¤éä»¶ |
| | | const deleteUrl = |
| | | import.meta.env.VITE_APP_BASE_API + |
| | | "/basic/customer-follow/file/" + |
| | | row.id; |
| | | fetch(deleteUrl, { |
| | | method: "DELETE", |
| | | headers: { |
| | | Authorization: "Bearer " + getToken(), |
| | | "Content-Type": "application/json", |
| | | }, |
| | | }) |
| | | .then(response => response.json()) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | // å 餿ååæ´æ°æ¬å°æä»¶å表 |
| | | currentAttachmentList.value.splice(index, 1); |
| | | // æ´æ°åè®°å½ä¸çfilesåæ®µ |
| | | if (currentFollowRecord.value) { |
| | | currentFollowRecord.value.files = [ |
| | | ...currentAttachmentList.value, |
| | | ]; |
| | | } |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | } else { |
| | | proxy.$modal.msgError(res.msg || "å é¤å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.error("å é¤é件失败:", error); |
| | | proxy.$modal.msgError("å é¤å¤±è´¥"); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶å é¤"); |
| | | }); |
| | | }; |
| | | |
| | | // è·åå½åæ¥æå¹¶æ ¼å¼å为 YYYY-MM-DD |
| | | function getCurrentDate() { |
| | | const today = new Date(); |
| | | const year = today.getFullYear(); |
| | | const month = String(today.getMonth() + 1).padStart(2, "0"); // æä»½ä»0å¼å§ |
| | | const day = String(today.getDate()).padStart(2, "0"); |
| | | return `${year}-${month}-${day}`; |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .detail-section { |
| | | margin-bottom: 20px; |
| | | padding: 15px; |
| | | background-color: #f9f9f9; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .section-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .section-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | margin: 0 0 15px 0; |
| | | color: #333; |
| | | } |
| | | |
| | | .info-display { |
| | | background-color: #fff; |
| | | padding: 15px; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .info-item { |
| | | margin-bottom: 12px; |
| | | display: flex; |
| | | align-items: flex-start; |
| | | } |
| | | |
| | | .info-label { |
| | | width: 120px; |
| | | font-weight: 500; |
| | | color: #606266; |
| | | margin-right: 10px; |
| | | } |
| | | |
| | | .info-value { |
| | | flex: 1; |
| | | color: #303133; |
| | | word-break: break-word; |
| | | } |
| | | |
| | | .no-records { |
| | | text-align: center; |
| | | padding: 30px; |
| | | color: #999; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .attachment-section { |
| | | .upload-area { |
| | | margin-bottom: 20px; |
| | | padding: 20px; |
| | | background-color: #f9f9f9; |
| | | border-radius: 4px; |
| | | border: 1px dashed #d9d9d9; |
| | | |
| | | .el-upload__tip { |
| | | margin-top: 10px; |
| | | color: #909399; |
| | | } |
| | | } |
| | | |
| | | .attachment-list { |
| | | h4 { |
| | | margin: 0 0 10px 0; |
| | | font-size: 14px; |
| | | color: #606266; |
| | | } |
| | | } |
| | | |
| | | .no-attachment { |
| | | text-align: center; |
| | | padding: 40px; |
| | | color: #909399; |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <el-dialog v-model="visible" title="éæ©äº§å" width="900px" destroy-on-close :close-on-click-modal="false"> |
| | | <el-form :inline="true" :model="query" class="mb-2"> |
| | | <el-form-item label="产å大类"> |
| | | <el-input v-model="query.productName" placeholder="è¾å
¥äº§å大类" clearable @keyup.enter="onSearch" /> |
| | | <el-form-item label="产ååç§°"> |
| | | <el-input v-model="query.productName" placeholder="è¾å
¥äº§ååç§°" clearable @keyup.enter="onSearch" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="åå·åç§°"> |
| | | <el-input v-model="query.model" placeholder="è¾å
¥åå·åç§°" clearable @keyup.enter="onSearch" /> |
| | | <el-form-item label="产ååå·"> |
| | | <el-input v-model="query.model" placeholder="è¾å
¥äº§ååå·" clearable @keyup.enter="onSearch" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | |
| | | @selection-change="handleSelectionChange" @select="handleSelect"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column type="index" label="åºå·" width="60" /> |
| | | <el-table-column prop="productName" label="产å大类" min-width="160" /> |
| | | <el-table-column prop="model" label="åå·åç§°" min-width="200" /> |
| | | <el-table-column prop="productName" label="产ååç§°" min-width="160" /> |
| | | <el-table-column prop="model" label="产ååå·" min-width="200" /> |
| | | <el-table-column prop="unit" label="åä½" min-width="160" /> |
| | | </el-table> |
| | | |
| | |
| | | <script setup lang="ts"> |
| | | import { computed, onMounted, reactive, ref, watch, nextTick } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { productModelList } from '@/api/basicData/productModel' |
| | | import { productModelList, productModelListByUrl } from '@/api/basicData/productModel' |
| | | |
| | | export type ProductRow = { |
| | | id: number; |
| | |
| | | modelValue: boolean; |
| | | single?: boolean; // æ¯å¦åªè½éæ©ä¸ä¸ªï¼é»è®¤falseï¼å¯éæ©å¤ä¸ªï¼ |
| | | topProductParentId?: number; // ä¸çº§äº§åid |
| | | requestUrl?: string; // èªå®ä¹æ¥è¯¢æ¥å£ |
| | | }>(); |
| | | |
| | | const emit = defineEmits(['update:modelValue', 'confirm']); |
| | |
| | | loading.value = true; |
| | | try { |
| | | multipleSelection.value = []; // 翻页/æç´¢åæ¸
ç©ºéæ©æ´ç¬¦å颿 |
| | | const res: any = await productModelList({ |
| | | const params = { |
| | | productName: query.productName.trim(), |
| | | model: query.model.trim(), |
| | | current: page.pageNum, |
| | | size: page.pageSize, |
| | | topProductParentId: props.topProductParentId, |
| | | }); |
| | | tableData.value = res.records; |
| | | total.value = res.total; |
| | | }; |
| | | const res: any = props.requestUrl |
| | | ? await productModelListByUrl(props.requestUrl, params) |
| | | : await productModelList(params); |
| | | const records = res?.records || res?.data?.records || res?.data || []; |
| | | tableData.value = Array.isArray(records) ? records : []; |
| | | total.value = Number(res?.total ?? res?.data?.total ?? tableData.value.length); |
| | | } finally { |
| | | loading.value = false; |
| | | } |
| | |
| | | prefix-icon="Search" |
| | | /> |
| | | <el-button |
| | | v-if="false" |
| | | type="primary" |
| | | @click="openProDia('addOne')" |
| | | style="margin-left: 10px" |
| | |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | :disabled="isTopLevelNode(data, node)" |
| | | @click="openProDia('edit', data)" |
| | | > |
| | | ç¼è¾ |
| | |
| | | style="margin-left: 4px" |
| | | type="danger" |
| | | link |
| | | :disabled="isTopLevelNode(data, node)" |
| | | @click="remove(node, data)" |
| | | > |
| | | å é¤ |
| | |
| | | const searchFilter = () => { |
| | | proxy.$refs.tree.filter(search.value); |
| | | }; |
| | | const isTopLevelNode = (data, node) => { |
| | | if (node?.level !== undefined) { |
| | | return node.level === 1; |
| | | } |
| | | return [null, undefined, "", 0, "0"].includes(data?.parentId); |
| | | }; |
| | | // æå¼äº§åå¼¹æ¡ |
| | | const openProDia = (type, data) => { |
| | | if (data && type === "edit" && isTopLevelNode(data)) { |
| | | proxy.$modal.msgWarning("ä¸çº§èç¹ä¸è½ç¼è¾æå é¤"); |
| | | return; |
| | | } |
| | | operationType.value = type; |
| | | productDia.value = true; |
| | | form.value.productName = ""; |
| | |
| | | |
| | | // å é¤äº§å |
| | | const remove = (node, data) => { |
| | | if (isTopLevelNode(data, node)) { |
| | | proxy.$modal.msgWarning("ä¸çº§èç¹ä¸è½ç¼è¾æå é¤"); |
| | | return; |
| | | } |
| | | let ids = []; |
| | | ids.push(data.id); |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "å é¤æç¤º", { |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="é®é¢æè¿°ï¼" prop="disRes"> |
| | | <el-form-item label="é®é¢æè¿°ï¼" prop="proDesc"> |
| | | <el-input |
| | | v-model="form.disRes" |
| | | v-model="form.proDesc" |
| | | placeholder="请è¾å
¥é®é¢æè¿°" |
| | | /> |
| | | </el-form-item> |
| | |
| | | productModelIds: "", |
| | | customerId: null, |
| | | salesContractNo: "", |
| | | disRes: "", |
| | | proDesc: "", |
| | | customerName: "" |
| | | }, |
| | | rules: { |
| | |
| | | }, |
| | | { |
| | | label: "é®é¢æè¿°", |
| | | prop: "disRes", |
| | | prop: "proDesc", |
| | | width:300, |
| | | }, |
| | | { |
| | |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: 'right', |
| | | operation: [ |
| | | { |
| | |
| | | <el-tree-select v-model="productForm.productId" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | filterable |
| | | check-strictly |
| | | @change="getModels" |
| | | :data="productOptions" |
| | |
| | | prop="productModelId"> |
| | | <el-select v-model="productForm.productModelId" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | clearable |
| | | @change="getProductModel"> |
| | | <el-option v-for="item in modelOptions" |
| | |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map(item => item.id); |
| | | ids = selectedRows.value.filter(item => item.salesLedgerId === null).map(item => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "导åº", { |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "å é¤", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | |
| | | businessSummaryStats.value.returnAmount = businessSummaryData.value.reduce((sum, item) => { |
| | | return sum + (parseFloat(item.returnAmount) || 0) |
| | | }, 0) |
| | | businessSummaryStats.value.productTypes = businessSummaryData.value.length |
| | | } else { |
| | | businessSummaryStats.value = { |
| | | totalAmount: 0, |
| | |
| | | v-model="formState.supplierId" |
| | | placeholder="è¯·éæ©ä¾åºå" |
| | | style="width: 240px" |
| | | filterable |
| | | @focus="fetchSupplierOptions" |
| | | @change="handleChangeSupplierId" |
| | | > |
| | |
| | | await fetchProcessOptions(); |
| | | await fetchData(); |
| | | }); |
| | | </script> |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog v-model="dialogVisible" title="é¢æè¯¦æ
" width="1400px" @close="handleClose"> |
| | | <el-table v-loading="materialDetailLoading" :data="materialDetailTableData" border row-key="id"> |
| | | <el-table-column label="å·¥åºåç§°" prop="processName" min-width="180" /> |
| | | <el-table-column label="åæåç§°" prop="materialName" min-width="160" /> |
| | | <el-table-column label="åæåå·" prop="materialModel" min-width="180" /> |
| | | <el-table-column label="éæ±æ°é" prop="requiredQty" min-width="110" /> |
| | | <el-table-column label="计éåä½" prop="unit" width="100" /> |
| | | <el-table-column label="é¢ç¨æ°é" prop="pickQty" min-width="110" /> |
| | | <el-table-column label="è¡¥ææ°é" min-width="120"> |
| | | <template #default="{ row }"> |
| | | <el-button type="primary" link @click="handleViewSupplementRecord(row)"> |
| | | {{ row.supplementQty ?? 0 }} |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="éææ°é" prop="returnQty" min-width="110" /> |
| | | <el-table-column label="å®é
æ°é" prop="actualQty" min-width="110" /> |
| | | </el-table> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button |
| | | type="warning" |
| | | :loading="materialReturnConfirming" |
| | | :disabled="!canOpenReturnSummary" |
| | | @click="openReturnSummaryDialog" |
| | | > |
| | | éæç¡®è®¤ |
| | | </el-button> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="supplementRecordDialogVisible" title="è¡¥æè®°å½" width="800px"> |
| | | <el-table v-loading="supplementRecordLoading" :data="supplementRecordTableData" border row-key="id"> |
| | | <el-table-column label="è¡¥ææ°é" prop="supplementQty" min-width="120" /> |
| | | <el-table-column label="è¡¥æäºº" prop="supplementUserName" min-width="120" /> |
| | | <el-table-column label="è¡¥ææ¥æ" prop="supplementTime" min-width="160" /> |
| | | <el-table-column label="è¡¥æåå " prop="supplementReason" min-width="200" /> |
| | | </el-table> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="supplementRecordDialogVisible = false">å
³é</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="returnSummaryDialogVisible" title="éææ±æ»ç¡®è®¤" width="900px"> |
| | | <el-table :data="returnSummaryList" border row-key="summaryKey"> |
| | | <el-table-column label="åæåç§°" prop="materialName" min-width="180" /> |
| | | <el-table-column label="åæåå·" prop="materialModel" min-width="180" /> |
| | | <el-table-column label="计éåä½" prop="unit" min-width="100" /> |
| | | <el-table-column label="éææ±æ»æ°é" prop="returnQtyTotal" min-width="140" /> |
| | | </el-table> |
| | | |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" :loading="materialReturnConfirming" @click="handleReturnConfirm">确认æäº¤</el-button> |
| | | <el-button @click="returnSummaryDialogVisible = false">åæ¶</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, ref, watch } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { listMaterialPickingDetail, listMaterialSupplementRecord, confirmMaterialReturn } from "@/api/productionManagement/productionOrder.js"; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: { type: Boolean, default: false }, |
| | | orderRow: { type: Object, default: null }, |
| | | }); |
| | | const emit = defineEmits(["update:modelValue", "confirmed"]); |
| | | |
| | | const dialogVisible = computed({ |
| | | get: () => props.modelValue, |
| | | set: val => emit("update:modelValue", val), |
| | | }); |
| | | |
| | | const materialDetailLoading = ref(false); |
| | | const materialDetailTableData = ref([]); |
| | | const materialReturnConfirming = ref(false); |
| | | const supplementRecordDialogVisible = ref(false); |
| | | const supplementRecordLoading = ref(false); |
| | | const supplementRecordTableData = ref([]); |
| | | const returnSummaryDialogVisible = ref(false); |
| | | const returnSummaryList = ref([]); |
| | | const calcReturnQty = item => |
| | | Number(item.pickQty || 0) + Number(item.supplementQty || 0) - Number(item.actualQty || 0); |
| | | const canOpenReturnSummary = computed(() => |
| | | materialDetailTableData.value.some(item => calcReturnQty(item) > 0) |
| | | ); |
| | | |
| | | const loadDetailList = async () => { |
| | | if (!props.orderRow?.id) return; |
| | | materialDetailLoading.value = true; |
| | | materialDetailTableData.value = []; |
| | | try { |
| | | const res = await listMaterialPickingDetail({ orderId: props.orderRow.id }); |
| | | materialDetailTableData.value = res.data || []; |
| | | } finally { |
| | | materialDetailLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | watch( |
| | | () => dialogVisible.value, |
| | | visible => { |
| | | if (visible) { |
| | | loadDetailList(); |
| | | } |
| | | } |
| | | ); |
| | | |
| | | const handleClose = () => { |
| | | materialDetailTableData.value = []; |
| | | }; |
| | | |
| | | const handleViewSupplementRecord = async row => { |
| | | if (!row?.id) return; |
| | | supplementRecordDialogVisible.value = true; |
| | | supplementRecordLoading.value = true; |
| | | supplementRecordTableData.value = []; |
| | | try { |
| | | const res = await listMaterialSupplementRecord({ materialDetailId: row.id }); |
| | | supplementRecordTableData.value = res.data || []; |
| | | } finally { |
| | | supplementRecordLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | const buildReturnSummary = () => { |
| | | const map = new Map(); |
| | | materialDetailTableData.value.forEach(item => { |
| | | const returnQty = calcReturnQty(item); |
| | | if (returnQty <= 0) return; |
| | | const key = `${item.materialModelId || ""}_${item.materialName || ""}_${item.materialModel || ""}_${item.unit || ""}`; |
| | | const old = map.get(key) || { |
| | | summaryKey: key, |
| | | materialName: item.materialName || "", |
| | | materialModel: item.materialModel || "", |
| | | unit: item.unit || "", |
| | | returnQtyTotal: 0, |
| | | }; |
| | | old.returnQtyTotal += returnQty; |
| | | map.set(key, old); |
| | | }); |
| | | return Array.from(map.values()); |
| | | }; |
| | | |
| | | const openReturnSummaryDialog = async () => { |
| | | if (!canOpenReturnSummary.value) { |
| | | ElMessage.warning("éææ°é=é¢ç¨æ°é+è¡¥ææ°é-å®é
æ°éï¼ä¸é大äº0"); |
| | | return; |
| | | } |
| | | returnSummaryList.value = buildReturnSummary(); |
| | | returnSummaryDialogVisible.value = true; |
| | | }; |
| | | |
| | | const handleReturnConfirm = async () => { |
| | | if (!props.orderRow?.id) return; |
| | | materialReturnConfirming.value = true; |
| | | try { |
| | | await confirmMaterialReturn({ |
| | | orderId: props.orderRow.id, |
| | | returnSummaryList: returnSummaryList.value, |
| | | }); |
| | | returnSummaryDialogVisible.value = false; |
| | | dialogVisible.value = false; |
| | | emit("confirmed"); |
| | | } finally { |
| | | materialReturnConfirming.value = false; |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog v-model="dialogVisible" title="颿å°è´¦" width="1200px" @close="handleClose"> |
| | | <div class="material-toolbar"> |
| | | <el-button type="primary" @click="handleAddMaterialRow">æ°å¢</el-button> |
| | | </div> |
| | | <el-table v-loading="materialTableLoading" :data="materialTableData" border row-key="tempId"> |
| | | <el-table-column label="å·¥åºåç§°" min-width="180"> |
| | | <template #default="{ row }"> |
| | | <span v-if="row.bom === true">{{ row.processName || "-" }}</span> |
| | | <el-select |
| | | v-else |
| | | v-model="row.processName" |
| | | placeholder="è¯·éæ©å·¥åº" |
| | | clearable |
| | | filterable |
| | | style="width: 100%;" |
| | | @change="val => handleProcessNameChange(row, val)" |
| | | > |
| | | <el-option v-for="item in processOptions" :key="item.id" :label="item.name" :value="item.name" /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åæåç§°" min-width="160"> |
| | | <template #default="{ row }"> |
| | | <span v-if="row.bom === true">{{ row.materialName || "-" }}</span> |
| | | <el-button v-else type="primary" link @click="openMaterialProductSelect(row)"> |
| | | {{ row.materialName || "éæ©åæ" }} |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åæåå·" min-width="180"> |
| | | <template #default="{ row }"> |
| | | {{ row.materialModel || "-" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="éæ±æ°é" min-width="120"> |
| | | <template #default="{ row }"> |
| | | <span v-if="row.bom === true">{{ row.requiredQty ?? "-" }}</span> |
| | | <el-input-number |
| | | v-else |
| | | v-model="row.requiredQty" |
| | | :min="0" |
| | | :precision="3" |
| | | :step="1" |
| | | controls-position="right" |
| | | style="width: 100%;" |
| | | @change="val => handleRequiredQtyChange(row, val)" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="计éåä½" width="120"> |
| | | <template #default="{ row }"> |
| | | {{ row.unit || "-" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="é¢ç¨æ°é" min-width="120"> |
| | | <template #default="{ row }"> |
| | | <el-input-number |
| | | v-model="row.pickQty" |
| | | :min="0" |
| | | :precision="3" |
| | | :step="1" |
| | | controls-position="right" |
| | | style="width: 100%;" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="90" fixed="right"> |
| | | <template #default="{ $index, row }"> |
| | | <el-button v-if="row.bom !== true" type="danger" link @click="handleDeleteMaterialRow($index)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" :loading="materialSaving" @click="handleMaterialSave">ä¿å</el-button> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <ProductSelectDialog |
| | | v-model="materialProductDialogVisible" |
| | | @confirm="handleMaterialProductConfirm" |
| | | single |
| | | request-url="/stockInventory/rawMaterials" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, ref, watch } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue"; |
| | | import { findProductProcessRouteItemList } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import { |
| | | listMaterialPickingDetail, |
| | | listMaterialPickingLedger, |
| | | saveMaterialPickingLedger, |
| | | } from "@/api/productionManagement/productionOrder.js"; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: { type: Boolean, default: false }, |
| | | orderRow: { type: Object, default: null }, |
| | | }); |
| | | const emit = defineEmits(["update:modelValue", "saved"]); |
| | | |
| | | const dialogVisible = computed({ |
| | | get: () => props.modelValue, |
| | | set: val => emit("update:modelValue", val), |
| | | }); |
| | | |
| | | const materialProductDialogVisible = ref(false); |
| | | const materialTableLoading = ref(false); |
| | | const materialSaving = ref(false); |
| | | const materialTableData = ref([]); |
| | | const processOptions = ref([]); |
| | | const currentMaterialSelectRowIndex = ref(-1); |
| | | let materialTempId = 0; |
| | | |
| | | const createMaterialRow = (row = {}) => ({ |
| | | tempId: row.id || `temp_${++materialTempId}`, |
| | | id: row.id, |
| | | processId: row.processId, |
| | | productProcessId: row.productProcessId || row.processId, |
| | | processName: row.processName || "", |
| | | bom: row.bom === true, |
| | | materialModelId: row.materialModelId, |
| | | materialName: row.materialName || "", |
| | | materialModel: row.materialModel || "", |
| | | requiredQty: Number(row.requiredQty ?? 0), |
| | | unit: row.unit || "", |
| | | pickQty: Number(row.pickQty ?? row.requiredQty ?? 0), |
| | | }); |
| | | |
| | | const getProcessOptions = async () => { |
| | | if (!props.orderRow?.id) return; |
| | | const res = await findProductProcessRouteItemList({ orderId: props.orderRow.id }); |
| | | const routeList = Array.isArray(res?.data) ? res.data : res?.data?.records || []; |
| | | const processMap = new Map(); |
| | | routeList.forEach(item => { |
| | | const processId = item.processId; |
| | | const processName = item.processName; |
| | | if (!processId || !processName) return; |
| | | const key = `${processId}_${processName}`; |
| | | if (!processMap.has(key)) { |
| | | processMap.set(key, { |
| | | id: processId, |
| | | name: processName, |
| | | }); |
| | | } |
| | | }); |
| | | processOptions.value = Array.from(processMap.values()); |
| | | }; |
| | | |
| | | const loadMaterialData = async () => { |
| | | if (!props.orderRow?.id) return; |
| | | materialTableLoading.value = true; |
| | | materialTableData.value = []; |
| | | await getProcessOptions(); |
| | | try { |
| | | const detailRes = await listMaterialPickingDetail({ orderId: props.orderRow.id }); |
| | | const detailList = Array.isArray(detailRes?.data) |
| | | ? detailRes.data |
| | | : detailRes?.data?.records || []; |
| | | if (detailList.length > 0) { |
| | | materialTableData.value = detailList.map(item => createMaterialRow(item)); |
| | | return; |
| | | } |
| | | const ledgerRes = await listMaterialPickingLedger({ orderId: props.orderRow.id }); |
| | | const ledgerList = Array.isArray(ledgerRes?.data) |
| | | ? ledgerRes.data |
| | | : ledgerRes?.data?.records || []; |
| | | materialTableData.value = ledgerList.map(item => createMaterialRow(item)); |
| | | } finally { |
| | | materialTableLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | watch( |
| | | () => dialogVisible.value, |
| | | visible => { |
| | | if (visible) { |
| | | loadMaterialData(); |
| | | } |
| | | } |
| | | ); |
| | | |
| | | const handleClose = () => { |
| | | materialTableData.value = []; |
| | | currentMaterialSelectRowIndex.value = -1; |
| | | }; |
| | | |
| | | const handleAddMaterialRow = () => { |
| | | materialTableData.value.push(createMaterialRow()); |
| | | }; |
| | | |
| | | const handleDeleteMaterialRow = index => { |
| | | materialTableData.value.splice(index, 1); |
| | | }; |
| | | |
| | | const handleProcessNameChange = (row, processName) => { |
| | | const process = processOptions.value.find(item => item.name === processName); |
| | | row.productProcessId = process?.id; |
| | | }; |
| | | |
| | | const handleRequiredQtyChange = (row, val) => { |
| | | const required = Number(val ?? 0); |
| | | row.requiredQty = required; |
| | | if (!row.pickQty || Number(row.pickQty) === 0) { |
| | | row.pickQty = required; |
| | | } |
| | | }; |
| | | |
| | | const openMaterialProductSelect = row => { |
| | | currentMaterialSelectRowIndex.value = materialTableData.value.findIndex(item => item.tempId === row.tempId); |
| | | materialProductDialogVisible.value = true; |
| | | }; |
| | | |
| | | const handleMaterialProductConfirm = products => { |
| | | if (!products || products.length === 0) return; |
| | | const index = currentMaterialSelectRowIndex.value; |
| | | if (index < 0 || !materialTableData.value[index]) return; |
| | | const product = products[0]; |
| | | const row = materialTableData.value[index]; |
| | | row.materialModelId = product.materialModelId || product.modelId || product.id; |
| | | row.materialName = product.materialName || product.productName || product.name || ""; |
| | | row.materialModel = product.materialModel || product.model || ""; |
| | | row.unit = product.unit || product.measureUnit || ""; |
| | | currentMaterialSelectRowIndex.value = -1; |
| | | materialProductDialogVisible.value = false; |
| | | }; |
| | | |
| | | const validateMaterialRows = () => { |
| | | if (materialTableData.value.length === 0) { |
| | | return { valid: false, message: "请å
æ°å¢é¢ææ°æ®" }; |
| | | } |
| | | const invalidNewRow = materialTableData.value.find( |
| | | item => item.bom !== true && (!item.processName || !item.materialName) |
| | | ); |
| | | if (invalidNewRow) { |
| | | return { valid: false, message: "æ°å¢è¡çå·¥åºåç§°ååæå称为å¿
填项" }; |
| | | } |
| | | const invalidRow = materialTableData.value.find( |
| | | item => |
| | | !item.processName || |
| | | !item.materialName || |
| | | item.requiredQty === null || |
| | | item.requiredQty === undefined || |
| | | item.pickQty === null || |
| | | item.pickQty === undefined |
| | | ); |
| | | if (invalidRow) { |
| | | return { valid: false, message: "请å®åå·¥åºãåæåæ°éååä¿å" }; |
| | | } |
| | | return { valid: true, message: "" }; |
| | | }; |
| | | |
| | | const handleMaterialSave = async () => { |
| | | if (!props.orderRow?.id) return; |
| | | const validateResult = validateMaterialRows(); |
| | | if (!validateResult.valid) { |
| | | ElMessage.warning(validateResult.message); |
| | | return; |
| | | } |
| | | materialSaving.value = true; |
| | | try { |
| | | await saveMaterialPickingLedger({ |
| | | orderId: props.orderRow.id, |
| | | items: materialTableData.value.map(item => ({ |
| | | id: item.id, |
| | | processId: item.processName, |
| | | productProcessId: item.productProcessId, |
| | | processName: item.processName, |
| | | bom: item.bom === true, |
| | | materialModelId: item.materialModelId, |
| | | materialName: item.materialName, |
| | | materialModel: item.materialModel, |
| | | requiredQty: item.requiredQty, |
| | | unit: item.unit, |
| | | pickQty: item.pickQty, |
| | | })), |
| | | }); |
| | | emit("saved"); |
| | | dialogVisible.value = false; |
| | | } finally { |
| | | materialSaving.value = false; |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .material-toolbar { |
| | | margin-bottom: 12px; |
| | | text-align: right; |
| | | } |
| | | </style> |
| | |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" |
| | | :inline="true"> |
| | | <el-form-item label="ç产订åå·:"> |
| | | <el-input v-model="searchForm.npsNo" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 160px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="客æ·åç§°:"> |
| | | <el-input v-model="searchForm.customerName" |
| | | placeholder="请è¾å
¥" |
| | |
| | | @click="handleQuery">æç´¢</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div> |
| | | <div class="action-buttons"> |
| | | <el-button type="primary" @click="isShowNewModal = true">æ°å¢</el-button> |
| | | <el-button type="danger" @click="handleDelete">å é¤</el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <MaterialLedgerDialog |
| | | v-model="materialDialogVisible" |
| | | :order-row="currentMaterialOrder" |
| | | @saved="getList" |
| | | /> |
| | | <MaterialDetailDialog |
| | | v-model="materialDetailDialogVisible" |
| | | :order-row="currentMaterialDetailOrder" |
| | | @confirmed="getList" |
| | | /> |
| | | |
| | | <new-product-order v-if="isShowNewModal" |
| | | v-model:visible="isShowNewModal" |
| | | @completed="handleQuery" /> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, ref } from "vue"; |
| | | import { computed, defineAsyncComponent, getCurrentInstance, onMounted, reactive, ref, toRefs } from "vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import dayjs from "dayjs"; |
| | | import { useRouter } from "vue-router"; |
| | |
| | | listProcessBom, delProductOrder, |
| | | } from "@/api/productionManagement/productionOrder.js"; |
| | | import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import {fileDel} from "@/api/financialManagement/revenueManagement.js"; |
| | | import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue"; |
| | | import MaterialDetailDialog from "@/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | const NewProductOrder = defineAsyncComponent(() => import("@/views/productionManagement/productionOrder/New.vue")); |
| | | |
| | |
| | | { |
| | | label: "ç产订åå·", |
| | | prop: "npsNo", |
| | | width: '120px', |
| | | width: '150px', |
| | | }, |
| | | { |
| | | label: "éå®ååå·", |
| | |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 200, |
| | | width: 340, |
| | | operation: [ |
| | | { |
| | | name: "å·¥èºè·¯çº¿", |
| | |
| | | openBindRouteDialog(row); |
| | | }, |
| | | }, |
| | | // { |
| | | // name: "产åç»æ", |
| | | // type: "text", |
| | | // clickFun: row => { |
| | | // showProductStructure(row); |
| | | // }, |
| | | // }, |
| | | { |
| | | name: "产åç»æ", |
| | | name: "颿", |
| | | type: "text", |
| | | clickFun: row => { |
| | | showProductStructure(row); |
| | | openMaterialDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "é¢æè¯¦æ
", |
| | | type: "text", |
| | | clickFun: row => { |
| | | openMaterialDetailDialog(row); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | npsNo: "", |
| | | customerName: "", |
| | | salesContractNo: "", |
| | | projectName: "", |
| | |
| | | orderId: null, |
| | | routeId: null, |
| | | }); |
| | | const materialDialogVisible = ref(false); |
| | | const currentMaterialOrder = ref(null); |
| | | const materialDetailDialogVisible = ref(false); |
| | | const currentMaterialDetailOrder = ref(null); |
| | | |
| | | const openBindRouteDialog = async row => { |
| | | bindForm.orderId = row.id; |
| | |
| | | } finally { |
| | | bindRouteSaving.value = false; |
| | | } |
| | | }; |
| | | |
| | | const openMaterialDialog = row => { |
| | | currentMaterialOrder.value = row; |
| | | materialDialogVisible.value = true; |
| | | }; |
| | | |
| | | const openMaterialDetailDialog = async row => { |
| | | currentMaterialDetailOrder.value = row; |
| | | materialDetailDialogVisible.value = true; |
| | | }; |
| | | |
| | | // æ¥è¯¢å表 |
| | |
| | | path: "/productionManagement/processRouteItem", |
| | | query: { |
| | | id: data.id, |
| | | bomId: data.bomId, |
| | | processRouteCode: data.processRouteCode || "", |
| | | productName: data.productName || "", |
| | | model: data.model || "", |
| | |
| | | align-items: start; |
| | | } |
| | | |
| | | .action-buttons { |
| | | display: flex; |
| | | flex-wrap: nowrap; |
| | | gap: 8px; |
| | | } |
| | | |
| | | :deep(.yellow) { |
| | | background-color: #FAF0DE; |
| | | } |
| | |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | |
| | | </style> |
| | |
| | | <div class="search-row"> |
| | | <div class="search-item"> |
| | | <span class="search_title">å·¥åç¼å·ï¼</span> |
| | | <el-input v-model="searchForm.workOrderNo" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥" |
| | | @change="handleQuery" |
| | | clearable |
| | | prefix-icon="Search" /> |
| | | <el-input |
| | | v-model="searchForm.workOrderNo" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥" |
| | | @change="handleQuery" |
| | | clearable |
| | | prefix-icon="Search" |
| | | /> |
| | | </div> |
| | | <div class="search-item"> |
| | | <el-button type="primary" |
| | | @click="handleQuery">æç´¢</el-button> |
| | | <span class="search_title">ç产订åå·ï¼</span> |
| | | <el-input |
| | | v-model="searchForm.productOrderNpsNo" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥" |
| | | @change="handleQuery" |
| | | clearable |
| | | prefix-icon="Search" |
| | | /> |
| | | </div> |
| | | <div class="search-item"> |
| | | <el-button type="primary" @click="handleQuery">æç´¢</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <PIMTable rowKey="id" |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :page="page" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination"> |
| | | <PIMTable |
| | | rowKey="id" |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :page="page" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination" |
| | | > |
| | | <template #completionStatus="{ row }"> |
| | | <el-progress :percentage="toProgressPercentage(row?.completionStatus)" |
| | | :color="progressColor(toProgressPercentage(row?.completionStatus))" |
| | | :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" /> |
| | | <el-progress |
| | | :percentage="toProgressPercentage(row?.completionStatus)" |
| | | :color="progressColor(toProgressPercentage(row?.completionStatus))" |
| | | :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" |
| | | /> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | |
| | | <!-- ç¼è¾æ¶é´å¼¹çª --> |
| | | <el-dialog v-model="editDialogVisible" |
| | | title="ç¼è¾è®¡åæ¶é´" |
| | | width="500px"> |
| | | <el-form :model="editrow" |
| | | label-width="120px"> |
| | | |
| | | <el-dialog v-model="editDialogVisible" title="ç¼è¾è®¡åæ¶é´" width="500px"> |
| | | <el-form :model="editrow" label-width="120px"> |
| | | <el-form-item label="计åå¼å§æ¶é´"> |
| | | <el-date-picker v-model="editrow.planStartTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | value-format="YYYY-MM-DD" |
| | | style="width: 300px" /> |
| | | <el-date-picker |
| | | v-model="editrow.planStartTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | value-format="YYYY-MM-DD" |
| | | style="width: 300px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="计åç»ææ¶é´"> |
| | | <el-date-picker v-model="editrow.planEndTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | value-format="YYYY-MM-DD" |
| | | style="width: 300px" /> |
| | | <el-date-picker |
| | | v-model="editrow.planEndTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | value-format="YYYY-MM-DD" |
| | | style="width: 300px" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" |
| | | @click="handleUpdate">ç¡®å®</el-button> |
| | | <el-button type="primary" @click="handleUpdate">ç¡®å®</el-button> |
| | | <el-button @click="editDialogVisible = false">åæ¶</el-button> |
| | | </span> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, ref, nextTick } from "vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | productWorkOrderPage, |
| | | updateProductWorkOrder, |
| | | } from "@/api/productionManagement/workOrder.js"; |
| | | import { getCurrentInstance, reactive, toRefs } from "vue"; |
| | | const { proxy } = getCurrentInstance(); |
| | | import { getCurrentInstance, onMounted, reactive, ref, toRefs } from "vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { |
| | | productWorkOrderPage, |
| | | updateProductWorkOrder, |
| | | } from "@/api/productionManagement/workOrder.js"; |
| | | |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "å·¥åç±»å", |
| | | prop: "workOrderType", |
| | | width: "80", |
| | | }, |
| | | { |
| | | label: "å·¥åç¼å·", |
| | | prop: "workOrderNo", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "ç产订åå·", |
| | | prop: "productOrderNpsNo", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "产ååç§°", |
| | | prop: "productName", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "è§æ ¼", |
| | | prop: "model", |
| | | }, |
| | | { |
| | | label: "åä½", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "å·¥åºåç§°", |
| | | prop: "processName", |
| | | }, |
| | | { |
| | | label: "éæ±æ°é", |
| | | prop: "planQuantity", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "宿æ°é", |
| | | prop: "completeQuantity", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "宿è¿åº¦", |
| | | prop: "completionStatus", |
| | | dataType: "slot", |
| | | slot: "completionStatus", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "计åå¼å§æ¶é´", |
| | | prop: "planStartTime", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "计åç»ææ¶é´", |
| | | prop: "planEndTime", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "å®é
å¼å§æ¶é´", |
| | | prop: "actualStartTime", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "å®é
ç»ææ¶é´", |
| | | prop: "actualEndTime", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "æä½", |
| | | width: "100", |
| | | align: "center", |
| | | dataType: "action", |
| | | fixed: "right", |
| | | operation: [ |
| | | { |
| | | name: "è®¡åæ¶é´", |
| | | clickFun: row => { |
| | | handleEdit(row); |
| | | }, |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "å·¥åç±»å", |
| | | prop: "workOrderType", |
| | | width: "80", |
| | | }, |
| | | { |
| | | label: "å·¥åç¼å·", |
| | | prop: "workOrderNo", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "ç产订åå·", |
| | | prop: "productOrderNpsNo", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "产ååç§°", |
| | | prop: "productName", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "è§æ ¼", |
| | | prop: "model", |
| | | }, |
| | | { |
| | | label: "åä½", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "å·¥åºåç§°", |
| | | prop: "processName", |
| | | }, |
| | | { |
| | | label: "éæ±æ°é", |
| | | prop: "planQuantity", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "宿æ°é", |
| | | prop: "completeQuantity", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "宿è¿åº¦", |
| | | prop: "completionStatus", |
| | | dataType: "slot", |
| | | slot: "completionStatus", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "计åå¼å§æ¶é´", |
| | | prop: "planStartTime", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "计åç»ææ¶é´", |
| | | prop: "planEndTime", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "å®é
å¼å§æ¶é´", |
| | | prop: "actualStartTime", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "å®é
ç»ææ¶é´", |
| | | prop: "actualEndTime", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "æä½", |
| | | width: "100", |
| | | align: "center", |
| | | dataType: "action", |
| | | fixed: "right", |
| | | operation: [ |
| | | { |
| | | name: "è®¡åæ¶é´", |
| | | clickFun: row => { |
| | | handleEdit(row); |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | | |
| | | const tableData = ref([]); |
| | | const tableLoading = ref(false); |
| | | const editDialogVisible = ref(false); |
| | | let editrow = ref(null); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | total: 0, |
| | | }); |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | workOrderNo: "", |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | const toProgressPercentage = val => { |
| | | const n = Number(val); |
| | | if (!Number.isFinite(n)) return 0; |
| | | if (n <= 0) return 0; |
| | | if (n >= 100) return 100; |
| | | return Math.round(n); |
| | | }; |
| | | const progressColor = percentage => { |
| | | const p = toProgressPercentage(percentage); |
| | | if (p < 30) return "#f56c6c"; |
| | | if (p < 50) return "#e6a23c"; |
| | | if (p < 80) return "#409eff"; |
| | | return "#67c23a"; |
| | | }; |
| | | const tableData = ref([]); |
| | | const tableLoading = ref(false); |
| | | const editDialogVisible = ref(false); |
| | | const editrow = ref(null); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | total: 0, |
| | | }); |
| | | |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | const pagination = obj => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const params = { ...searchForm.value, ...page }; |
| | | productWorkOrderPage(params) |
| | | .then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | page.total = res.data.total; |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false; |
| | | const data = reactive({ |
| | | searchForm: { |
| | | workOrderNo: "", |
| | | productOrderNpsNo: "", |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | |
| | | const toProgressPercentage = val => { |
| | | const n = Number(val); |
| | | if (!Number.isFinite(n)) return 0; |
| | | if (n <= 0) return 0; |
| | | if (n >= 100) return 100; |
| | | return Math.round(n); |
| | | }; |
| | | |
| | | const progressColor = percentage => { |
| | | const p = toProgressPercentage(percentage); |
| | | if (p < 30) return "#f56c6c"; |
| | | if (p < 50) return "#e6a23c"; |
| | | if (p < 80) return "#409eff"; |
| | | return "#67c23a"; |
| | | }; |
| | | |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | const pagination = obj => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | | }; |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const params = { ...searchForm.value, ...page }; |
| | | productWorkOrderPage(params) |
| | | .then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | page.total = res.data.total; |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | const handleEdit = row => { |
| | | editrow.value = JSON.parse(JSON.stringify(row)); |
| | | editDialogVisible.value = true; |
| | | }; |
| | | |
| | | const handleUpdate = () => { |
| | | updateProductWorkOrder(editrow.value) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | editDialogVisible.value = false; |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | ElMessageBox.alert("ä¿®æ¹å¤±è´¥", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | }); |
| | | }; |
| | | }); |
| | | }; |
| | | |
| | | const handleEdit = row => { |
| | | editrow.value = JSON.parse(JSON.stringify(row)); |
| | | editDialogVisible.value = true; |
| | | }; |
| | | |
| | | const handleUpdate = () => { |
| | | updateProductWorkOrder(editrow.value) |
| | | .then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | editDialogVisible.value = false; |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | ElMessageBox.alert("ä¿®æ¹å¤±è´¥", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | }); |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .search-row { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 12px; |
| | | } |
| | | .search-item { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | .search_title { |
| | | margin-right: 8px; |
| | | font-size: 14px; |
| | | color: #606266; |
| | | } |
| | | </style> |
| | | .search-row { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 12px; |
| | | } |
| | | |
| | | .search-item { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_title { |
| | | margin-right: 8px; |
| | | font-size: 14px; |
| | | color: #606266; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | title="ç©æ" |
| | | width="1200px" |
| | | @close="handleCloseMaterialDialog" |
| | | > |
| | | <el-table v-loading="materialTableLoading" :data="materialTableData" border row-key="id"> |
| | | <el-table-column label="å·¥åºåç§°" prop="processName" min-width="140" /> |
| | | <el-table-column label="åæåç§°" prop="materialName" min-width="140" /> |
| | | <el-table-column label="åæåå·" prop="materialModel" min-width="140" /> |
| | | <el-table-column label="计éåä½" prop="unit" min-width="100" /> |
| | | <el-table-column label="çº¿è¾¹ä»æ°é" prop="pickQty" min-width="100" /> |
| | | <el-table-column label="è¡¥ææ°é" prop="supplementQty" min-width="100" /> |
| | | <el-table-column label="å®é
æ°é" min-width="140"> |
| | | <template #default="{ row }"> |
| | | <el-input-number |
| | | v-model="row.actualQty" |
| | | :min="0" |
| | | :precision="3" |
| | | :step="1" |
| | | controls-position="right" |
| | | style="width: 100%;" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" fixed="right" width="180"> |
| | | <template #default="{ row }"> |
| | | <el-button type="primary" link @click="openSupplementDialog(row)">è¡¥æ</el-button> |
| | | <el-button type="info" link @click="openSupplementRecordDialog(row)">è¡¥æè®°å½</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" :loading="pickSubmitting" @click="handleSubmitPick">é¢ç¨</el-button> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <FormDialog |
| | | v-model="supplementDialogVisible" |
| | | title="è¡¥æ" |
| | | width="500px" |
| | | @confirm="handleSubmitSupplement" |
| | | > |
| | | <el-form ref="supplementFormRef" :model="supplementForm" :rules="supplementRules" label-width="100px"> |
| | | <el-form-item label="è¡¥ææ°é" prop="supplementQty"> |
| | | <el-input-number |
| | | v-model="supplementForm.supplementQty" |
| | | :min="0.001" |
| | | :precision="3" |
| | | :step="1" |
| | | style="width: 100%;" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="è¡¥æåå " prop="supplementReason"> |
| | | <el-input |
| | | v-model="supplementForm.supplementReason" |
| | | type="textarea" |
| | | :rows="3" |
| | | maxlength="200" |
| | | show-word-limit |
| | | placeholder="请è¾å
¥è¡¥æåå " |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" :loading="supplementSubmitting" @click="handleSubmitSupplement">ç¡®å®</el-button> |
| | | <el-button @click="supplementDialogVisible = false">åæ¶</el-button> |
| | | </span> |
| | | </template> |
| | | </FormDialog> |
| | | |
| | | <el-dialog v-model="supplementRecordDialogVisible" title="è¡¥æè®°å½" width="900px"> |
| | | <el-table v-loading="supplementRecordLoading" :data="supplementRecordTableData" border row-key="id"> |
| | | <el-table-column label="è¡¥ææ°é" prop="supplementQty" min-width="100" /> |
| | | <el-table-column label="è¡¥æåå " prop="supplementReason" min-width="200" /> |
| | | <el-table-column label="è¡¥æäºº" prop="supplementUserName" min-width="120" /> |
| | | <el-table-column label="è¡¥ææ¥æ" prop="supplementTime" min-width="160" /> |
| | | </el-table> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="supplementRecordDialogVisible = false">å
³é</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, nextTick, reactive, ref, watch } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import FormDialog from "@/components/Dialog/FormDialog.vue"; |
| | | import { |
| | | listWorkOrderMaterialLedger, |
| | | addWorkOrderMaterialSupplement, |
| | | listWorkOrderMaterialSupplementRecord, |
| | | pickWorkOrderMaterial, |
| | | } from "@/api/productionManagement/workOrder.js"; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | rowData: { |
| | | type: Object, |
| | | default: () => null, |
| | | }, |
| | | }); |
| | | |
| | | const emit = defineEmits(["update:modelValue", "refresh"]); |
| | | |
| | | const dialogVisible = computed({ |
| | | get: () => props.modelValue, |
| | | set: val => emit("update:modelValue", val), |
| | | }); |
| | | |
| | | const materialTableLoading = ref(false); |
| | | const materialTableData = ref([]); |
| | | const currentMaterialRow = ref(null); |
| | | const currentMaterialOrderRow = ref(null); |
| | | const pickSubmitting = ref(false); |
| | | |
| | | const supplementDialogVisible = ref(false); |
| | | const supplementSubmitting = ref(false); |
| | | const supplementFormRef = ref(null); |
| | | const supplementForm = reactive({ |
| | | supplementQty: null, |
| | | supplementReason: "", |
| | | }); |
| | | |
| | | const supplementRecordDialogVisible = ref(false); |
| | | const supplementRecordLoading = ref(false); |
| | | const supplementRecordTableData = ref([]); |
| | | |
| | | const supplementRules = { |
| | | supplementQty: [{ required: true, message: "请è¾å
¥è¡¥ææ°é", trigger: "blur" }], |
| | | supplementReason: [{ required: true, message: "请è¾å
¥è¡¥æåå ", trigger: "blur" }], |
| | | }; |
| | | const loadMaterialTable = async row => { |
| | | if (!row?.id) return; |
| | | currentMaterialOrderRow.value = row; |
| | | materialTableLoading.value = true; |
| | | materialTableData.value = []; |
| | | try { |
| | | const res = await listWorkOrderMaterialLedger({ |
| | | workOrderId: row.id, |
| | | processId: row.processId, |
| | | productProcessRouteItemId: row.productProcessRouteItemId, |
| | | }); |
| | | materialTableData.value = res.data || []; |
| | | } catch (e) { |
| | | console.error("è·åç©æå°è´¦å¤±è´¥", e); |
| | | ElMessage.error("è·åç©æå°è´¦å¤±è´¥"); |
| | | } finally { |
| | | materialTableLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | watch( |
| | | () => props.modelValue, |
| | | visible => { |
| | | if (visible && props.rowData) { |
| | | loadMaterialTable(props.rowData); |
| | | } |
| | | } |
| | | ); |
| | | |
| | | const handleCloseMaterialDialog = () => { |
| | | materialTableData.value = []; |
| | | currentMaterialRow.value = null; |
| | | currentMaterialOrderRow.value = null; |
| | | }; |
| | | |
| | | const openSupplementDialog = row => { |
| | | currentMaterialRow.value = row; |
| | | supplementForm.supplementQty = null; |
| | | supplementForm.supplementReason = ""; |
| | | supplementDialogVisible.value = true; |
| | | nextTick(() => { |
| | | supplementFormRef.value?.clearValidate(); |
| | | }); |
| | | }; |
| | | |
| | | const handleSubmitSupplement = () => { |
| | | supplementFormRef.value?.validate(async valid => { |
| | | if (!valid || !currentMaterialRow.value?.id) { |
| | | ElMessage.warning("缺å°ç©ææç»ID"); |
| | | return; |
| | | } |
| | | supplementSubmitting.value = true; |
| | | try { |
| | | await addWorkOrderMaterialSupplement({ |
| | | materialLedgerId: currentMaterialRow.value.id, |
| | | supplementQty: Number(supplementForm.supplementQty), |
| | | supplementReason: supplementForm.supplementReason, |
| | | workOrderId: currentMaterialOrderRow.value?.id, |
| | | }); |
| | | supplementDialogVisible.value = false; |
| | | await loadMaterialTable(currentMaterialOrderRow.value); |
| | | ElMessage.success("è¡¥ææå"); |
| | | emit("refresh"); |
| | | } catch (e) { |
| | | console.error("è¡¥æå¤±è´¥", e); |
| | | ElMessage.error("è¡¥æå¤±è´¥"); |
| | | } finally { |
| | | supplementSubmitting.value = false; |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const openSupplementRecordDialog = async row => { |
| | | supplementRecordDialogVisible.value = true; |
| | | supplementRecordLoading.value = true; |
| | | supplementRecordTableData.value = []; |
| | | try { |
| | | const res = await listWorkOrderMaterialSupplementRecord({ |
| | | materialLedgerId: row.id, |
| | | }); |
| | | supplementRecordTableData.value = res.data || []; |
| | | } catch (e) { |
| | | console.error("è·åè¡¥æè®°å½å¤±è´¥", e); |
| | | ElMessage.error("è·åè¡¥æè®°å½å¤±è´¥"); |
| | | } finally { |
| | | supplementRecordLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | const validatePickRows = () => { |
| | | if (materialTableData.value.length === 0) { |
| | | return { valid: false, message: "ææ å¯é¢ç¨ç©æ" }; |
| | | } |
| | | const invalidRow = materialTableData.value.find(item => item.actualQty === null || item.actualQty === undefined || item.actualQty === ""); |
| | | if (invalidRow) { |
| | | return { valid: false, message: "请填åå®é
æ°éååé¢ç¨" }; |
| | | } |
| | | const exceedRow = materialTableData.value.find(item => { |
| | | const maxQty = Number(item.pickQty || 0) + Number(item.supplementQty || 0); |
| | | return Number(item.actualQty || 0) > maxQty; |
| | | }); |
| | | if (exceedRow) { |
| | | return { valid: false, message: "å®é
æ°éä¸è½å¤§äºé¢ç¨æ°é+è¡¥ææ°é" }; |
| | | } |
| | | return { valid: true, message: "" }; |
| | | }; |
| | | |
| | | const handleSubmitPick = async () => { |
| | | if (!currentMaterialOrderRow.value?.id) return; |
| | | const validateResult = validatePickRows(); |
| | | if (!validateResult.valid) { |
| | | ElMessage.warning(validateResult.message); |
| | | return; |
| | | } |
| | | pickSubmitting.value = true; |
| | | try { |
| | | await pickWorkOrderMaterial({ |
| | | workOrderId: currentMaterialOrderRow.value.id, |
| | | items: materialTableData.value.map(item => ({ |
| | | materialLedgerId: item.id, |
| | | actualQty: Number(item.actualQty || 0), |
| | | })), |
| | | }); |
| | | ElMessage.success("é¢ç¨æå"); |
| | | await loadMaterialTable(currentMaterialOrderRow.value); |
| | | emit("refresh"); |
| | | } catch (e) { |
| | | console.error("é¢ç¨å¤±è´¥", e); |
| | | ElMessage.error("é¢ç¨å¤±è´¥"); |
| | | } finally { |
| | | pickSubmitting.value = false; |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | prefix-icon="Search" /> |
| | | </div> |
| | | <div class="search-item"> |
| | | <span class="search_title">ç产订åå·ï¼</span> |
| | | <el-input v-model="searchForm.productOrderNpsNo" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥" |
| | | @change="handleQuery" |
| | | clearable |
| | | prefix-icon="Search" /> |
| | | </div> |
| | | <div class="search-item"> |
| | | <el-button type="primary" |
| | | @click="handleQuery">æç´¢</el-button> |
| | | </div> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <MaterialDialog |
| | | v-model="materialDialogVisible" |
| | | :row-data="currentMaterialOrderRow" |
| | | @refresh="getList" |
| | | /> |
| | | |
| | | <FilesDia ref="workOrderFilesRef" /> |
| | | </div> |
| | |
| | | import QRCode from "qrcode"; |
| | | import { getCurrentInstance, reactive, toRefs } from "vue"; |
| | | import FilesDia from "./components/filesDia.vue"; |
| | | import MaterialDialog from "./components/MaterialDialog.vue"; |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const tableColumn = ref([ |
| | |
| | | }, |
| | | { |
| | | label: "æä½", |
| | | width: "200", |
| | | width: "260", |
| | | align: "center", |
| | | dataType: "action", |
| | | fixed: "right", |
| | |
| | | name: "éä»¶", |
| | | clickFun: row => { |
| | | openWorkOrderFiles(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "ç©æ", |
| | | clickFun: row => { |
| | | openMaterialDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | |
| | | }; |
| | | |
| | | const currentReportRowData = ref(null); |
| | | const materialDialogVisible = ref(false); |
| | | const currentMaterialOrderRow = ref(null); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | workOrderNo: "", |
| | | productOrderNpsNo: "", |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | |
| | | }); |
| | | |
| | | reportDialogVisible.value = true; |
| | | }; |
| | | |
| | | const openMaterialDialog = row => { |
| | | currentMaterialOrderRow.value = row; |
| | | materialDialogVisible.value = true; |
| | | }; |
| | | |
| | | const handleReport = () => { |
| | |
| | | height: 140px !important; |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | clearable |
| | | :prefix-icon="Search" |
| | | /> |
| | | <span style="margin-left: 10px" class="search_title">æ£æµæ¥æï¼</span> |
| | | <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" |
| | | placeholder="è¯·éæ©" clearable @change="changeDaterange" /> |
| | | <span style="margin-left: 10px" class="search_title">æ£æµæ¥æï¼</span> |
| | | <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" |
| | | placeholder="è¯·éæ©" clearable @change="changeDaterange"/> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px" |
| | | >æç´¢</el-button |
| | | >æç´¢ |
| | | </el-button |
| | | > |
| | | </div> |
| | | <div> |
| | |
| | | <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia> |
| | | <FormDia ref="formDia" @close="handleQuery"></FormDia> |
| | | <files-dia ref="filesDia" @close="handleQuery"></files-dia> |
| | | <el-dialog v-model="dialogFormVisible" title="ç¼è¾æ£éªå" width="30%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisible" title="ç¼è¾æ£éªå" width="30%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue"; |
| | | import InspectionFormDia from "@/views/qualityManagement/finalInspection/components/inspectionFormDia.vue"; |
| | | import FormDia from "@/views/qualityManagement/finalInspection/components/formDia.vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import { |
| | | downloadQualityInspect, |
| | | qualityInspectDel, |
| | | qualityInspectListPage, qualityInspectUpdate, |
| | | submitQualityInspect |
| | | downloadQualityInspect, |
| | | qualityInspectDel, |
| | | qualityInspectListPage, qualityInspectUpdate, |
| | | submitQualityInspect |
| | | } from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import FilesDia from "@/views/qualityManagement/finalInspection/components/filesDia.vue"; |
| | | import dayjs from "dayjs"; |
| | |
| | | entryDateStart: undefined, |
| | | entryDateEnd: undefined, |
| | | }, |
| | | rules: { |
| | | checkName: [{required: true, message: "è¯·éæ©", trigger: "change"}], |
| | | }, |
| | | rules: { |
| | | checkName: [{required: true, message: "è¯·éæ©", trigger: "change"}], |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | const {searchForm} = toRefs(data); |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "æ£æµæ¥æ", |
| | | prop: "checkTime", |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "éå®åå·", |
| | | prop: "salesContractNo", |
| | | width: 120 |
| | | }, |
| | | { |
| | |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "æäº¤ç¶æ", |
| | | prop: "inspectState", |
| | | formatData: (params) => { |
| | | if (params) { |
| | | return "å·²æäº¤"; |
| | | } else { |
| | | return "æªæäº¤"; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "æäº¤ç¶æ", |
| | | prop: "inspectState", |
| | | formatData: (params) => { |
| | | if (params) { |
| | | return "å·²æäº¤"; |
| | | } else { |
| | | return "æªæäº¤"; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | |
| | | clickFun: (row) => { |
| | | openForm("edit", row); |
| | | }, |
| | | disabled: (row) => { |
| | | // å·²æäº¤åç¦ç¨ |
| | | if (row.inspectState == 1) return true; |
| | | // 妿æ£éªåæå¼ï¼åªæå½åç»å½ç¨æ·è½ç¼è¾ |
| | | if (row.checkName) { |
| | | return row.checkName !== userStore.nickName; |
| | | } |
| | | return false; |
| | | } |
| | | disabled: (row) => { |
| | | // å·²æäº¤åç¦ç¨ |
| | | if (row.inspectState == 1) return true; |
| | | // 妿æ£éªåæå¼ï¼åªæå½åç»å½ç¨æ·è½ç¼è¾ |
| | | if (row.checkName) { |
| | | return row.checkName !== userStore.nickName; |
| | | } |
| | | return false; |
| | | } |
| | | }, |
| | | { |
| | | name: "éä»¶", |
| | |
| | | openFilesFormDia(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "æäº¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | submit(row.id); |
| | | }, |
| | | disabled: (row) => { |
| | | // å·²æäº¤åç¦ç¨ |
| | | if (row.inspectState == 1) return true; |
| | | // 妿æ£éªåæå¼ï¼åªæå½åç»å½ç¨æ·è½æäº¤ |
| | | if (row.checkName) { |
| | | return row.checkName !== userStore.nickName; |
| | | } |
| | | return false; |
| | | } |
| | | }, |
| | | { |
| | | name: "åé
æ£éªå", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | if (!row.checkName) { |
| | | open(row) |
| | | } else { |
| | | proxy.$modal.msgError("æ£éªåå·²åå¨"); |
| | | } |
| | | }, |
| | | disabled: (row) => { |
| | | return row.inspectState == 1 || row.checkName; |
| | | } |
| | | }, |
| | | { |
| | | name: "ä¸è½½", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | downLoadFile(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "æäº¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | submit(row.id); |
| | | }, |
| | | disabled: (row) => { |
| | | // å·²æäº¤åç¦ç¨ |
| | | if (row.inspectState == 1) return true; |
| | | // 妿æ£éªåæå¼ï¼åªæå½åç»å½ç¨æ·è½æäº¤ |
| | | if (row.checkName) { |
| | | return row.checkName !== userStore.nickName; |
| | | } |
| | | return false; |
| | | } |
| | | }, |
| | | { |
| | | name: "åé
æ£éªå", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | if (!row.checkName) { |
| | | open(row) |
| | | } else { |
| | | proxy.$modal.msgError("æ£éªåå·²åå¨"); |
| | | } |
| | | }, |
| | | disabled: (row) => { |
| | | return row.inspectState == 1 || row.checkName; |
| | | } |
| | | }, |
| | | { |
| | | name: "ä¸è½½", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | downLoadFile(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | |
| | | const formDia = ref() |
| | | const filesDia = ref() |
| | | const inspectionFormDia = ref() |
| | | const { proxy } = getCurrentInstance() |
| | | const {proxy} = getCurrentInstance() |
| | | const userStore = useUserStore() |
| | | const userList = ref([]); |
| | | const form = ref({ |
| | | checkName: "" |
| | | checkName: "" |
| | | }); |
| | | const dialogFormVisible = ref(false); |
| | | |
| | |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const params = { ...searchForm.value, ...page }; |
| | | const params = {...searchForm.value, ...page}; |
| | | params.entryDate = undefined |
| | | qualityInspectListPage({...params, inspectType: 2}).then(res => { |
| | | tableLoading.value = false; |
| | |
| | | |
| | | // æä»· |
| | | const submit = async (id) => { |
| | | const res = await submitQualityInspect({id: id}) |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | getList(); |
| | | } |
| | | const res = await submitQualityInspect({id: id}) |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | getList(); |
| | | } |
| | | } |
| | | |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef"); |
| | | dialogFormVisible.value = false; |
| | | proxy.resetForm("formRef"); |
| | | dialogFormVisible.value = false; |
| | | }; |
| | | |
| | | const submitForm = () => { |
| | | if (currentRow.value) { |
| | | const data = { |
| | | ...form.value, |
| | | id: currentRow.value.id |
| | | } |
| | | qualityInspectUpdate(data).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | getList(); |
| | | }) |
| | | } |
| | | if (currentRow.value) { |
| | | const data = { |
| | | ...form.value, |
| | | id: currentRow.value.id |
| | | } |
| | | qualityInspectUpdate(data).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | getList(); |
| | | }) |
| | | } |
| | | }; |
| | | |
| | | const open = async (row) => { |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data; |
| | | currentRow.value = row |
| | | dialogFormVisible.value = true |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data; |
| | | currentRow.value = row |
| | | dialogFormVisible.value = true |
| | | } |
| | | |
| | | const downLoadFile = (row) => { |
| | | downloadQualityInspect({ id: row.id }).then((blobData) => { |
| | | const blob = new Blob([blobData], { |
| | | type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', |
| | | }) |
| | | const downloadUrl = window.URL.createObjectURL(blob) |
| | | |
| | | const link = document.createElement('a') |
| | | link.href = downloadUrl |
| | | link.download = 'åæææ£éªæ¥å.docx' |
| | | document.body.appendChild(link) |
| | | link.click() |
| | | |
| | | document.body.removeChild(link) |
| | | window.URL.revokeObjectURL(downloadUrl) |
| | | }) |
| | | downloadQualityInspect({id: row.id}).then((blobData) => { |
| | | const blob = new Blob([blobData], { |
| | | type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', |
| | | }) |
| | | const downloadUrl = window.URL.createObjectURL(blob) |
| | | |
| | | const link = document.createElement('a') |
| | | link.href = downloadUrl |
| | | link.download = 'åæææ£éªæ¥å.docx' |
| | | document.body.appendChild(link) |
| | | link.click() |
| | | |
| | | document.body.removeChild(link) |
| | | window.URL.revokeObjectURL(downloadUrl) |
| | | }) |
| | | }; |
| | | onMounted(() => { |
| | | getList(); |
| | |
| | | <script setup> |
| | | import { reactive, ref, toRefs, getCurrentInstance } from "vue"; |
| | | import { returnManagementAdd, returnManagementUpdate, returnManagementGetByShippingId, getSalesLedger, returnManagementGetById } from "@/api/salesManagement/returnOrder.js"; |
| | | import { getAllCustomerList } from "@/api/customerService/index.js"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import { userListNoPageByTenantId } from "@/api/system/user.js"; |
| | | import { listProject } from "@/api/oaSystem/projectManagement.js"; |
| | | import {listCustomerPrivatePool} from "@/api/basicData/customerFile.js"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const emit = defineEmits(['close']) |
| | |
| | | }; |
| | | |
| | | const initCustomers = async () => { |
| | | const res = await getAllCustomerList({}); |
| | | if (res?.records) { |
| | | customerNameOptions.value = res.records.map(item => ({ |
| | | label: item.customerName, |
| | | value: item.customerName, // Keep value as name if needed for other logic, but request says customerId |
| | | id: item.id, |
| | | code: item.customerCode |
| | | })); |
| | | } |
| | | listCustomerPrivatePool({current: -1,size:-1}).then((res) => { |
| | | customerNameOptions.value = res.data.records.map(item => ({ |
| | | label: item.customerName, |
| | | value: item.customerName, // Keep value as name if needed for other logic, but request says customerId |
| | | id: item.id, |
| | | code: item.customerCode |
| | | })); |
| | | }); |
| | | }; |
| | | |
| | | const initUsers = async () => { |
| | |
| | | <el-table-column align="center" type="selection" width="55" fixed="left"/> |
| | | <el-table-column type="expand" width="60" fixed="left"> |
| | | <template #default="props"> |
| | | <el-table :data="props.row.children" border show-summary :summary-method="summarizeChildrenTable"> |
| | | <el-table :data="props.row.children" border show-summary :summary-method="(param) => summarizeChildrenTable(param, props.row)"> |
| | | <el-table-column align="center" label="åºå·" type="index"/> |
| | | <el-table-column label="产å大类" prop="productCategory" /> |
| | | <el-table-column label="è§æ ¼åå·" prop="specificationModel" /> |
| | |
| | | </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 label="å«ç¨åä»·(å
)" prop="taxInclusiveUnitPrice" :formatter="sensitiveAmountFormatter" /> |
| | | <el-table-column label="å«ç¨æ»ä»·(å
)" prop="taxInclusiveTotalPrice" :formatter="sensitiveAmountFormatter" /> |
| | | <el-table-column label="ä¸å«ç¨æ»ä»·(å
)" prop="taxExclusiveTotalPrice" :formatter="sensitiveAmountFormatter" /> |
| | | <!--æä½--> |
| | | <el-table-column Width="60px" label="æä½" align="center"> |
| | | <template #default="scope"> |
| | |
| | | <el-table-column label="夿³¨" prop="remarks" width="200" show-overflow-tooltip /> |
| | | <el-table-column fixed="right" label="æä½" width="130" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openForm('edit', scope.row)" :disabled="!scope.row.isEdit">ç¼è¾</el-button> |
| | | <el-button link type="primary" @click="openForm('edit', scope.row)" :disabled="!scope.row.isEdit || scope.row.hasProductionRecord || !canEditLedger(scope.row)">ç¼è¾</el-button> |
| | | <el-button link type="primary" @click="downLoadFile(scope.row)">éä»¶</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸å¡åï¼" prop="salesman"> |
| | | <el-select v-model="form.salesman" placeholder="è¯·éæ©" clearable :disabled="operationType === 'view'"> |
| | | <el-select v-model="form.salesman" placeholder="è¯·éæ©" clearable :disabled="operationType === 'view'" filterable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName" /> |
| | | </el-select> |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客æ·åç§°ï¼" prop="customerId"> |
| | | <el-select v-model="form.customerId" placeholder="è¯·éæ©" clearable :disabled="operationType === 'view'"> |
| | | <el-select v-model="form.customerId" placeholder="è¯·éæ©" clearable :disabled="operationType === 'view'" filterable> |
| | | <el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.id"> |
| | | {{ |
| | | item.customerName + "ââ" + item.taxpayerIdentificationNumber |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="产å大类ï¼" prop="productCategory"> |
| | | <!-- <el-select v-model="productForm.productCategory" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | </el-select> --> |
| | | <el-tree-select v-model="productForm.productCategory" placeholder="è¯·éæ©" clearable check-strictly |
| | | @change="getModels" :data="productOptions" :render-after-expand="false" style="width: 100%" /> |
| | | <el-tree-select v-model="productForm.productCategory" placeholder="è¯·éæ©" clearable filterable check-strictly |
| | | @change="getModels" :data="productOptions" :render-after-expand="false" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | import useFormData from "@/hooks/useFormData.js"; |
| | | import dayjs from "dayjs"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | import {listCustomerPrivatePool} from "@/api/basicData/customerFile.js"; |
| | | |
| | | const userStore = useUserStore(); |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | maintenanceTime: "", |
| | | productData: [], |
| | | executionDate: "", |
| | | hasProductionRecord: false, |
| | | }, |
| | | rules: { |
| | | salesman: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | |
| | | }); |
| | | }; |
| | | const formattedNumber = (row, column, cellValue) => { |
| | | if (cellValue === undefined || cellValue === null || cellValue === "") { |
| | | return "0.00"; |
| | | } |
| | | return parseFloat(cellValue).toFixed(2); |
| | | }; |
| | | const findLedgerRecordByRow = (row) => { |
| | | if (!row) return null; |
| | | if ( |
| | | row.maintainer !== undefined || |
| | | row.maintainerName !== undefined || |
| | | row.entryPerson !== undefined || |
| | | row.entryPersonName !== undefined |
| | | ) { |
| | | return row; |
| | | } |
| | | if (row.salesLedgerId !== undefined && row.salesLedgerId !== null) { |
| | | return tableData.value.find((item) => String(item.id) === String(row.salesLedgerId)) || null; |
| | | } |
| | | return null; |
| | | }; |
| | | const isCurrentUserMaintainer = (row) => { |
| | | const ledgerRecord = findLedgerRecordByRow(row); |
| | | if (!ledgerRecord) return true; |
| | | const currentUserId = String(userStore.id ?? ""); |
| | | const currentNickName = String(userStore.nickName ?? "").trim(); |
| | | const maintainerId = ledgerRecord.maintainerId ?? ledgerRecord.entryPerson; |
| | | const maintainerName = |
| | | ledgerRecord.maintainerName ?? ledgerRecord.maintainer ?? ledgerRecord.entryPersonName; |
| | | if (maintainerId !== undefined && maintainerId !== null && String(maintainerId) !== "") { |
| | | return String(maintainerId) === currentUserId; |
| | | } |
| | | if (maintainerName !== undefined && maintainerName !== null && String(maintainerName).trim() !== "") { |
| | | return String(maintainerName).trim() === currentNickName; |
| | | } |
| | | return true; |
| | | }; |
| | | const canEditLedger = (row) => isCurrentUserMaintainer(row); |
| | | const canDeleteLedger = (row) => isCurrentUserMaintainer(row); |
| | | const sensitiveAmountFormatter = (row, column, cellValue) => { |
| | | if (!isCurrentUserMaintainer(row)) { |
| | | return "*****"; |
| | | } |
| | | return formattedNumber(row, column, cellValue); |
| | | }; |
| | | // è·åtreeåæ°æ® |
| | | const getModels = (value) => { |
| | |
| | | ]); |
| | | }; |
| | | // å表åè®¡æ¹æ³ |
| | | const summarizeChildrenTable = (param) => { |
| | | const summarizeChildrenTable = (param, parentRow) => { |
| | | if (!isCurrentUserMaintainer(parentRow)) { |
| | | const { columns } = param; |
| | | return columns.map((column, index) => { |
| | | if (index === 0) { |
| | | return "å计"; |
| | | } |
| | | if (["taxInclusiveUnitPrice", "taxInclusiveTotalPrice", "taxExclusiveTotalPrice"].includes(column.property)) { |
| | | return "*****"; |
| | | } |
| | | return ""; |
| | | }); |
| | | } |
| | | return proxy.summarizeTable(param, [ |
| | | "taxInclusiveUnitPrice", |
| | | "taxInclusiveTotalPrice", |
| | |
| | | }; |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = async (type, row) => { |
| | | if (type === "edit" && row && !canEditLedger(row)) { |
| | | proxy.$modal.msgWarning("å½åç³»ç»ç»å½äººä¸æ¯ç»´æ¤äººï¼ä¸è½ç¼è¾æ°æ®"); |
| | | return; |
| | | } |
| | | operationType.value = type; |
| | | form.value = {}; |
| | | productData.value = []; |
| | | selectedQuotation.value = null; |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data; |
| | | customerList().then((res) => { |
| | | customerOption.value = res; |
| | | listCustomerPrivatePool({current: -1,size:-1}).then((res) => { |
| | | customerOption.value = res.data.records; |
| | | }); |
| | | form.value.entryPerson = userStore.id; |
| | | if (type === "add") { |
| | |
| | | // å
ç¡®ä¿å®¢æ·å表已å è½½ï¼ä¾¿äºåç»åå¡« customerId |
| | | if (!customerOption.value || customerOption.value.length === 0) { |
| | | try { |
| | | const res = await customerList(); |
| | | customerOption.value = res; |
| | | listCustomerPrivatePool({current: -1,size:-1}).then((res) => { |
| | | customerOption.value = res.data.records; |
| | | }); |
| | | } catch (e) { |
| | | // ignoreï¼å
è®¸ç¨æ·åç»æå¨éæ©å®¢æ· |
| | | } |
| | |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | const unauthorizedRows = selectedRows.value.filter((row) => !canDeleteLedger(row)); |
| | | if (unauthorizedRows.length > 0) { |
| | | proxy.$modal.msgWarning("å½åç»å½ç¨æ·ä¸æ¯å½å
¥äººï¼ä¸è½å é¤è¯¥æ°æ®"); |
| | | return; |
| | | } |
| | | const ids = selectedRows.value.map((item) => item.id); |
| | | |
| | | // æ£æ¥æ¯å¦æå·²è¿è¡åè´§æåè´§å®æçéå®è®¢åï¼è¥æåä¸å
许å é¤ |
| | |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客æ·åç§°" prop="customer"> |
| | | <el-select v-model="form.customer" placeholder="è¯·éæ©å®¢æ·" style="width: 100%" @change="handleCustomerChange" clearable> |
| | | <el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.customerName"> |
| | | {{ |
| | | item.customerName + "ââ" + item.taxpayerIdentificationNumber |
| | | }} |
| | | </el-option> |
| | | <el-select v-model="form.customer" placeholder="è¯·éæ©å®¢æ·" style="width: 100%" clearable filterable> |
| | | <el-option v-for="item in customerOption" :key="item.id" :label="item.customerName" :value="item.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸å¡å" prop="salesperson"> |
| | | <el-select v-model="form.salesperson" placeholder="è¯·éæ©ä¸å¡å" style="width: 100%" clearable> |
| | | <el-select v-model="form.salesperson" placeholder="è¯·éæ©ä¸å¡å" style="width: 100%" clearable filterable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName" /> |
| | | </el-select> |
| | |
| | | v-model="node.userId" |
| | | placeholder="éæ©äººå" |
| | | class="approver-select" |
| | | filterable |
| | | clearable |
| | | > |
| | | <el-option |
| | |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | import {customerList} from "@/api/salesManagement/salesLedger.js"; |
| | | import {modelList, productTreeList} from "@/api/basicData/product.js"; |
| | | import {listCustomerPrivatePool} from "@/api/basicData/customerFile.js"; |
| | | |
| | | // ååºå¼æ°æ® |
| | | const loading = ref(false) |
| | |
| | | userName: item.userName || '' |
| | | })); |
| | | getProductOptions(); |
| | | customerList().then((res) => { |
| | | // åªå¤å¶éè¦çåæ®µï¼é¿å
å°ç»ä»¶å¼ç¨æ¾å
¥ååºå¼å¯¹è±¡ |
| | | customerOption.value = (Array.isArray(res) ? res : []).map(item => ({ |
| | | id: item.id, |
| | | customerName: item.customerName || '', |
| | | taxpayerIdentificationNumber: item.taxpayerIdentificationNumber || '' |
| | | })) |
| | | listCustomerPrivatePool({current: -1,size:-1}).then((res) => { |
| | | customerOption.value = res.data.records; |
| | | }); |
| | | } |
| | | const getProductOptions = () => { |
| | |
| | | form.totalAmount = form.subtotal + form.freight + form.otherFee - form.discountAmount |
| | | } |
| | | |
| | | const handleCustomerChange = () => { |
| | | // å¯ä»¥æ ¹æ®å®¢æ·ä¿¡æ¯èªå¨å¡«å
ä¸äºé»è®¤å¼ |
| | | } |
| | | |
| | | const handleSubmit = () => { |
| | | formRef.value.validate((valid) => { |
| | | if (valid) { |
| | |
| | | } |
| | | }) |
| | | customerList().then((res) => { |
| | | // åªå¤å¶éè¦çåæ®µï¼é¿å
å°ç»ä»¶å¼ç¨æ¾å
¥ååºå¼å¯¹è±¡ |
| | | customerOption.value = (Array.isArray(res) ? res : []).map(item => ({ |
| | | id: item.id, |
| | | customerName: item.customerName || '', |
| | | taxpayerIdentificationNumber: item.taxpayerIdentificationNumber || '' |
| | | })) |
| | | customerOption.value = res; |
| | | }); |
| | | } |
| | | |