湟水峡
1.采购模块不要项目名称
2.加一个有待回款登记的提示
3.回款登记、付款登记改成和销售订单价格关联,并且可以多个一起回款或付款
4.合同管理不要下载合同了,跟合同相关的字段可以去掉了
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢è½¦è¾å表 |
| | | export function listVehicle(page, query) { |
| | | return request({ |
| | | url: "/vehicleManagement/getList", |
| | | method: "get", |
| | | params: { |
| | | ...page, |
| | | ...query |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢è½¦è¾ |
| | | export function addVehicle(data) { |
| | | return request({ |
| | | url: "/vehicleManagement/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹è½¦è¾ |
| | | export function updateVehicle(data) { |
| | | return request({ |
| | | url: "/vehicleManagement/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // å é¤è½¦è¾ |
| | | export function delVehicle(query) { |
| | | return request({ |
| | | url: "/vehicleManagement/delete", |
| | | method: "delete", |
| | | data: query, |
| | | }); |
| | | } |
| | | |
| | | // æ ¹æ®idæ¥è¯¢è½¦è¾è¯¦æ
|
| | | export function getVehicleById(id) { |
| | | return request({ |
| | | url: "/vehicleManagement/getById/" + id, |
| | | method: "get" |
| | | }); |
| | | } |
| | | |
| | | // 使ç¨è½¦è¾ |
| | | export function useVehicle(data) { |
| | | return request({ |
| | | url: "/vehicleManagement/useVehicle", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // è¿è½¦ |
| | | export function returnVehicle(data) { |
| | | return request({ |
| | | url: "/vehicleManagement/returnVehicle", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æ¥è¯¢è½¦è¾ä½¿ç¨è®°å½ |
| | | export function getVehicleUsageRecords(page, query) { |
| | | return request({ |
| | | url: "/vehicleManagement/getUsageRecords", |
| | | method: "get", |
| | | params: { |
| | | ...page, |
| | | ...query |
| | | }, |
| | | }); |
| | | } |
| | |
| | | url: '/sales/ledger/getAmountHalfYear', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // é¦é¡µ-å¾
忬¾æé |
| | | export const overdueReceivable = () => { |
| | | return request({ |
| | | url: '/home/overdueReceivable', |
| | | method: 'get' |
| | | }) |
| | | } |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-if="showPagination" |
| | | :total="page.total" |
| | | :layout="page.layout" |
| | | :page="page.current" |
| | |
| | | type: [String, Object], |
| | | default: () => ({ width: "100%" }), |
| | | }, |
| | | showPagination: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | }); |
| | | |
| | | // Data |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" :inline="true"> |
| | | <el-form-item label="车çå·ï¼"> |
| | | <el-input v-model="searchForm.plateNumber" placeholder="请è¾å
¥è½¦çå·" clearable prefix-icon="Search" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="é¢è²ï¼"> |
| | | <el-input v-model="searchForm.color" placeholder="请è¾å
¥é¢è²" clearable prefix-icon="Search" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="åçï¼"> |
| | | <el-input v-model="searchForm.brand" placeholder="请è¾å
¥åç" clearable prefix-icon="Search" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="使ç¨ç¶æï¼"> |
| | | <el-select v-model="searchForm.status" placeholder="è¯·éæ©" clearable @change="handleQuery" style="width: 200px"> |
| | | <el-option label="空é²" value="idle" /> |
| | | <el-option label="使ç¨ä¸" value="in_use" /> |
| | | <el-option label="ç»´ä¿®ä¸" value="maintenance" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery">æç´¢</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="table_list"> |
| | | <div class="actions"> |
| | | <div></div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm('add')"> |
| | | æ°å¢è½¦è¾ |
| | | </el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <PIMTable |
| | | :table-data="tableData" |
| | | :column="tableColumns" |
| | | :is-selection="true" |
| | | :border="true" |
| | | :table-loading="tableLoading" |
| | | :table-style="{ width: '100%', height: 'calc(100vh - 21.5em)' }" |
| | | :page="{ |
| | | current: page.current, |
| | | size: page.size, |
| | | total: total, |
| | | layout: 'total, sizes, prev, pager, next, jumper' |
| | | }" |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="paginationChange" |
| | | > |
| | | <template #operation="{ row }"> |
| | | <el-button link type="primary" size="small" @click="openForm('edit', row)">ç¼è¾</el-button> |
| | | <el-button link type="primary" size="small" v-if="row.status === 'idle'" |
| | | @click="openUseForm(row)">使ç¨è½¦è¾</el-button> |
| | | <el-button link type="primary" size="small" v-if="row.status === 'in_use'" |
| | | @click="openReturnForm(row)">è¿è½¦</el-button> |
| | | <el-button link type="primary" size="small" @click="viewUsageRecords(row)">使ç¨è®°å½</el-button> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | |
| | | <!-- æ°å¢/ç¼è¾è½¦è¾å¼¹çª --> |
| | | <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? 'æ°å¢è½¦è¾' : 'ç¼è¾è½¦è¾'" width="50%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="120px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="车çå·ï¼" prop="plateNumber"> |
| | | <el-input v-model="form.plateNumber" placeholder="请è¾å
¥è½¦çå·" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="é¢è²ï¼" prop="color"> |
| | | <el-input v-model="form.color" placeholder="请è¾å
¥é¢è²" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åçï¼" prop="brand"> |
| | | <el-input v-model="form.brand" placeholder="请è¾å
¥åç" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="使ç¨ç¶æï¼" prop="status"> |
| | | <el-select v-model="form.status" placeholder="è¯·éæ©" clearable style="width: 100%"> |
| | | <el-option label="空é²" value="idle" /> |
| | | <el-option label="使ç¨ä¸" value="in_use" /> |
| | | <el-option label="ç»´ä¿®ä¸" value="maintenance" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="表æ¾éç¨(km)ï¼"> |
| | | <el-input-number v-model="form.odometer" :min="0" :precision="2" style="width: 100%" |
| | | placeholder="请è¾å
¥è¡¨æ¾éç¨" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨ï¼"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" clearable type="textarea" :rows="3" /> |
| | | </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="useFormVisible" title="使ç¨è½¦è¾" width="50%" @close="closeUseDia"> |
| | | <el-form :model="useForm" label-width="140px" label-position="top" :rules="useRules" ref="useFormRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="车çå·ï¼"> |
| | | <el-input :value="currentUseRow ? currentUseRow.plateNumber : ''" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç®çå°ï¼" prop="destination"> |
| | | <el-input v-model="useForm.destination" placeholder="请è¾å
¥ç®çå°" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="表æ¾éç¨(km)ï¼" prop="odometer"> |
| | | <el-input-number v-model="useForm.odometer" :min="0" :precision="2" style="width: 100%" |
| | | placeholder="请è¾å
¥è¡¨æ¾éç¨" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¬æ¬¡è¡é©¶éç¨(km)ï¼" prop="travelDistance"> |
| | | <el-input-number v-model="useForm.travelDistance" :min="0" :precision="2" style="width: 100%" |
| | | placeholder="请è¾å
¥æ¬æ¬¡è¡é©¶éç¨" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="使ç¨äººï¼" prop="userId"> |
| | | <el-select v-model="useForm.userId" placeholder="è¯·éæ©ä½¿ç¨äºº" clearable filterable> |
| | | <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨ï¼"> |
| | | <el-input v-model="useForm.remark" placeholder="请è¾å
¥å¤æ³¨" clearable type="textarea" :rows="3" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitUseForm">确认</el-button> |
| | | <el-button @click="closeUseDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- è¿è½¦å¼¹çª --> |
| | | <el-dialog v-model="returnFormVisible" title="è¿è½¦" width="50%" @close="closeReturnDia"> |
| | | <el-form :model="returnForm" label-width="140px" label-position="top" :rules="returnRules" ref="returnFormRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="车çå·ï¼"> |
| | | <el-input :value="currentReturnRow ? currentReturnRow.plateNumber : ''" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="è¿è½¦æ¶é´ï¼" prop="returnTime"> |
| | | <el-date-picker style="width: 100%" v-model="returnForm.returnTime" value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="è¯·éæ©è¿è½¦æ¶é´" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="表æ¾éç¨(km)ï¼" prop="odometer"> |
| | | <el-input-number v-model="returnForm.odometer" :min="0" :precision="2" style="width: 100%" |
| | | placeholder="请è¾å
¥è¡¨æ¾éç¨" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="使ç¨äººï¼" prop="userId"> |
| | | <el-select v-model="returnForm.userId" placeholder="è¯·éæ©ä½¿ç¨äºº" clearable filterable> |
| | | <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨ï¼"> |
| | | <el-input v-model="returnForm.remark" placeholder="请è¾å
¥å¤æ³¨" clearable type="textarea" :rows="3" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitReturnForm">确认</el-button> |
| | | <el-button @click="closeReturnDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- 使ç¨è®°å½å¼¹çª --> |
| | | <el-dialog v-model="usageRecordsVisible" title="使ç¨è®°å½" width="70%" @close="closeUsageRecords"> |
| | | <PIMTable |
| | | :table-data="usageRecordsData" |
| | | :column="usageRecordsColumns" |
| | | :border="true" |
| | | :table-loading="usageRecordsLoading" |
| | | :table-style="{ width: '100%' }" |
| | | :page="{ |
| | | current: usageRecordsPage.current, |
| | | size: usageRecordsPage.size, |
| | | total: usageRecordsTotal, |
| | | layout: 'total, sizes, prev, pager, next, jumper' |
| | | }" |
| | | @pagination="usageRecordsPaginationChange" |
| | | /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, ref, reactive, toRefs, getCurrentInstance } from "vue"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import pagination from "@/components/PIMTable/Pagination.vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { |
| | | listVehicle, |
| | | addVehicle, |
| | | updateVehicle, |
| | | delVehicle, |
| | | getVehicleById, |
| | | useVehicle, |
| | | returnVehicle, |
| | | getVehicleUsageRecords, |
| | | } from "@/api/collaborativeApproval/vehicleManagement.js"; |
| | | import useFormData from "@/hooks/useFormData.js"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | const userStore = useUserStore(); |
| | | const { proxy } = getCurrentInstance(); |
| | | const tableData = ref([]); |
| | | const selectedRows = ref([]); |
| | | const userList = ref([]); |
| | | const tableLoading = ref(false); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | }); |
| | | const total = ref(0); |
| | | |
| | | // æç´¢è¡¨å |
| | | const data = reactive({ |
| | | searchForm: { |
| | | plateNumber: "", |
| | | color: "", |
| | | brand: "", |
| | | status: "", |
| | | }, |
| | | form: { |
| | | plateNumber: "", |
| | | color: "", |
| | | brand: "", |
| | | status: "idle", |
| | | odometer: 0, |
| | | remark: "", |
| | | }, |
| | | rules: { |
| | | plateNumber: [{ required: true, message: "请è¾å
¥è½¦çå·", trigger: "blur" }], |
| | | color: [{ required: true, message: "请è¾å
¥é¢è²", trigger: "blur" }], |
| | | brand: [{ required: true, message: "请è¾å
¥åç", trigger: "blur" }], |
| | | status: [{ required: true, message: "è¯·éæ©ä½¿ç¨ç¶æ", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { form, rules } = toRefs(data); |
| | | const { form: searchForm } = useFormData(data.searchForm); |
| | | |
| | | // 使ç¨è½¦è¾è¡¨å |
| | | const useFormVisible = ref(false); |
| | | const currentUseRow = ref(null); |
| | | const useVehicleFormData = reactive({ |
| | | useForm: { |
| | | vehicleId: "", |
| | | destination: "", |
| | | odometer: 0, |
| | | travelDistance: 0, |
| | | userId: "", |
| | | remark: "", |
| | | }, |
| | | useRules: { |
| | | destination: [{ required: true, message: "请è¾å
¥ç®çå°", trigger: "blur" }], |
| | | odometer: [{ required: true, message: "请è¾å
¥è¡¨æ¾éç¨", trigger: "blur" }], |
| | | travelDistance: [{ required: true, message: "请è¾å
¥æ¬æ¬¡è¡é©¶éç¨", trigger: "blur" }], |
| | | userId: [{ required: true, message: "è¯·éæ©ä½¿ç¨äºº", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { useForm, useRules } = toRefs(useVehicleFormData); |
| | | |
| | | // è¿è½¦è¡¨å |
| | | const returnFormVisible = ref(false); |
| | | const currentReturnRow = ref(null); |
| | | const returnFormData = reactive({ |
| | | returnForm: { |
| | | vehicleId: "", |
| | | returnTime: "", |
| | | odometer: 0, |
| | | userId: "", |
| | | remark: "", |
| | | }, |
| | | returnRules: { |
| | | returnTime: [{ required: true, message: "è¯·éæ©è¿è½¦æ¶é´", trigger: "change" }], |
| | | odometer: [{ required: true, message: "请è¾å
¥è¡¨æ¾éç¨", trigger: "blur" }], |
| | | userId: [{ required: true, message: "è¯·éæ©ä½¿ç¨äºº", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { returnForm, returnRules } = toRefs(returnFormData); |
| | | |
| | | // 使ç¨è®°å½ |
| | | const usageRecordsVisible = ref(false); |
| | | const usageRecordsData = ref([]); |
| | | const usageRecordsLoading = ref(false); |
| | | const usageRecordsPage = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | }); |
| | | const usageRecordsTotal = ref(0); |
| | | const currentVehicleId = ref(null); |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const operationType = ref(""); |
| | | const dialogFormVisible = ref(false); |
| | | const currentId = ref(""); |
| | | |
| | | // è¡¨æ ¼åé
ç½® |
| | | const tableColumns = ref([ |
| | | { label: "车çå·", prop: "plateNumber", width: "120" }, |
| | | { label: "é¢è²", prop: "color", width: "100" }, |
| | | { label: "åç", prop: "brand", width: "120" }, |
| | | { |
| | | label: "使ç¨ç¶æ", |
| | | prop: "status", |
| | | width: "100", |
| | | dataType: "tag", |
| | | formatData: (val) => { |
| | | if (val === "idle") return "空é²"; |
| | | if (val === "in_use") return "使ç¨ä¸"; |
| | | if (val === "maintenance") return "ç»´ä¿®ä¸"; |
| | | return val || "-"; |
| | | }, |
| | | formatType: (val) => { |
| | | if (val === "idle") return "success"; |
| | | if (val === "in_use") return "warning"; |
| | | if (val === "maintenance") return "danger"; |
| | | return "info"; |
| | | }, |
| | | }, |
| | | { label: "å½å使ç¨äºº", prop: "currentUser", width: "120" }, |
| | | { label: "表æ¾éç¨(km)", prop: "odometer", width: "120" }, |
| | | { label: "å建æ¶é´", prop: "createTime", width: "180" }, |
| | | { |
| | | label: "æä½", |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: "250", |
| | | }, |
| | | ]); |
| | | |
| | | // 使ç¨è®°å½è¡¨æ ¼åé
ç½® |
| | | const usageRecordsColumns = ref([ |
| | | { label: "车çå·", prop: "plateNumber", width: "120" }, |
| | | { label: "使ç¨äºº", prop: "userName", width: "120" }, |
| | | { label: "ç®çå°", prop: "destination", width: "150" }, |
| | | { label: "ä½¿ç¨æ¶é´", prop: "useTime", width: "180" }, |
| | | { label: "è¿è½¦æ¶é´", prop: "returnTime", width: "180" }, |
| | | { label: "使ç¨åéç¨(km)", prop: "odometerBefore", width: "130" }, |
| | | { label: "è¿è½¦æ¶éç¨(km)", prop: "odometerAfter", width: "130" }, |
| | | { label: "æ¬æ¬¡è¡é©¶éç¨(km)", prop: "travelDistance", width: "140" }, |
| | | ]); |
| | | |
| | | // æ¥è¯¢å表 |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | | }; |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | listVehicle(page, searchForm) |
| | | .then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.records || res.data || []; |
| | | total.value = res.total || 0; |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection; |
| | | }; |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = async (type, row) => { |
| | | operationType.value = type; |
| | | form.value = { |
| | | plateNumber: "", |
| | | color: "", |
| | | brand: "", |
| | | status: "idle", |
| | | odometer: 0, |
| | | remark: "", |
| | | }; |
| | | |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data || []; |
| | | |
| | | if (type !== "add") { |
| | | currentId.value = row.id; |
| | | getVehicleById(row.id).then((res) => { |
| | | form.value = { ...res.data || res }; |
| | | }); |
| | | } |
| | | dialogFormVisible.value = true; |
| | | }; |
| | | |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (operationType.value === "add") { |
| | | addVehicle(form.value).then((res) => { |
| | | proxy.$modal.msgSuccess("æ°å¢æå"); |
| | | closeDia(); |
| | | getList(); |
| | | }); |
| | | } else { |
| | | form.value.id = currentId.value; |
| | | updateVehicle(form.value).then((res) => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | closeDia(); |
| | | getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef"); |
| | | dialogFormVisible.value = false; |
| | | }; |
| | | |
| | | // æå¼åè´§å¼¹æ¡ |
| | | const openUseForm = async (row) => { |
| | | currentUseRow.value = row; |
| | | useForm.value = { |
| | | vehicleId: row.id, |
| | | destination: "", |
| | | odometer: row.odometer || 0, |
| | | travelDistance: 0, |
| | | userId: "", |
| | | remark: "", |
| | | }; |
| | | |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data || []; |
| | | |
| | | useFormVisible.value = true; |
| | | }; |
| | | |
| | | // æäº¤ä½¿ç¨è½¦è¾è¡¨å |
| | | const submitUseForm = () => { |
| | | proxy.$refs["useFormRef"].validate((valid) => { |
| | | if (valid) { |
| | | useVehicle(useForm.value).then((res) => { |
| | | proxy.$modal.msgSuccess("使ç¨è½¦è¾æå"); |
| | | closeUseDia(); |
| | | getList(); |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // å
³é使ç¨è½¦è¾å¼¹æ¡ |
| | | const closeUseDia = () => { |
| | | proxy.resetForm("useFormRef"); |
| | | useFormVisible.value = false; |
| | | currentUseRow.value = null; |
| | | }; |
| | | |
| | | // æå¼è¿è½¦å¼¹æ¡ |
| | | const openReturnForm = async (row) => { |
| | | currentReturnRow.value = row; |
| | | returnForm.value = { |
| | | vehicleId: row.id, |
| | | returnTime: dayjs().format("YYYY-MM-DD HH:mm:ss"), |
| | | odometer: row.odometer || 0, |
| | | userId: "", |
| | | remark: "", |
| | | }; |
| | | |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data || []; |
| | | |
| | | returnFormVisible.value = true; |
| | | }; |
| | | |
| | | // æäº¤è¿è½¦è¡¨å |
| | | const submitReturnForm = () => { |
| | | proxy.$refs["returnFormRef"].validate((valid) => { |
| | | if (valid) { |
| | | returnVehicle(returnForm.value).then((res) => { |
| | | proxy.$modal.msgSuccess("è¿è½¦æå"); |
| | | closeReturnDia(); |
| | | getList(); |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // å
³éè¿è½¦å¼¹æ¡ |
| | | const closeReturnDia = () => { |
| | | proxy.resetForm("returnFormRef"); |
| | | returnFormVisible.value = false; |
| | | currentReturnRow.value = null; |
| | | }; |
| | | |
| | | // æ¥ç使ç¨è®°å½ |
| | | const viewUsageRecords = (row) => { |
| | | currentVehicleId.value = row.id; |
| | | usageRecordsPage.current = 1; |
| | | getUsageRecords(); |
| | | usageRecordsVisible.value = true; |
| | | }; |
| | | |
| | | // è·å使ç¨è®°å½ |
| | | const getUsageRecords = () => { |
| | | usageRecordsLoading.value = true; |
| | | getVehicleUsageRecords(usageRecordsPage, { vehicleId: currentVehicleId.value }) |
| | | .then((res) => { |
| | | usageRecordsLoading.value = false; |
| | | usageRecordsData.value = res.records || res.data || []; |
| | | usageRecordsTotal.value = res.total || 0; |
| | | }) |
| | | .catch(() => { |
| | | usageRecordsLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | // 使ç¨è®°å½å页 |
| | | const usageRecordsPaginationChange = (obj) => { |
| | | usageRecordsPage.current = obj.page; |
| | | usageRecordsPage.size = obj.limit; |
| | | getUsageRecords(); |
| | | }; |
| | | |
| | | // å
³é使ç¨è®°å½å¼¹æ¡ |
| | | const closeUsageRecords = () => { |
| | | usageRecordsVisible.value = false; |
| | | usageRecordsData.value = []; |
| | | currentVehicleId.value = null; |
| | | }; |
| | | |
| | | // å¯¼åº |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å¯¼åºï¼æ¯å¦ç¡®è®¤å¯¼åºï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/vehicleManagement/export", {}, "车è¾ç®¡ç.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map((item) => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "å é¤", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delVehicle(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .ml-10 { |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | |
| | | .actions { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 10px; |
| | | } |
| | | </style> |
| | |
| | | import Echarts from "@/components/Echarts/echarts.vue"; |
| | | import * as echarts from 'echarts'; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import { ElNotification } from 'element-plus' |
| | | import { |
| | | analysisCustomerContractAmounts, getAmountHalfYear, |
| | | getBusiness, |
| | | homeTodos, |
| | | qualityStatistics, |
| | | statisticsReceivablePayable |
| | | statisticsReceivablePayable, |
| | | overdueReceivable |
| | | } from "@/api/viewIndex.js"; |
| | | |
| | | const userStore = useUserStore() |
| | |
| | | getBusinessData() |
| | | analysisCustomer() |
| | | todoInfoS() |
| | | notifyOverdueReceivable() |
| | | statisticsReceivable() |
| | | qualityStatisticsInfo() |
| | | getAmountHalfYearNum() |
| | | }) |
| | | |
| | | // å¾
忬¾æé |
| | | const notifyOverdueReceivable = async () => { |
| | | try { |
| | | const res = await overdueReceivable() |
| | | const data = res.data |
| | | |
| | | if (data > 0) { |
| | | ElNotification({ |
| | | title: 'å¾
忬¾æé', |
| | | message: `å½åæ${data}æ¡å¾
忬¾`, |
| | | type: 'warning', |
| | | duration: 6000, |
| | | }) |
| | | } |
| | | } catch (e) { |
| | | // ä¸å½±åé¦é¡µæ£å¸¸å è½½ |
| | | console.error('overdueReceivable error:', e) |
| | | } |
| | | } |
| | | // æ°æ®ç»è®¡ |
| | | const getBusinessData = () => { |
| | | getBusiness().then((res) => { |
| | |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :tableLoading="tableLoading" |
| | | :showPagination="false" |
| | | height="600" |
| | | ></PIMTable> |
| | | <template #footer> |
| | |
| | | import { onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue"; |
| | | import FormDia from "@/views/personnelManagement/contractManagement/components/formDia.vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { staffOnJobListPage, staffOnJobExportCopy } from "@/api/personnelManagement/employeeRecord.js"; |
| | | import { staffOnJobListPage } from "@/api/personnelManagement/employeeRecord.js"; |
| | | import dayjs from "dayjs"; |
| | | import { getToken } from "@/utils/auth.js"; |
| | | import FilesDia from "./filesDia.vue"; |
| | |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: 'right', |
| | | width: 180, |
| | | width: 130, |
| | | operation: [ |
| | | { |
| | | name: "详æ
", |
| | |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openFilesFormDia(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "ä¸è½½åå", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | handleDownloadContract(row); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | // ä¸è½½åå |
| | | const handleDownloadContract = (row) => { |
| | | const fileName = `${row.staffName || "åå"}å³å¨åå.docx`; |
| | | proxy.$modal?.loading?.("æ£å¨çæååï¼è¯·ç¨å..."); |
| | | staffOnJobExportCopy({ ...row }) |
| | | .then((res) => { |
| | | proxy.$modal?.closeLoading?.(); |
| | | if (res?.code === 200 && res?.msg) { |
| | | const javaApi = proxy.javaApi || import.meta.env.VITE_JAVA_API || ""; |
| | | const downloadPath = res.msg.startsWith("/") ? res.msg : `/${res.msg}`; |
| | | const downloadUrl = `${javaApi}${downloadPath}`; |
| | | const link = document.createElement("a"); |
| | | link.href = downloadUrl; |
| | | link.download = fileName; |
| | | link.target = "_blank"; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } else { |
| | | proxy.$modal.msgError(res?.msg || "ååçæå¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal?.closeLoading?.(); |
| | | proxy.$modal.msgError("ååçæå¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | }); |
| | | }; |
| | | const upload = reactive({ |
| | |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">å§åï¼</span> |
| | | <el-select v-model="form.staffName" placeholder="è¯·éæ©äººå" style="width: 100%" @change="handleSelect"> |
| | | <el-select v-model="form.staffName" placeholder="è¯·éæ©äººå" style="width: 100%" @change="handleSelect" filterable> |
| | | <el-option |
| | | v-for="item in personList" |
| | | :key="item.id" |
| | |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">ååç»ææ¥æï¼</span> |
| | | <span class="info-value">{{ form.contractEndTime || '-' }}</span> |
| | | <span class="info-value">{{ form.contractExpireTime || '-' }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | emergencyContactPhone: "", |
| | | contractTerm: 0, |
| | | contractStartTime: "", |
| | | contractEndTime: "", |
| | | contractExpireTime: "", |
| | | dimissionDate: "", |
| | | dimissionReason: "", |
| | | staffState: "", |
| | |
| | | emergencyContactPhone: "", |
| | | contractTerm: 0, |
| | | contractStartTime: "", |
| | | contractEndTime: "", |
| | | contractExpireTime: "", |
| | | dimissionDate: "", |
| | | dimissionReason: "", |
| | | staffState: "", |
| | |
| | | emergencyContactPhone, |
| | | contractTerm, |
| | | contractStartTime, |
| | | contractEndTime, |
| | | contractExpireTime, |
| | | staffName |
| | | } = obj |
| | | // ä¿çç¦»èæ¥æå离èåå ï¼åªæ´æ°åå·¥ä¿¡æ¯ |
| | |
| | | emergencyContactPhone, |
| | | contractTerm, |
| | | contractStartTime, |
| | | contractEndTime, |
| | | contractExpireTime, |
| | | staffName |
| | | } |
| | | } |
| | |
| | | width="70%" |
| | | @close="closeDia" |
| | | > |
| | | <!-- æç
§å
¥èæ°å¢å¼¹çªå段å±ç¤ºåºç¡ä¿¡æ¯åååä¿¡æ¯ --> |
| | | <el-descriptions class="detail-descriptions" :column="2" border size="small"> |
| | | <el-descriptions-item label="åå·¥ç¼å·">{{ formData.staffNo || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å§å">{{ formData.staffName || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="æ§å«">{{ formData.sex || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å¹´é¾">{{ formData.age || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="身份è¯å·">{{ formData.identityCard || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="æ·ç±ä½å" :span="2">{{ formData.nativePlace || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç°ä½å" :span="2">{{ formData.adress || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å²ä½">{{ formData.postJob || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="第ä¸å¦å">{{ formData.firstStudy || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="ä¸ä¸">{{ formData.profession || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="èç³»çµè¯">{{ formData.phone || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç´§æ¥è系人">{{ formData.emergencyContact || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç´§æ¥è系人çµè¯">{{ formData.emergencyContactPhone || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="ååç¾è®¢æ¥æ">{{ formData.signDate || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å³å¨ååæééæ©"> |
| | | <span v-if="formData.dateSelect === 'A'">Aãæåºå®æé</span> |
| | | <span v-else-if="formData.dateSelect === 'B'">Bãæ åºå®æé</span> |
| | | <span v-else-if="formData.dateSelect === 'C'">Cã以宿ä¸å®å·¥ä½ä»»å¡ä¸ºæé</span> |
| | | <span v-else>-</span> |
| | | <el-descriptions-item label="åå·¥ç¼å·"> |
| | | {{ formData.staffNo || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ååå¹´é">{{ formattedContractTerm }}</el-descriptions-item> |
| | | <el-descriptions-item label="è¯ç¨æå¼å§æ¥æ" v-if="formData.dateSelect === 'A' || formData.dateSelect === 'B'"> |
| | | {{ formData.trialStartDate || '-' }} |
| | | <el-descriptions-item label="å§å"> |
| | | {{ formData.staffName || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="è¯ç¨æç»ææ¥æ" v-if="formData.dateSelect === 'A' || formData.dateSelect === 'B'"> |
| | | {{ formData.trialEndDate || '-' }} |
| | | <el-descriptions-item label="æ§å«"> |
| | | {{ formData.sex || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="è¯ç¨æå·¥èµ" v-if="formData.dateSelect === 'A' || formData.dateSelect === 'B'"> |
| | | {{ formData.proSalary ? formData.proSalary.toFixed(2) : '-' }} |
| | | <el-descriptions-item label="å¹´é¾"> |
| | | {{ formData.age || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ååå¼å§æ¥æ">{{ calculatedContractStart }}</el-descriptions-item> |
| | | <el-descriptions-item label="ååç»ææ¥æ">{{ formData.contractEndTime || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å·¥èµæ¥é
¬" :span="2"> |
| | | <span v-if="formData.salarySelect === 'A'"> |
| | | Aã乿¹çå·¥èµæ¥é
¬æç
§ç²æ¹ä¾æ³å¶å®çè§ç« å¶åº¦ä¸çå
é¨å·¥èµåé
åæ³ç¡®å®ï¼æ ¹æ®ä¹æ¹çå·¥ä½å²ä½ç¡®å®å
¶æ¯æå·¥èµã |
| | | </span> |
| | | <span v-else-if="formData.salarySelect === 'B'"> |
| | | Bãç²æ¹å¯¹ä¹æ¹å®è¡åºæ¬å·¥èµå绩æå·¥èµç¸ç»åçå
é¨å·¥èµåé
åæ³ï¼ä¹æ¹çæ¶å
¥å
æ¬åºæ¬å·¥èµã误é¤ã交éãçæ´»ä½å®¿çå项补å©ï¼å¦æå卿 ¹æ®å
é¨å·¥èµåé
åæ³è°æ´å
¶å·¥èµï¼ç»©æå·¥èµæ ¹æ®ä¹æ¹çå·¥ä½ä¸ç»©ãå³å¨ææåå®é
è´¡ç®æç
§å
é¨åé
åæ³èæ ¸ç¡®å®ã |
| | | </span> |
| | | <span v-else-if="formData.salarySelect === 'C'"> |
| | | Cãç²æ¹å®è¡è®¡ä»¶å·¥èµå¶ï¼ä»¥ç²æ¹æ¥å°è®¢ååå
¬å¸ç产计åï¼æç
§å®é¢å计件åä»·ï¼æ ¹æ®ä¹æ¹å®æçä¸ç»©ï¼ææ¶è¶³é¢æ¯ä»ä¹æ¹çå·¥èµæ¥é
‹ |
| | | </span> |
| | | <span v-else>-</span> |
| | | <el-descriptions-item label="æ·ç±ä½å" :span="2"> |
| | | {{ formData.nativePlace || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ç¦å©å¾
é" :span="2">{{ formData.remark || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç°ä½å" :span="2"> |
| | | {{ formData.adress || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="å²ä½"> |
| | | {{ formData.postJob || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="第ä¸å¦å"> |
| | | {{ formData.firstStudy || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ä¸ä¸"> |
| | | {{ formData.profession || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="èç³»çµè¯"> |
| | | {{ formData.phone || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ç´§æ¥è系人"> |
| | | {{ formData.emergencyContact || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ç´§æ¥è系人çµè¯"> |
| | | {{ formData.emergencyContactPhone || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ååå¼å§æ¥æ"> |
| | | {{ formData.contractStartTime || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ååç»ææ¥æ"> |
| | | {{ formData.contractExpireTime || '-' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ååå¹´é"> |
| | | {{ formattedContractTerm }} |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | |
| | | signDate: "", |
| | | salarySelect: "", |
| | | contractStartTime: "", |
| | | contractEndTime: "", |
| | | contractExpireTime: "", |
| | | contractTerm: null, |
| | | remark: "", |
| | | }); |
| | |
| | | }); |
| | | |
| | | const calculatedContractStart = computed(() => { |
| | | const endDate = formData.contractEndTime; |
| | | const endDate = formData.contractExpireTime; |
| | | const termValue = formData.contractTerm; |
| | | const numberValue = Number(termValue); |
| | | if (!endDate || isNaN(numberValue)) { |
| | |
| | | <el-input v-model="form.emergencyContactPhone" placeholder="请è¾å
¥" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="ååå¹´éï¼" prop="contractTermcontractTerm">--> |
| | | <!-- <el-input-number v-model="form.contractTerm" :precision="0" :step="1" style="width: 100%" :disabled="true"/>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ååå¹´éï¼" prop="contractTerm"> |
| | | <el-input-number v-model="form.contractTerm" :precision="0" :step="1" style="width: 100%" :disabled="true"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | style="width: 100%" |
| | | @change="calculateContractTerm" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | style="width: 100%" |
| | | @change="calculateContractTerm" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref} from "vue"; |
| | | import {ref, reactive, toRefs, getCurrentInstance} from "vue"; |
| | | import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | |
| | | getStaffJoinInfo(row.id).then(res => { |
| | | form.value = {...res.data} |
| | | // ç¼è¾æ¶ä¹è®¡ç®ä¸æ¬¡ååå¹´é |
| | | // calculateContractTerm(); |
| | | calculateContractTerm(); |
| | | }) |
| | | } else { |
| | | // æ°å¢æ¶é置表å |
| | | form.value = { |
| | | staffNo: "", |
| | | staffName: "", |
| | | sex: "", |
| | | nativePlace: "", |
| | | postJob: "", |
| | | adress: "", |
| | | firstStudy: "", |
| | | profession: "", |
| | | age: 0, |
| | | phone: "", |
| | | emergencyContact: "", |
| | | emergencyContactPhone: "", |
| | | contractTerm: 0, |
| | | contractStartTime: "", |
| | | contractEndTime: "", |
| | | staffState: "", |
| | | }; |
| | | } |
| | | } |
| | | // æäº¤äº§å表å |
| | |
| | | const startDate = new Date(form.value.contractStartTime); |
| | | const endDate = new Date(form.value.contractEndTime); |
| | | |
| | | if (endDate > startDate) { |
| | | if (endDate >= startDate) { |
| | | // 计ç®å¹´ä»½å·® |
| | | const yearDiff = endDate.getFullYear() - startDate.getFullYear(); |
| | | const monthDiff = endDate.getMonth() - startDate.getMonth(); |
| | |
| | | <script setup> |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import {onMounted, ref} from "vue"; |
| | | // import FormDia from "@/views/personnelManagement/onboarding/components/formDia.vue"; |
| | | import FormDia from "@/views/personnelManagement/onboarding/components/formDiaXJHT.vue"; // æ°çé£åå
¬å¸ç¨ç表å |
| | | import FormDia from "@/views/personnelManagement/onboarding/components/formDia.vue"; |
| | | // import FormDia from "@/views/personnelManagement/onboarding/components/formDiaXJHT.vue"; // æ°çé£åå
¬å¸ç¨ç表å |
| | | import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import dayjs from "dayjs"; |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="项ç®åç§°ï¼" prop="projectName"> |
| | | <el-input |
| | | v-model="form.projectName" |
| | | placeholder="èªå¨å¡«å
" |
| | | clearable |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å票å·ï¼" prop="invoiceNumber"> |
| | | <el-input |
| | | v-model="form.invoiceNumber" |
| | |
| | | purchaseLedgerNo: undefined, // éè´ååå· |
| | | salesContractNo: undefined, // éå®ååå· |
| | | supplierName: undefined, // ä¾åºååç§° |
| | | projectName: undefined, // 项ç®åç§° |
| | | invoiceNumber: undefined, // åç¥¨å· |
| | | invoiceAmount: undefined, // å票éé¢(å
) |
| | | issUerId: userStore.id, // å½å
¥äºº |
| | |
| | | id: contractId, // æç¡®è®¾ç½®ååID |
| | | purchaseLedgerNo: contract.purchaseContractNumber, // æ·»å éè´ååå· |
| | | supplierName: contract.supplierName, // æ·»å ä¾åºååç§° |
| | | projectName: contract.projectName // æ·»å 项ç®åç§° |
| | | }); |
| | | }); |
| | | } |
| | |
| | | form.entryDate = dayjs().format("YYYY-MM-DD"); |
| | | form.enterDate = dayjs().format("YYYY-MM-DD"); |
| | | form.salesContractNo = results[0].data.salesContractNo; |
| | | form.projectName = results[0].data.projectName; |
| | | form.supplierName = results[0].data.supplierName; |
| | | // ä¿çå½å
¥äººä¿¡æ¯ |
| | | form.issUerId = userStore.id; |
| | |
| | | purchaseContractNumber: contract.purchaseContractNumber, // 使ç¨å®é
çéè´ååå· |
| | | salesContractNo: contract.salesContractNo, // 使ç¨å®é
çéå®ååå· |
| | | supplierName: contract.supplierName, // 使ç¨å®é
çä¾åºååç§° |
| | | projectName: contract.projectName, // 使ç¨å®é
ç项ç®åç§° |
| | | |
| | | // äº§åæ°æ® |
| | | productData: proxy.HaveJson(contractProductData), |
| | |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="项ç®åç§°"> |
| | | <el-input |
| | | v-model="filters.projectName" |
| | | placeholder="请è¾å
¥é¡¹ç®åç§°" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="getTableData"> æç´¢ </el-button> |
| | | <el-button @click="resetFilters"> éç½® </el-button> |
| | |
| | | label: "ä¾åºååç§°", |
| | | prop: "supplierName", |
| | | width:300 |
| | | }, |
| | | { |
| | | label: "项ç®åç§°", |
| | | prop: "projectName", |
| | | width:400 |
| | | }, |
| | | { |
| | | label: "å½å
¥äºº", |
| | |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="项ç®åç§°" |
| | | prop="projectName" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="ååéé¢(å
)" |
| | | prop="contractAmount" |
| | | show-overflow-tooltip |
| | |
| | | <el-form-item label="ä¾åºååç§°ï¼" prop="supplierName"> |
| | | <el-input |
| | | v-model="form.supplierName" |
| | | placeholder="èªå¨å¡«å
" |
| | | clearable |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="项ç®åç§°ï¼" prop="projectName"> |
| | | <el-input |
| | | v-model="form.projectName" |
| | | placeholder="èªå¨å¡«å
" |
| | | clearable |
| | | disabled |
| | |
| | | <el-col :span="4"> |
| | | <el-form-item style="float: right; margin-right: unset"> |
| | | <el-button @click="handleExport" style="margin-right: 10px">导åº</el-button> |
| | | <el-button type="primary" @click="openForm('add')"> |
| | | <el-button type="primary" @click="openForm()"> |
| | | æ°å¢ä»æ¬¾ |
| | | </el-button> |
| | | <!-- <el-button type="danger" plain @click="handleDelete">--> |
| | |
| | | </div> |
| | | <el-dialog |
| | | v-model="dialogFormVisible" |
| | | :title="operationType === 'add' ? 'æ°å¢ä»æ¬¾ç»è®°' : 'ç¼è¾ä»æ¬¾ç»è®°'" |
| | | width="60%" |
| | | title="æ°å¢ä»æ¬¾ç»è®°" |
| | | width="80%" |
| | | @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="purchaseContractNumber"> |
| | | <el-input |
| | | v-model="form.purchaseContractNumber" |
| | | placeholder="èªå¨å¡«å
" |
| | | clearable |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éå®ååå·ï¼" prop="salesContractNo"> |
| | | <el-input |
| | | v-model="form.salesContractNo" |
| | | placeholder="èªå¨å¡«å
" |
| | | clearable |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¾åºååç§°ï¼" prop="supplierName"> |
| | | <el-input |
| | | v-model="form.supplierName" |
| | | placeholder="èªå¨å¡«å
" |
| | | clearable |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å票å·ï¼" prop="invoiceNumber"> |
| | | <el-input |
| | | v-model="form.invoiceNumber" |
| | | placeholder="èªå¨å¡«å
" |
| | | clearable |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å票éé¢(å
)ï¼" prop="invoiceAmount"> |
| | | <el-input |
| | | v-model="form.invoiceAmount" |
| | | placeholder="èªå¨å¡«å
" |
| | | clearable |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¬æ¬¡ä»æ¬¾éé¢ï¼" prop="currentPaymentAmount"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" |
| | | :precision="2" |
| | | v-model="form.currentPaymentAmount" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="仿¬¾æ¹å¼ï¼" prop="paymentMethod"> |
| | | <el-select |
| | | v-model="form.paymentMethod" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | > |
| | | <el-option label="çµæ±" value="çµæ±" /> |
| | | <el-option label="æ¿å
" value="æ¿å
" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="仿¬¾æ¥æï¼" prop="paymentDate"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.paymentDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç»è®°äººï¼" prop="registrant"> |
| | | <el-input |
| | | v-model="form.registrant" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç»è®°æ¥æï¼" prop="registrationtDate"> |
| | | <el-input |
| | | v-model="form.registrationtDate" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-table :data="dialogTableData" border style="width: 100%" max-height="500px"> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="éè´ååå·" prop="purchaseContractNumber" show-overflow-tooltip width="200" /> |
| | | <el-table-column label="ä¾åºååç§°" prop="supplierName" show-overflow-tooltip width="200" /> |
| | | <el-table-column label="å票å·" prop="invoiceNumber" show-overflow-tooltip width="180" /> |
| | | <el-table-column label="å票éé¢(å
)" prop="invoiceAmount" width="150"> |
| | | <template #default="{ row }"> |
| | | {{ row.invoiceAmount ? parseFloat(row.invoiceAmount).toFixed(2) : "0.00" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å¾
仿¬¾éé¢(å
)" prop="unPaymentAmountTotal" width="150"> |
| | | <template #default="{ row }"> |
| | | <el-text type="danger"> |
| | | {{ row.unPaymentAmountTotal ? parseFloat(row.unPaymentAmountTotal).toFixed(2) : "0.00" }} |
| | | </el-text> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ¬æ¬¡ä»æ¬¾éé¢(å
)" width="180"> |
| | | <template #default="scope"> |
| | | <el-input-number |
| | | :step="0.01" |
| | | :min="0" |
| | | :max="Number(scope.row.unPaymentAmountTotal || 0)" |
| | | style="width: 100%" |
| | | :precision="2" |
| | | v-model="scope.row.currentPaymentAmount" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="仿¬¾æ¹å¼" width="150"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.paymentMethod" placeholder="è¯·éæ©" clearable style="width: 100%"> |
| | | <el-option label="çµæ±" value="çµæ±" /> |
| | | <el-option label="æ¿å
" value="æ¿å
" /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="仿¬¾æ¥æ" width="180"> |
| | | <template #default="scope"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="scope.row.paymentDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç»è®°äºº" width="120"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.registrant" placeholder="èªå¨å¡«å
" disabled /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | |
| | | import { ElMessageBox } from "element-plus"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import { |
| | | byPurchaseId, |
| | | paymentRegistrationAdd, |
| | | paymentRegistrationDel, |
| | | paymentRegistrationEdit, |
| | | getTicketNo, |
| | | } from "@/api/procurementManagement/paymentEntry.js"; |
| | | import { |
| | | delPaymentRegistration, |
| | |
| | | total: 0, |
| | | }); |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const operationType = ref(""); |
| | | // å¼¹æ¡æ°æ® |
| | | const dialogFormVisible = ref(false); |
| | | const dialogTableData = ref([]); |
| | | const data = reactive({ |
| | | searchForm: { |
| | | supplierNameOrContractNo: "", |
| | |
| | | currentPaymentAmount: row.currentPaymentAmount, |
| | | paymentMethod: row.paymentMethod, |
| | | }; |
| | | updatePaymentRegistration(updateData).then((res) => { |
| | | // å表ç¼è¾ä¿åææ°ç»æäº¤ï¼ä¸æ¹éç»è®°ä¿æä¸è´ï¼ |
| | | updatePaymentRegistration([updateData]).then(() => { |
| | | row.editType = !row.editType; |
| | | getList(); |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | |
| | | selectedRows.value = selection; |
| | | }; |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = (type, row) => { |
| | | if (selectedRows.value.length !== 1) { |
| | | proxy.$message.error("è¯·éæ©ä¸æ¡åç¥¨æ°æ®"); |
| | | const openForm = () => { |
| | | // è³å°éæ©ä¸æ¡æ°æ® |
| | | if (selectedRows.value.length === 0) { |
| | | proxy.$modal?.msgError ? proxy.$modal.msgError("è¯·éæ©æ°æ®") : proxy.$message.error("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | if (selectedRows.value[0].unPaymentAmountTotal == 0) { |
| | | proxy.$message.warning("æ éå仿¬¾"); |
| | | return; |
| | | } |
| | | operationType.value = type; |
| | | form.value = {}; |
| | | form.value = { ...selectedRows.value[0] }; |
| | | form.value.ticketRegistrationId = selectedRows.value[0].id; |
| | | form.value.id = null; |
| | | // æ¥è¯¢éè´ååå· |
| | | form.value.registrationtDate = getCurrentDate(); |
| | | form.value.paymentDate = getCurrentDate(); |
| | | form.value.registrant = userStore.name; |
| | | |
| | | // æ ¡éªæ¯å¦ä¸ºç¸åä¾åºååç§° |
| | | const firstSupplierName = selectedRows.value[0].supplierName; |
| | | const isSameSupplier = selectedRows.value.every( |
| | | (item) => item.supplierName === firstSupplierName |
| | | ); |
| | | if (!isSameSupplier) { |
| | | proxy.$modal?.msgError |
| | | ? proxy.$modal.msgError("è¯·éæ©ç¸åä¾åºååç§°çæ°æ®è¿è¡ä»æ¬¾ç»è®°") |
| | | : proxy.$message.error("è¯·éæ©ç¸åä¾åºååç§°çæ°æ®è¿è¡ä»æ¬¾ç»è®°"); |
| | | return; |
| | | } |
| | | |
| | | // è¿æ»¤åºæå¾
仿¬¾éé¢çè®°å½ |
| | | const validRows = selectedRows.value.filter( |
| | | (item) => Number(item.unPaymentAmountTotal) > 0 |
| | | ); |
| | | if (validRows.length === 0) { |
| | | proxy.$modal?.msgWarning |
| | | ? proxy.$modal.msgWarning("æéæ°æ®åæ éå仿¬¾") |
| | | : proxy.$message.warning("æéæ°æ®åæ éå仿¬¾"); |
| | | return; |
| | | } |
| | | |
| | | const today = getCurrentDate(); |
| | | dialogTableData.value = validRows.map((row) => { |
| | | return { |
| | | ...row, |
| | | // å端å
³èâæ¥ç¥¨å°è´¦/ç»è®°åâçåæ®µï¼åé»è¾ï¼ticketRegistrationId = row.idï¼ |
| | | ticketRegistrationId: row.id, |
| | | id: null, |
| | | currentPaymentAmount: row.unPaymentAmountTotal || "", |
| | | paymentMethod: "", |
| | | paymentDate: today, |
| | | registrationtDate: today, |
| | | registrant: userStore.nickName || userStore.name, |
| | | }; |
| | | }); |
| | | |
| | | dialogFormVisible.value = true; |
| | | }; |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (operationType.value === "edit") { |
| | | submitEdit(); |
| | | } else { |
| | | submitAdd(); |
| | | } |
| | | } |
| | | // æ ¡éªè¡¨æ ¼æ°æ® |
| | | const invalidRows = dialogTableData.value.filter((row) => { |
| | | return ( |
| | | !row.currentPaymentAmount || |
| | | Number(row.currentPaymentAmount) <= 0 || |
| | | !row.paymentMethod || |
| | | !row.paymentDate |
| | | ); |
| | | }); |
| | | }; |
| | | // æäº¤æ°å¢ |
| | | const submitAdd = () => { |
| | | paymentRegistrationAdd(form.value).then((res) => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | getList(); |
| | | if (invalidRows.length > 0) { |
| | | proxy.$modal?.msgError |
| | | ? proxy.$modal.msgError("请å®åææå¿
填项ï¼ä»æ¬¾éé¢ã仿¬¾æ¹å¼ã仿¬¾æ¥æ") |
| | | : proxy.$message.error("请å®åææå¿
填项ï¼ä»æ¬¾éé¢ã仿¬¾æ¹å¼ã仿¬¾æ¥æ"); |
| | | return; |
| | | } |
| | | |
| | | // æ ¡éªä»æ¬¾éé¢ä¸è½è¶
è¿å¾
仿¬¾éé¢ |
| | | const exceedRows = dialogTableData.value.filter((row) => { |
| | | return Number(row.currentPaymentAmount) > Number(row.unPaymentAmountTotal); |
| | | }); |
| | | }; |
| | | // æäº¤ä¿®æ¹ |
| | | const submitEdit = () => { |
| | | paymentRegistrationEdit(form.value).then((res) => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | getList(); |
| | | if (exceedRows.length > 0) { |
| | | proxy.$modal?.msgError |
| | | ? proxy.$modal.msgError("仿¬¾éé¢ä¸è½è¶
è¿å¾
仿¬¾éé¢") |
| | | : proxy.$message.error("仿¬¾éé¢ä¸è½è¶
è¿å¾
仿¬¾éé¢"); |
| | | return; |
| | | } |
| | | |
| | | // ç»è£
æ°ç»æ¹éæäº¤ï¼å¦æåç«¯ä¸æ¯ææ°ç»ï¼ä¼èµ°å
åºå¾ªç¯æäº¤ï¼ |
| | | const submitDataList = dialogTableData.value.map((row) => { |
| | | return { |
| | | ticketRegistrationId: row.ticketRegistrationId, |
| | | purchaseLedgerId: row.purchaseLedgerId, |
| | | purchaseContractNumber: row.purchaseContractNumber, |
| | | salesContractNo: row.salesContractNo, |
| | | supplierName: row.supplierName, |
| | | invoiceNumber: row.invoiceNumber, |
| | | invoiceAmount: row.invoiceAmount, |
| | | taxRate: row.taxRate, |
| | | currentPaymentAmount: row.currentPaymentAmount, |
| | | paymentMethod: row.paymentMethod, |
| | | paymentDate: row.paymentDate, |
| | | registrant: row.registrant, |
| | | registrationtDate: row.registrationtDate, |
| | | id: null, |
| | | }; |
| | | }); |
| | | |
| | | paymentRegistrationAdd(submitDataList) |
| | | .then(() => { |
| | | proxy.$modal?.msgSuccess |
| | | ? proxy.$modal.msgSuccess("æäº¤æå") |
| | | : proxy.$message.success("æäº¤æå"); |
| | | closeDia(); |
| | | getList(); |
| | | }) |
| | | .catch((e) => { |
| | | console.error("æäº¤å¤±è´¥:", e); |
| | | }); |
| | | }; |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef"); |
| | | dialogTableData.value = []; |
| | | dialogFormVisible.value = false; |
| | | }; |
| | | // å é¤ |
| | |
| | | width: 150, |
| | | }, |
| | | { |
| | | label: "项ç®åç§°", |
| | | prop: "projectName", |
| | | width: 240, |
| | | }, |
| | | { |
| | | label: "ä¾åºååç§°", |
| | | prop: "supplierName", |
| | | width: 240, |
| | |
| | | <el-input v-model="searchForm.salesContractNo" placeholder="请è¾å
¥" clearable prefix-icon="Search" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="项ç®åç§°ï¼"> |
| | | <el-input v-model="searchForm.projectName" placeholder="请è¾å
¥" clearable prefix-icon="Search" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="å½å
¥æ¥æï¼"> |
| | | <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" |
| | | placeholder="è¯·éæ©" clearable @change="changeDaterange" /> |
| | |
| | | label="ä¾åºååç§°" |
| | | width="240" |
| | | prop="supplierName" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="项ç®åç§°" |
| | | prop="projectName" |
| | | width="420" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="项ç®åç§°ï¼" prop="projectName"> |
| | | <el-input |
| | | v-model="form.projectName" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¯å¦å¼ç¥¨" prop="isInvoice"> |
| | | <el-select v-model="form.isInvoice" placeholder="è¯·éæ©" clearable> |
| | | <el-option label="æ¯" value="1" /> |
| | | <el-option label="å¦" value="2" /> |
| | | <el-option label="æ¯" :value="1" /> |
| | | <el-option label="å¦" :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="项ç®åç§°ï¼"> |
| | | <el-input v-model="scanForm.projectName" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ«ç æ¶é´ï¼"> |
| | | <el-input v-model="scanForm.scanTime" disabled /> |
| | | </el-form-item> |
| | |
| | | supplierName: "", // ä¾åºååç§° |
| | | purchaseContractNumber: "", // éè´ååç¼å· |
| | | salesContractNo: "", // éå®ååç¼å· |
| | | projectName: "", // 项ç®åç§° |
| | | entryDate: null, // å½å
¥æ¥æ |
| | | entryDateStart: undefined, |
| | | entryDateEnd: undefined, |
| | |
| | | result.productData.forEach(item => { |
| | | allProductData.push({ |
| | | ...item, |
| | | id: contractId, // æç¡®è®¾ç½®ååID |
| | | // ä¿çåæäº§å idï¼ä¸åè¦çï¼é¢å¤æä¸æå±åå id |
| | | salesLedgerId: contractId, |
| | | salesContractNo: contract.salesContractNo, // æ·»å éå®ååå· |
| | | customerName: contract.customerName, // æ·»å 客æ·åç§° |
| | | customerContractNo: contract.customerContractNo // æ·»å 客æ·ååå· |
| | |
| | | if (valid) { |
| | | // ç»ä¸å°ææååçæ°æ®æ¾å¨ä¸ä¸ªæ°ç»éï¼åä¸ªåæ¹éé½ä½¿ç¨æ°ç»æ ¼å¼ |
| | | const submitData = selectedRows.value.map(contract => { |
| | | // çéåºå±äºå½åååçäº§åæ°æ® |
| | | const contractProductData = productData.value.filter(item => |
| | | // çéåºå±äºå½åååçäº§åæ°æ®ï¼æ ¹æ® salesLedgerId å
³èååï¼ |
| | | const contractProductData = productData.value.filter(item => |
| | | item.salesLedgerId === contract.id |
| | | ); |
| | | |
| | |
| | | <el-dialog |
| | | v-model="dialogFormVisible" |
| | | title="æ°å¢å款页é¢" |
| | | width="70%" |
| | | width="90%" |
| | | @close="closeDia" |
| | | > |
| | | <el-form |
| | | :model="form" |
| | | label-width="140px" |
| | | label-position="top" |
| | | :rules="rules" |
| | | ref="formRef" |
| | | <el-table |
| | | :data="dialogTableData" |
| | | border |
| | | style="width: 100%" |
| | | max-height="500px" |
| | | > |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éå®ååå·ï¼" prop="salesContractNo"> |
| | | <el-input |
| | | v-model="form.salesContractNo" |
| | | placeholder="èªå¨å¡«å
" |
| | | disabled |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column |
| | | label="éå®ååå·" |
| | | prop="salesContractNo" |
| | | show-overflow-tooltip |
| | | width="200" |
| | | /> |
| | | <el-table-column |
| | | label="客æ·åç§°" |
| | | prop="customerName" |
| | | show-overflow-tooltip |
| | | width="200" |
| | | /> |
| | | <el-table-column |
| | | label="产å大类" |
| | | prop="productCategory" |
| | | show-overflow-tooltip |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | label="è§æ ¼åå·" |
| | | prop="specification" |
| | | show-overflow-tooltip |
| | | width="150" |
| | | /> |
| | | <el-table-column |
| | | label="å票å·" |
| | | prop="invoiceNo" |
| | | show-overflow-tooltip |
| | | width="180" |
| | | /> |
| | | <el-table-column |
| | | label="å票éé¢(å
)" |
| | | prop="invoiceTotal" |
| | | show-overflow-tooltip |
| | | :formatter="formattedNumber" |
| | | width="150" |
| | | /> |
| | | <el-table-column |
| | | label="ç¨ç(%)" |
| | | prop="taxRate" |
| | | show-overflow-tooltip |
| | | width="100" |
| | | /> |
| | | <el-table-column |
| | | label="å¾
忬¾éé¢(å
)" |
| | | prop="noReceiptAmount" |
| | | show-overflow-tooltip |
| | | width="150" |
| | | > |
| | | <template #default="{ row }"> |
| | | <el-text type="danger"> |
| | | {{ formattedNumber(row, null, row.noReceiptAmount) }} |
| | | </el-text> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ¬æ¬¡å款éé¢(å
)" width="180"> |
| | | <template #default="scope"> |
| | | <el-input-number |
| | | :step="0.01" |
| | | :min="0" |
| | | :max="scope.row.noReceiptAmount" |
| | | style="width: 100%" |
| | | :precision="2" |
| | | v-model="scope.row.receiptPaymentAmount" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="忬¾æ¹å¼" width="150"> |
| | | <template #default="scope"> |
| | | <el-select |
| | | v-model="scope.row.receiptPaymentType" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in receipt_payment_type" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客æ·åç§°ï¼" prop="customerName"> |
| | | <el-input |
| | | v-model="form.customerName" |
| | | placeholder="èªå¨å¡«å
" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å票å·ï¼" prop="invoiceNo"> |
| | | <el-input |
| | | v-model="form.invoiceNo" |
| | | placeholder="èªå¨å¡«å
" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å票éé¢(å
)ï¼" prop="invoiceTotal"> |
| | | <el-input |
| | | type="number" |
| | | v-model="form.invoiceTotal" |
| | | placeholder="èªå¨å¡«å
" |
| | | :step="0.01" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç¨çï¼" prop="taxRate"> |
| | | <el-input |
| | | type="number" |
| | | v-model="form.taxRate" |
| | | placeholder="èªå¨å¡«å
" |
| | | :step="0.01" |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¬æ¬¡å款éé¢ï¼" prop="receiptPaymentAmount"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" |
| | | :precision="2" |
| | | v-model="form.receiptPaymentAmount" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="忬¾å½¢å¼ï¼" prop="receiptPaymentType"> |
| | | <el-select |
| | | v-model="form.receiptPaymentType" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in receipt_payment_type" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="忬¾æ¥æï¼" prop="receiptPaymentDate"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="form.receiptPaymentDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç»è®°äººï¼" prop="registrant"> |
| | | <el-input |
| | | v-model="form.registrant" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | disabled |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="忬¾æ¥æ" width="180"> |
| | | <template #default="scope"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="scope.row.receiptPaymentDate" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | type="date" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç»è®°äºº" width="120"> |
| | | <template #default="scope"> |
| | | <el-input |
| | | v-model="scope.row.registrant" |
| | | placeholder="èªå¨å¡«å
" |
| | | disabled |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | |
| | | import { |
| | | receiptPaymentSaveOrUpdate, |
| | | bindInvoiceNoRegPage, |
| | | invoiceInfo, |
| | | receiptPaymentHistoryListNoPage, |
| | | receiptPaymentDel, |
| | | } from "../../../api/salesManagement/receiptPayment.js"; |
| | |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const dialogFormVisible = ref(false); |
| | | const dialogTableData = ref([]); |
| | | const data = reactive({ |
| | | searchForm: { |
| | | searchText: "", |
| | |
| | | }; |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = () => { |
| | | form.value = {}; |
| | | if (selectedRows.value.length !== 1) { |
| | | proxy.$modal.msgError("è¯·éæ©ä¸æ¡æ°æ®"); |
| | | // è³å°éæ©ä¸æ¡æ°æ® |
| | | if (selectedRows.value.length === 0) { |
| | | proxy.$modal.msgError("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | if (selectedRows.value[0].noReceiptAmount == 0) { |
| | | proxy.$modal.msgWarning("æ éå忬¾"); |
| | | |
| | | // æ ¡éªæ¯å¦ä¸ºç¸åéå®ååå· |
| | | const firstContractNo = selectedRows.value[0].salesContractNo; |
| | | const isSameContract = selectedRows.value.every( |
| | | (item) => item.salesContractNo === firstContractNo |
| | | ); |
| | | if (!isSameContract) { |
| | | proxy.$modal.msgError("è¯·éæ©ç¸åéå®ååå·çæ°æ®è¿è¡å款"); |
| | | return; |
| | | } |
| | | invoiceInfo({ id: selectedRows.value[0].id }).then((res) => { |
| | | form.value = { ...res.data }; |
| | | form.value.invoiceLedgerId = form.value.id; |
| | | form.value.id = ""; |
| | | form.value.registrant = userStore.nickName; |
| | | |
| | | // è¿æ»¤åºæå¾
忬¾éé¢çè®°å½ |
| | | const validRows = selectedRows.value.filter( |
| | | (item) => Number(item.noReceiptAmount) > 0 |
| | | ); |
| | | if (validRows.length === 0) { |
| | | proxy.$modal.msgWarning("æéæ°æ®åæ éå忬¾"); |
| | | return; |
| | | } |
| | | |
| | | // ç´æ¥ä½¿ç¨å¤é¨è¡¨æ ¼æ°æ®ï¼ä¸ºæ¯æ¡è®°å½æ·»å 忬¾ç¸å
³å段 |
| | | dialogTableData.value = validRows.map((row) => { |
| | | return { |
| | | ...row, |
| | | invoiceLedgerId: row.id, |
| | | receiptPaymentAmount: row.noReceiptAmount || "", |
| | | receiptPaymentType: "", |
| | | receiptPaymentDate: "", |
| | | registrant: userStore.nickName, |
| | | }; |
| | | }); |
| | | |
| | | dialogFormVisible.value = true; |
| | | }; |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate((valid) => { |
| | | if (valid) { |
| | | receiptPaymentSaveOrUpdate(form.value).then((res) => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | getList(); |
| | | }); |
| | | } |
| | | // æ ¡éªè¡¨æ ¼æ°æ® |
| | | const invalidRows = dialogTableData.value.filter((row) => { |
| | | return ( |
| | | !row.receiptPaymentAmount || |
| | | row.receiptPaymentAmount <= 0 || |
| | | !row.receiptPaymentType || |
| | | !row.receiptPaymentDate |
| | | ); |
| | | }); |
| | | |
| | | if (invalidRows.length > 0) { |
| | | proxy.$modal.msgError("请å®åææå¿
填项ï¼å款éé¢ã忬¾æ¹å¼ã忬¾æ¥æ"); |
| | | return; |
| | | } |
| | | |
| | | // æ ¡éªå款éé¢ä¸è½è¶
è¿å¾
忬¾éé¢ |
| | | const exceedRows = dialogTableData.value.filter((row) => { |
| | | return Number(row.receiptPaymentAmount) > Number(row.noReceiptAmount); |
| | | }); |
| | | |
| | | if (exceedRows.length > 0) { |
| | | proxy.$modal.msgError("忬¾éé¢ä¸è½è¶
è¿å¾
忬¾éé¢"); |
| | | return; |
| | | } |
| | | |
| | | // ç»åææ°ç»æ¹éæäº¤ |
| | | const submitDataList = dialogTableData.value.map((row) => { |
| | | return { |
| | | invoiceLedgerId: row.invoiceLedgerId, |
| | | receiptPaymentAmount: row.receiptPaymentAmount, |
| | | receiptPaymentType: row.receiptPaymentType, |
| | | receiptPaymentDate: row.receiptPaymentDate, |
| | | registrant: row.registrant, |
| | | }; |
| | | }); |
| | | |
| | | receiptPaymentSaveOrUpdate(submitDataList) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | getList(); |
| | | }) |
| | | .catch((error) => { |
| | | console.error("æäº¤å¤±è´¥:", error); |
| | | proxy.$modal.msgError("æäº¤å¤±è´¥ï¼è¯·éè¯"); |
| | | }); |
| | | }; |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef"); |
| | | dialogTableData.value = []; |
| | | dialogFormVisible.value = false; |
| | | }; |
| | | |
| | |
| | | receiptPaymentType: row.receiptPaymentType, |
| | | receiptPaymentAmount: row.receiptPaymentAmount, |
| | | }; |
| | | receiptPaymentSaveOrUpdate(updateData).then((res) => { |
| | | // å表ç¼è¾ä¿å乿æ°ç»æäº¤ï¼ä¸æ¹éæ°å¢ä¿æä¸è´ï¼ |
| | | receiptPaymentSaveOrUpdate([updateData]).then((res) => { |
| | | row.editType = !row.editType; |
| | | getList(); |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | |
| | | prop: "receiptPaymentType", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (params == 0) { |
| | | return "çµæ±"; |
| | | } else if (params == 1) { |
| | | return "æ¿å
"; |
| | | } else { |
| | | return null; |
| | | } |
| | | const dictItem = receipt_payment_type.value?.find( |
| | | (item) => item.value == params |
| | | ); |
| | | return dictItem ? dictItem.label : null; |
| | | }, |
| | | formatType: (params) => { |
| | | return "info"; |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¯å¦å¼ç¥¨" prop="isInvoice"> |
| | | <el-select v-model="form.isInvoice" placeholder="è¯·éæ©" clearable> |
| | | <el-option label="æ¯" value="1" /> |
| | | <el-option label="å¦" value="2" /> |
| | | <el-option label="æ¯" :value="1" /> |
| | | <el-option label="å¦" :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |