¶Ô±ÈÐÂÎļþ |
| | |
| | | // å®¢æ·æ¡£æ¡é¡µé¢æ¥å£ |
| | | import request from '@/utils/request' |
| | | |
| | | // å页æ¥è¯¢ |
| | | export function listCustomer(query) { |
| | | return request({ |
| | | url: '/basic/customer/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | // æ¥è¯¢å®¢æ·æ¡£æ¡è¯¦ç» |
| | | export function getCustomer(id) { |
| | | return request({ |
| | | url: '/basic/customer/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | // æ°å¢å®¢æ·æ¡£æ¡ |
| | | export function addCustomer(data) { |
| | | return request({ |
| | | url: '/basic/customer/addCustomer', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | // ä¿®æ¹å®¢æ·æ¡£æ¡ |
| | | export function updateCustomer(data) { |
| | | return request({ |
| | | url: '/basic/customer/updateCustomer', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | // 导åºå®¢æ·æ¡£æ¡ |
| | | export function exportCustomer(query) { |
| | | return request({ |
| | | url: '/basic/customer/export', |
| | | method: 'get', |
| | | params: query, |
| | | responseType: 'blob' |
| | | }) |
| | | } |
| | | // å é¤å®¢æ·æ¡£æ¡ |
| | | export function delCustomer(ids) { |
| | | return request({ |
| | | url: '/basic/customer/delCustomer', |
| | | method: 'delete', |
| | | data: ids |
| | | }) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // éå®å°è´¦é¡µé¢æ¥å£ |
| | | import request from '@/utils/request' |
| | | |
| | | // å页æ¥è¯¢ |
| | | export function ledgerList(query) { |
| | | return request({ |
| | | url: '/sales/ledger/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | method: 'get'
|
| | | })
|
| | | }
|
| | | // æ¥è¯¢ç¨æ·å表
|
| | | export function userListNoPage() {
|
| | | return request({
|
| | | url: '/system/user/userListNoPage',
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
| | | left: 0;
|
| | | position: relative;
|
| | | margin: 0 auto;
|
| | | border-radius: 8px;
|
| | | padding: 0 !important;
|
| | | }
|
| | | .el-dialog__header {
|
| | | background: #F5F6F7;
|
| | | padding: 12px 16px;
|
| | | border-radius: 8px 8px 0 0;
|
| | | }
|
| | | .el-dialog__title {
|
| | | font-weight: 400;
|
| | | font-size: 16px;
|
| | | color: #2E3033;
|
| | | }
|
| | | .el-dialog__body {
|
| | | padding: 16px 40px 0 40px;
|
| | | }
|
| | | .el-dialog__footer {
|
| | | text-align: center;
|
| | | padding: 16px;
|
| | | }
|
| | | .el-message-box {
|
| | | padding: 0 !important;
|
| | | border-radius: 8px;
|
| | | }
|
| | | .el-message-box__header {
|
| | | background: #F5F6F7;
|
| | | padding: 12px 16px;
|
| | | border-radius: 8px 8px 0 0;
|
| | | }
|
| | | .el-message-box__title {
|
| | | font-weight: 400;
|
| | | font-size: 16px;
|
| | | color: #2E3033;
|
| | | }
|
| | | .el-message-box__content {
|
| | | padding: 16px 40px 0 40px;
|
| | | }
|
| | | .el-message-box__container {
|
| | | justify-content: center;
|
| | | }
|
| | | .el-message-box__btns {
|
| | | text-align: center;
|
| | | padding: 16px;
|
| | | display: flex;
|
| | | flex-direction: row-reverse;
|
| | | justify-content: center;
|
| | | align-items: center;
|
| | | .el-button--primary {
|
| | | margin-right: 12px;
|
| | | }
|
| | | }
|
| | | .el-table__expanded-cell {
|
| | | padding: 0 !important;
|
| | | .el-table__header-wrapper {
|
| | | background-color: #F5F8FF !important;
|
| | | }
|
| | | }
|
| | |
|
| | | // refine element ui upload
|
| | |
| | | overflow: auto;
|
| | | overflow-x: hidden;
|
| | | max-height: 70vh;
|
| | | padding: 10px 20px 0;
|
| | | }
|
| | |
|
| | | .el-table {
|
| | | .el-table__header-wrapper, .el-table__fixed-header-wrapper {
|
| | | th {
|
| | | word-break: break-word;
|
| | | background-color: #f8f8f9 !important;
|
| | | background-color: #F0F1F5 !important;
|
| | | color: #515a6e;
|
| | | height: 40px !important;
|
| | | font-size: 13px;
|
| | |
| | | /** è¡¨æ ¼æ´å¤æä½ä¸ææ ·å¼ */
|
| | | .el-table .el-dropdown-link {
|
| | | cursor: pointer;
|
| | | color: #3472D7;
|
| | | color: #2C51D9;
|
| | | margin-left: 10px;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | .el-table__header-wrapper, .el-table__fixed-header-wrapper {
|
| | | th {
|
| | | background-color: var(--el-bg-color-overlay, #f8f8f9) !important;
|
| | | background-color: var(--el-bg-color-overlay, #F0F1F5) !important;
|
| | | color: var(--el-text-color-regular, #515a6e);
|
| | | }
|
| | | }
|
| | |
| | | <template> |
| | | <el-table ref="multipleTable" v-loading="tableLoading" :border="border" :data="tableData" |
| | | :header-cell-style="{ background: '#F0F1F5', color: '#333333' }" :height="height" |
| | | :highlight-current-row="highlightCurrentRow" :row-class-name="rowClassName" :row-style="rowStyle" |
| | | :row-key="rowKey" :span-method="spanMethod" stripe style="width: 100%" tooltip-effect="dark" @row-click="rowClick" |
| | | @current-change="currentChange" @selection-change="handleSelectionChange" class="lims-table"> |
| | | <el-table-column align="center" type="selection" width="55" v-if="isSelection" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" :index="indexMethod" /> |
| | | |
| | | :header-cell-style="{ background: '#F0F1F5', color: '#333333' }" height="calc(100vh - 18.5em)" |
| | | :highlight-current-row="highlightCurrentRow" :row-class-name="rowClassName" :row-style="rowStyle" :row-key="rowKey" |
| | | style="width: 100%" tooltip-effect="dark" @row-click="rowClick" @current-change="currentChange" |
| | | @selection-change="handleSelectionChange" class="lims-table"> |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | |
| | | <el-table-column v-for="(item, index) in column" :key="index" :column-key="item.columnKey" |
| | | :filter-method="item.filterHandler" :filter-multiple="item.filterMultiple" :filtered-value="item.filteredValue" |
| | | :filters="item.filters" :fixed="item.fixed" :label="item.label" :prop="item.prop" |
| | | :show-overflow-tooltip="!(item.dataType === 'action' || item.dataType === 'slot')" |
| | | :min-width="item.dataType == 'action' ? btnWidth : item.width" |
| | | :sortable="!!item.sortable" :type="item.type" :width="item.dataType == 'action' ? btnWidth : item.width" align="center"> |
| | | :filter-method="item.filterHandler" :filter-multiple="item.filterMultiple" :filtered-value="item.filteredValue" |
| | | :filters="item.filters" :fixed="item.fixed" :label="item.label" :prop="item.prop" show-overflow-tooltip |
| | | :align="item.align" :sortable="!!item.sortable" :type="item.type" :width="item.width"> |
| | | <template v-if="item.hasOwnProperty('colunmTemplate')" #[item.colunmTemplate]="scope"> |
| | | <slot v-if="item.theadSlot" :name="item.theadSlot" :index="scope.$index" :row="scope.row" /> |
| | | </template> |
| | | |
| | | |
| | | <template #default="scope"> |
| | | <!-- ææ§½ --> |
| | | <div v-if="item.dataType == 'slot'"> |
| | |
| | | </div> |
| | | <!-- å¾ç --> |
| | | <div v-else-if="item.dataType == 'image'"> |
| | | <img :src="javaApi + '/img/' + scope.row[item.prop]" alt="" style="width: 40px; height: 40px; margin-top: 10px" /> |
| | | <img :src="javaApi + '/img/' + scope.row[item.prop]" alt="" |
| | | style="width: 40px; height: 40px; margin-top: 10px" /> |
| | | </div> |
| | | |
| | | |
| | | <!-- tag --> |
| | | <div v-else-if="item.dataType == 'tag'"> |
| | | <el-tag v-if="typeof dataTypeFn(scope.row[item.prop], item.formatData) === 'string'" |
| | | :title="formatters(scope.row[item.prop], item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)"> |
| | | :title="formatters(scope.row[item.prop], item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)"> |
| | | {{ formatters(scope.row[item.prop], item.formatData) }} |
| | | </el-tag> |
| | | |
| | | |
| | | <el-tag v-for="(tag, index) in dataTypeFn(scope.row[item.prop], item.formatData)" |
| | | v-else-if="typeof dataTypeFn(scope.row[item.prop], item.formatData) === 'object'" |
| | | :key="index" :title="formatters(scope.row[item.prop], item.formatData)" :type="formatType(tag, item.formatType)"> |
| | | v-else-if="typeof dataTypeFn(scope.row[item.prop], item.formatData) === 'object'" :key="index" |
| | | :title="formatters(scope.row[item.prop], item.formatData)" :type="formatType(tag, item.formatType)"> |
| | | {{ item.tagGroup ? tag[item.tagGroup.label] ?? tag : tag }} |
| | | </el-tag> |
| | | |
| | | <el-tag v-else :title="formatters(scope.row[item.prop], item.formatData)" :type="formatType(scope.row[item.prop], item.formatType)"> |
| | | |
| | | <el-tag v-else :title="formatters(scope.row[item.prop], item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)"> |
| | | {{ formatters(scope.row[item.prop], item.formatData) }} |
| | | </el-tag> |
| | | </div> |
| | | |
| | | |
| | | <!-- æé® --> |
| | | <div v-else-if="item.dataType == 'action'" |
| | | :style="`min-width:${getWidth(item.operation, scope.row)}`"> |
| | | <div v-else-if="item.dataType == 'action'"> |
| | | <template v-for="(o, key) in item.operation" :key="key"> |
| | | <el-button v-show="o.type != 'upload'" size="small" v-if="o.showHide ? o.showHide(scope.row) : true" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" :plain="o.plain" |
| | | :style="{ color: (o.name === 'å é¤' || o.name === 'delete') ? '#f56c6c' : o.color }" :type="typeFn(o.type, scope.row)" |
| | | @click="o.clickFun(scope.row)" :key="key"> |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" :plain="o.plain" type="primary" |
| | | :style="{ color: (o.name === 'å é¤' || o.name === 'delete') ? '#f56c6c' : o.color }" link |
| | | @click="o.clickFun(scope.row)" :key="key"> |
| | | {{ o.name }} |
| | | </el-button> |
| | | <el-upload :action="javaApi + o.url + '?id=' + (o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id)" |
| | | ref="uploadRef" size="small" :multiple="o.multiple ? o.multiple : false" :limit="1" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" |
| | | :accept="o.accept ? o.accept : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'" |
| | | v-if="o.type == 'upload'" style="display: inline-block; width: 50px" |
| | | v-show="o.showHide ? o.showHide(scope.row) : true" :headers="uploadHeader" |
| | | :before-upload="(file) => beforeUpload(file, scope.$index)" |
| | | :on-change="(file, fileList) => handleChange(file, fileList, scope.$index)" |
| | | :on-error="(error, file, fileList) => onError(error, file, fileList, scope.$index)" |
| | | :on-success="(response, file, fileList) => handleSuccessUp(response, file, fileList, scope.$index)" |
| | | :on-exceed="onExceed" :show-file-list="false"> |
| | | <el-button :size="o.size ? o.size : 'small'" type="text" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false">{{ o.name }}</el-button> |
| | | ref="uploadRef" size="small" :multiple="o.multiple ? o.multiple : false" :limit="1" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" |
| | | :accept="o.accept ? o.accept : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'" |
| | | v-if="o.type == 'upload'" style="display: inline-block; width: 50px" |
| | | v-show="o.showHide ? o.showHide(scope.row) : true" :headers="uploadHeader" |
| | | :before-upload="(file) => beforeUpload(file, scope.$index)" |
| | | :on-change="(file, fileList) => handleChange(file, fileList, scope.$index)" |
| | | :on-error="(error, file, fileList) => onError(error, file, fileList, scope.$index)" |
| | | :on-success="(response, file, fileList) => handleSuccessUp(response, file, fileList, scope.$index)" |
| | | :on-exceed="onExceed" :show-file-list="false"> |
| | | <el-button :size="o.size ? o.size : 'small'" link type="primary" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false">{{ o.name }}</el-button> |
| | | </el-upload> |
| | | </template> |
| | | </div> |
| | | <!-- å¯ç¹å»çæå --> |
| | | <div v-else-if="item.dataType == 'link'" class="cell link" style="width: 100%" |
| | | @click="goLink(scope.row, item.linkMethod)"> |
| | | @click="goLink(scope.row, item.linkMethod)"> |
| | | <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span> |
| | | </div> |
| | | <!-- é»è®¤çº¯å±ç¤ºæ°æ® --> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination v-show="page.total > 0" :total="page.total" :layout="page.layout" :page="page.current" |
| | | :limit="page.size" @pagination="paginationSearch" /> |
| | | <pagination v-show="total > 0" :total="total" :layout="page.layout" :page="page.current" :limit="page.size" |
| | | @pagination="paginationSearch" /> |
| | | </template> |
| | | |
| | | <script setup> |
| | |
| | | const uploadHeader = proxy.uploadHeader |
| | | const javaApi = proxy.javaApi |
| | | |
| | | const emit = defineEmits(["pagination"]); |
| | | |
| | | // Filters |
| | | const typeFn = (val, row) => { |
| | | return typeof val === 'function' ? val(row) : val |
| | |
| | | |
| | | // Propsï¼ä½¿ç¨ defineProps çé TS å½¢å¼ï¼ |
| | | const props = defineProps({ |
| | | isSelection: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | height: { |
| | | type: [String, null], |
| | | default: null |
| | | }, |
| | | tableLoading: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | handleSelectionChange: { |
| | | type: Function, |
| | | default: () => {} |
| | | default: () => { } |
| | | }, |
| | | rowClick: { |
| | | type: Function, |
| | | default: () => {} |
| | | default: () => { } |
| | | }, |
| | | currentChange: { |
| | | type: Function, |
| | | default: () => {} |
| | | default: () => { } |
| | | }, |
| | | border: { |
| | | type: Boolean, |
| | |
| | | size: 10, |
| | | layout: 'total, sizes, prev, pager, next, jumper' |
| | | }) |
| | | }, |
| | | total: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }) |
| | | |
| | | // Data |
| | | const spanList = ref([]) |
| | | const btnWidth = ref('120px') |
| | | const uploadRefs = ref([]) |
| | | const currentFiles = ref({}) |
| | | const uploadKeys = ref({}) |
| | | |
| | | // åå¹¶åå
æ ¼æ¹æ³ |
| | | const spanMethod = ({ row, column, rowIndex, columnIndex }) => { |
| | | if (column.find((m) => m.mergeCol)) { |
| | | let i = Number(rowIndex) |
| | | const obj = spanList.value.find((item, index) => { |
| | | i = index |
| | | return item.index == columnIndex |
| | | }) |
| | | if (obj) { |
| | | const _row = spanList[i].arr[rowIndex] |
| | | const _col = _row > 0 ? 1 : 0 |
| | | return { |
| | | rowspan: _row, |
| | | colspan: _col |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | const indexMethod = (index) => { |
| | | return (props.page.current - 1) * props.page.size + index + 1 |
| | | } |
| | | |
| | | const getWidth = (row, row0) => { |
| | | let count = 0 |
| | | row.forEach((a) => { |
| | | if (a.showHide !== undefined && a.showHide(row0)) { |
| | | count += a.name.length |
| | | } else if (!a.showHide) { |
| | | count += a.name.length |
| | | } |
| | | }) |
| | | btnWidth.value = count * 15 + 60 + "px" |
| | | return count * 15 + 60 + "px" |
| | | } |
| | | |
| | | // ç¹å» link äºä»¶ |
| | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | :deep(.cell) { |
| | | padding: 0 !important; |
| | | } |
| | | |
| | | .cell { |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | padding-right: 0 !important; |
| | | padding-left: 0 !important; |
| | | } |
| | | </style> |
| | |
| | | <style scoped> |
| | | .pagination-container { |
| | | background: #fff; |
| | | padding: 28px 16px; |
| | | margin-top: 10px; |
| | | padding: 16px 0; |
| | | margin-top: 0; |
| | | } |
| | | .pagination-container.hidden { |
| | | display: none; |
| | |
| | | // æ¯æ largeãdefaultãsmall
|
| | | size: Cookies.get('size') || 'default'
|
| | | })
|
| | | app._context.components.ElDialog.props.closeOnClickModal.default = false
|
| | |
|
| | | app.mount('#app')
|
| | |
| | | {
|
| | | state: () => ({
|
| | | title: '',
|
| | | theme: storageSetting.theme || '#3472D7',
|
| | | theme: storageSetting.theme || '#2C51D9',
|
| | | sideTheme: storageSetting.sideTheme || sideTheme,
|
| | | showSettings: showSettings,
|
| | | topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
|
| | |
| | | <div> |
| | | <span class="search_title">客æ·åç§°ï¼</span> |
| | | <el-input |
| | | v-model="input2" |
| | | v-model="searchForm.customerName" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | /> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">æç´¢</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary">æ°å¢å®¢æ·</el-button> |
| | | <el-button>导åº</el-button> |
| | | <el-button type="danger" plain>å é¤</el-button> |
| | | <el-button type="primary" @click="openForm('add')">æ°å¢å®¢æ·</el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <PIMTable :column="tableColumn"></PIMTable> |
| | | <PIMTable :column="tableColumn" :tableData="tableData" :page="page" :handleSelectionChange="handleSelectionChange" |
| | | :tableLoading="tableLoading" @pagination="pagination" :total="total"></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="contactPerson"> |
| | | <el-input v-model="form.contactPerson" placeholder="请è¾å
¥" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="èç³»çµè¯ï¼" prop="contactPhone"> |
| | | <el-input v-model="form.contactPhone" placeholder="请è¾å
¥" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç»´æ¤äººï¼" prop="maintainer"> |
| | | <el-select v-model="form.maintainer" placeholder="è¯·éæ©" clearable> |
| | | <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> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref } from 'vue' |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {addCustomer, delCustomer, getCustomer, listCustomer, updateCustomer} from "@/api/basicData/customerFile.js"; |
| | | import {ElMessageBox } from "element-plus"; |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | | const input2 = ref('') |
| | | const tableColumn = ref([ |
| | | { |
| | | label: 'æ¹åå
容', |
| | | prop: 'ratifyRemark' |
| | | }, { |
| | | label: 'æ¹å人', |
| | | prop: 'ratifyName', |
| | | label: '客æ·åç§°', |
| | | prop: 'customerName', |
| | | }, |
| | | { |
| | | label: '纳ç¨äººè¯å«ç ', |
| | | prop: 'taxpayerIdentificationNumber' |
| | | }, |
| | | { |
| | | label: 'å°ååèç³»æ¹å¼', |
| | | prop: 'addressPhone' |
| | | }, |
| | | { |
| | | label: 'è系人', |
| | | prop: 'contactPerson' |
| | | }, |
| | | { |
| | | label: 'èç³»çµè¯', |
| | | prop: 'contactPhone', |
| | | }, |
| | | { |
| | | label: 'ç»´æ¤äºº', |
| | | prop: 'maintainer', |
| | | }, |
| | | { |
| | | label: 'ç»´æ¤æ¶é´', |
| | | prop: 'maintenanceTime', |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | | align: 'center', |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openForm('edit', row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]) |
| | | const tableData = ref([]) |
| | | const selectedRows = ref([]) |
| | | const userList = ref([]) |
| | | const tableLoading = ref(false) |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | }) |
| | | const total = ref(0) |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const operationType = ref('') |
| | | const dialogFormVisible = ref(false) |
| | | const data = reactive({ |
| | | searchForm: { |
| | | customerName: '', |
| | | }, |
| | | form: { |
| | | customerName: '', |
| | | taxpayerIdentificationNumber: '', |
| | | companyAddress: '', |
| | | companyPhone: '', |
| | | contactPerson: '', |
| | | contactPhone: '', |
| | | maintainer: '', |
| | | maintenanceTime: '', |
| | | }, |
| | | 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" }], |
| | | } |
| | | }) |
| | | const { searchForm, form, rules } = toRefs(data) |
| | | |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | const pagination = ({ current, limit }) => { |
| | | page.current = current; |
| | | page.size = limit; |
| | | getList() |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | listCustomer({...searchForm.value, ...page}).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.rows |
| | | total.value = res.total |
| | | }) |
| | | } |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection |
| | | } |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = (type, row) => { |
| | | operationType.value = type |
| | | form.value = {} |
| | | userListNoPage().then(res => { |
| | | userList.value = res.data |
| | | }) |
| | | if (type === 'edit') { |
| | | getCustomer(row.id).then(res => { |
| | | form.value = {...res.data} |
| | | }) |
| | | } |
| | | dialogFormVisible.value = true |
| | | } |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | if (operationType.value === "edit") { |
| | | submitEdit() |
| | | } else { |
| | | submitAdd() |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | // æäº¤æ°å¢ |
| | | const submitAdd = () => { |
| | | addCustomer(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå") |
| | | closeDia() |
| | | getList() |
| | | }) |
| | | } |
| | | // æäº¤ä¿®æ¹ |
| | | const submitEdit = () => { |
| | | updateCustomer(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå") |
| | | closeDia() |
| | | getList() |
| | | }) |
| | | } |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef") |
| | | dialogFormVisible.value = false |
| | | } |
| | | // å¯¼åº |
| | | 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) { |
| | | 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("已忶") |
| | | }) |
| | | } |
| | | getList() |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | |
| | | .title {
|
| | | margin: 20px auto 14px auto;
|
| | | text-align: center;
|
| | | color: #3472D7;
|
| | | color: #2C51D9;
|
| | | font-size: 28px;
|
| | | font-weight: 700;
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title">客æ·åç§°ï¼</span> |
| | | <el-input |
| | | v-model="searchForm.customerName" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | /> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">æç´¢</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm('add')">æ°å¢å°è´¦</el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <el-table :data="tableData" border :preserve-expanded-content="preserveExpanded" v-loading="tableLoading" |
| | | @selection-change="handleSelectionChange" @expand-change="expandChange" |
| | | height="calc(100vh - 18.5em)"> |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column type="expand"> |
| | | <template #default="props"> |
| | | <el-table :data="props.row.children" border> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="产å大类" prop="productCategory" /> |
| | | <el-table-column label="è§æ ¼åå·" prop="specificationModel" /> |
| | | <el-table-column label="åä½" prop="unit" /> |
| | | <el-table-column label="æ°é" prop="quantity" /> |
| | | <el-table-column label="ç¨ç" prop="taxRate" /> |
| | | <el-table-column label="å«ç¨åä»·(å
)" prop="taxInclusiveUnitPrice" /> |
| | | <el-table-column label="å«ç¨æ»ä»·(å
)" prop="taxInclusiveTotalPrice" /> |
| | | <el-table-column label="ä¸å«ç¨æ»ä»·(å
)" prop="taxExclusiveTotalPrice" /> |
| | | </el-table> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column label="éå®ååå·" prop="salesContractNo" show-overflow-tooltip/> |
| | | <el-table-column label="客æ·ååå·" prop="customerContractNo" show-overflow-tooltip/> |
| | | <el-table-column label="客æ·åç§°" prop="customerName" show-overflow-tooltip/> |
| | | <el-table-column label="ä¸å¡å" prop="salesman" show-overflow-tooltip/> |
| | | <el-table-column label="项ç®åç§°" prop="projectName" show-overflow-tooltip/> |
| | | <el-table-column label="å½å
¥äºº" prop="entryPerson" show-overflow-tooltip/> |
| | | <el-table-column label="å½å
¥æ¥æ" prop="entryDate" show-overflow-tooltip/> |
| | | <el-table-column fixed="right" label="æä½" min-width="60" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">ç¼è¾</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" :page="page.current" |
| | | :limit="page.size" @pagination="paginationChange" /> |
| | | </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="contactPerson"> |
| | | <el-input v-model="form.contactPerson" placeholder="请è¾å
¥" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="èç³»çµè¯ï¼" prop="contactPhone"> |
| | | <el-input v-model="form.contactPhone" placeholder="请è¾å
¥" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç»´æ¤äººï¼" prop="maintainer"> |
| | | <el-select v-model="form.maintainer" placeholder="è¯·éæ©" clearable> |
| | | <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> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import pagination from '@/components/PIMTable/Pagination.vue' |
| | | import { ref } from 'vue' |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {addCustomer, delCustomer, getCustomer, listCustomer, updateCustomer} from "@/api/basicData/customerFile.js"; |
| | | import {ElMessageBox } from "element-plus"; |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | import {ledgerList} from "@/api/salesManagement/salesLedger.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | const preserveExpanded = ref(false) |
| | | const tableData = ref([]) |
| | | const selectedRows = ref([]) |
| | | const userList = ref([]) |
| | | const tableLoading = ref(false) |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | }) |
| | | const total = ref(0) |
| | | |
| | | // ç¨æ·ä¿¡æ¯è¡¨åå¼¹æ¡æ°æ® |
| | | const operationType = ref('') |
| | | const dialogFormVisible = ref(false) |
| | | const data = reactive({ |
| | | searchForm: { |
| | | customerName: '', |
| | | }, |
| | | form: { |
| | | customerName: '', |
| | | taxpayerIdentificationNumber: '', |
| | | companyAddress: '', |
| | | companyPhone: '', |
| | | contactPerson: '', |
| | | contactPhone: '', |
| | | maintainer: '', |
| | | maintenanceTime: '', |
| | | }, |
| | | 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" }], |
| | | } |
| | | }) |
| | | const { searchForm, form, rules } = toRefs(data) |
| | | |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | const paginationChange = ({ current, limit }) => { |
| | | page.current = current; |
| | | page.size = limit; |
| | | getList() |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | ledgerList({...searchForm.value, ...page}).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.rows |
| | | total.value = res.total |
| | | }) |
| | | } |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection |
| | | } |
| | | // å±å¼è¡ |
| | | const expandChange = (row, expandedRows) => { |
| | | const isExpanded = expandedRows.includes(row.id); |
| | | if (isExpanded) { |
| | | console.log('该è¡å·²å±å¼'); |
| | | // å¯ä»¥å¨è¿éè¿è¡æå è½½æå
¶ä»æä½ |
| | | } else { |
| | | console.log('该è¡å·²æ¶èµ·'); |
| | | } |
| | | } |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = (type, row) => { |
| | | operationType.value = type |
| | | form.value = {} |
| | | userListNoPage().then(res => { |
| | | userList.value = res.data |
| | | }) |
| | | if (type === 'edit') { |
| | | getCustomer(row.id).then(res => { |
| | | form.value = {...res.data} |
| | | }) |
| | | } |
| | | dialogFormVisible.value = true |
| | | } |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | if (operationType.value === "edit") { |
| | | submitEdit() |
| | | } else { |
| | | submitAdd() |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | // æäº¤æ°å¢ |
| | | const submitAdd = () => { |
| | | addCustomer(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå") |
| | | closeDia() |
| | | getList() |
| | | }) |
| | | } |
| | | // æäº¤ä¿®æ¹ |
| | | const submitEdit = () => { |
| | | updateCustomer(form.value).then(res => { |
| | | proxy.$modal.msgSuccess("æäº¤æå") |
| | | closeDia() |
| | | getList() |
| | | }) |
| | | } |
| | | // å
³éå¼¹æ¡ |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef") |
| | | dialogFormVisible.value = false |
| | | } |
| | | // å¯¼åº |
| | | 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) { |
| | | ids = selectedRows.value.map(item => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning('è¯·éæ©æ°æ®') |
| | | return |
| | | } |
| | | ElMessageBox.confirm( |
| | | 'éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼', |
| | | '导åº', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | delCustomer(ids).then(res => { |
| | | proxy.$modal.msgSuccess("å 餿å") |
| | | }) |
| | | getList() |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已忶") |
| | | }) |
| | | } |
| | | getList() |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | |
| | | </style> |
| | |
| | | </script>
|
| | |
|
| | | <style lang='scss'>
|
| | | $lighterBlue: #3472D7;
|
| | | $lighterBlue: #2C51D9;
|
| | |
|
| | | .container {
|
| | | position: relative;
|