¶Ô±ÈÐÂÎļþ |
| | |
| | | // 设å¤ç®¡ç |
| | | import request from '@/utils/request' |
| | | |
| | | // /equipmentManagement/list |
| | | // æ¥è¯¢è®¾å¤ç®¡çå表 |
| | | export function getManagementList(query) { |
| | | return request({ |
| | | url: '/equipmentManagement/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // /equipmentManagement/addOrEditEquipment |
| | | // æ·»å æç¼è¾è®¾å¤ |
| | | export function addOrEditEquipment(data) { |
| | | return request({ |
| | | url: '/equipmentManagement/addOrEditEquipment', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // /equipmentManagement/delEquipment |
| | | // å é¤è®¾å¤ |
| | | export function delEquipment(data) { |
| | | return request({ |
| | | url: '/equipmentManagement/delEquipment', |
| | | method: 'delete', |
| | | data |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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" |
| | | style="width: 100%" |
| | | tooltip-effect="dark" |
| | | :expand-row-keys="expandRowKeys" |
| | | :show-summary="isShowSummary" |
| | | :summary-method="summaryMethod" |
| | | @row-click="rowClick" |
| | | @current-change="currentChange" |
| | | @selection-change="handleSelectionChange" |
| | | @expand-change="expandChange" |
| | | 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" /> |
| | | |
| | | <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 |
| | | :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'"> |
| | | <slot |
| | | v-if="item.slot" |
| | | :index="scope.$index" |
| | | :name="item.slot" |
| | | :row="scope.row" |
| | | /> |
| | | </div> |
| | | <!-- è¿åº¦æ¡ --> |
| | | <div v-else-if="item.dataType == 'progress'"> |
| | | <el-progress :percentage="Number(scope.row[item.prop])" /> |
| | | </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" |
| | | /> |
| | | </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)" |
| | | > |
| | | {{ 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)" |
| | | > |
| | | {{ 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)" |
| | | > |
| | | {{ formatters(scope.row[item.prop], item.formatData) }} |
| | | </el-tag> |
| | | </div> |
| | | |
| | | <!-- æé® --> |
| | | <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" |
| | | 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'" |
| | | 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)" |
| | | > |
| | | <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span> |
| | | </div> |
| | | <!-- é»è®¤çº¯å±ç¤ºæ°æ® --> |
| | | <div v-else class="cell" style="width: 100%"> |
| | | <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span> |
| | | <span v-else>{{ |
| | | formatters(scope.row[item.prop], item.formatData) |
| | | }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-if="page.total > 0" |
| | | :total="page.total" |
| | | :layout="page.layout" |
| | | :page="page.current" |
| | | :limit="page.size" |
| | | @pagination="paginationSearch" |
| | | /> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import pagination from "./Pagination.vue"; |
| | | import { ref, inject, getCurrentInstance } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | |
| | | // è·åå
¨å±ç uploadHeader |
| | | const { proxy } = getCurrentInstance(); |
| | | const uploadHeader = proxy.uploadHeader; |
| | | const javaApi = proxy.javaApi; |
| | | |
| | | const emit = defineEmits(["pagination", "expand-change", "selection-change"]); |
| | | |
| | | // Filters |
| | | const typeFn = (val, row) => { |
| | | return typeof val === "function" ? val(row) : val; |
| | | }; |
| | | |
| | | const formatters = (val, format) => { |
| | | return typeof format === "function" ? format(val) : val; |
| | | }; |
| | | |
| | | // Propsï¼ä½¿ç¨ defineProps çé TS å½¢å¼ï¼ |
| | | const props = defineProps({ |
| | | tableLoading: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | height: { |
| | | type: [Number, String], |
| | | default: "calc(100vh - 22em)", |
| | | }, |
| | | expandRowKeys: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | summaryMethod: { |
| | | type: Function, |
| | | default: () => {}, |
| | | }, |
| | | rowClick: { |
| | | type: Function, |
| | | default: () => {}, |
| | | }, |
| | | currentChange: { |
| | | type: Function, |
| | | default: () => {}, |
| | | }, |
| | | border: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | isSelection: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | isShowSummary: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | highlightCurrentRow: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | headerCellStyle: { |
| | | type: Object, |
| | | default: () => ({}), |
| | | }, |
| | | column: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | rowClassName: { |
| | | type: Function, |
| | | default: () => "", |
| | | }, |
| | | rowStyle: { |
| | | type: [Object, Function], |
| | | default: () => ({}), |
| | | }, |
| | | tableData: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | rowKey: { |
| | | type: String, |
| | | default: undefined, |
| | | }, |
| | | page: { |
| | | type: Object, |
| | | default: () => ({ |
| | | total: 0, |
| | | current: 0, |
| | | size: 10, |
| | | layout: "total, sizes, prev, pager, next, jumper", |
| | | }), |
| | | }, |
| | | total: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | }); |
| | | |
| | | // Data |
| | | const uploadRefs = ref([]); |
| | | const currentFiles = ref({}); |
| | | const uploadKeys = ref({}); |
| | | |
| | | const indexMethod = (index) => { |
| | | return (props.page.current - 1) * props.page.size + index + 1; |
| | | }; |
| | | |
| | | // ç¹å» link äºä»¶ |
| | | const goLink = (row, linkMethod) => { |
| | | if (!linkMethod) { |
| | | return ElMessage.warning("请é
ç½® link äºä»¶"); |
| | | } |
| | | const parentMethod = getParentMethod(linkMethod); |
| | | if (typeof parentMethod === "function") { |
| | | parentMethod(row); |
| | | } else { |
| | | console.warn(`ç¶ç»ä»¶ä¸æªæ¾å°æ¹æ³: ${linkMethod}`); |
| | | } |
| | | }; |
| | | |
| | | // è·åç¶ç»ä»¶æ¹æ³ï¼ç¤ºä¾å®ç°ï¼ |
| | | const getParentMethod = (methodName) => { |
| | | const parentMethods = inject("parentMethods", {}); |
| | | return parentMethods[methodName]; |
| | | }; |
| | | |
| | | const dataTypeFn = (val, format) => { |
| | | if (typeof format === "function") { |
| | | return format(val); |
| | | } else return val; |
| | | }; |
| | | |
| | | const formatType = (val, format) => { |
| | | if (typeof format === "function") { |
| | | return format(val); |
| | | } else return ""; |
| | | }; |
| | | |
| | | // æä»¶ååå¤ç |
| | | const handleChange = (file, fileList, index) => { |
| | | if (fileList.length > 1) { |
| | | const earliestFile = fileList[0]; |
| | | uploadRefs.value[index]?.handleRemove(earliestFile); |
| | | } |
| | | currentFiles.value[index] = file; |
| | | }; |
| | | |
| | | // æä»¶ä¸ä¼ åæ ¡éª |
| | | const beforeUpload = (rawFile, index) => { |
| | | currentFiles.value[index] = {}; |
| | | if (rawfile.size > 1024 * 1024 * 10 * 10) { |
| | | ElMessage.error("ä¸ä¼ æä»¶ä¸è¶
è¿10M"); |
| | | return false; |
| | | } |
| | | return true; |
| | | }; |
| | | |
| | | // ä¸ä¼ æå |
| | | const handleSuccessUp = (response, file, fileList, index) => { |
| | | if (response.code == 200) { |
| | | if (uploadRefs[index]) { |
| | | uploadRefs[index].clearFiles(); |
| | | } |
| | | currentFiles[index] = file; |
| | | ElMessage.success("ä¸ä¼ æå"); |
| | | resetUploadComponent(index); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | |
| | | const resetUploadComponent = (index) => { |
| | | uploadKeys[index] = Date.now(); |
| | | }; |
| | | |
| | | // ä¸ä¼ 失败 |
| | | const onError = (error, file, fileList, index) => { |
| | | ElMessage.error("æä»¶ä¸ä¼ 失败ï¼è¯·éè¯"); |
| | | if (uploadRefs.value[index]) { |
| | | uploadRefs.value[index].clearFiles(); |
| | | } |
| | | }; |
| | | |
| | | // æä»¶æ°éè¶
éæç¤º |
| | | const onExceed = () => { |
| | | ElMessage.warning("è¶
åºæä»¶ä¸ªæ°"); |
| | | }; |
| | | |
| | | const paginationSearch = ({ page, limit }) => { |
| | | emit("pagination", { page: page, limit: limit }); |
| | | }; |
| | | |
| | | const expandChange = (row, expandedRows) => { |
| | | emit("expand-change", row, expandedRows); |
| | | }; |
| | | |
| | | const handleSelectionChange = (newSelection) => { |
| | | emit("selection-change", newSelection); |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .cell { |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | padding-right: 0 !important; |
| | | padding-left: 0 !important; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div :class="{ hidden }" class="pagination-container"> |
| | | <el-pagination |
| | | :background="background" |
| | | v-model:current-page="currentPage" |
| | | v-model:page-size="pageSize" |
| | | :layout="layout" |
| | | :page-sizes="pageSizes" |
| | | :pager-count="pagerCount" |
| | | :total="total" |
| | | v-bind="$attrs" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed } from 'vue' |
| | | import { scrollTo } from '@/utils/scroll-to' |
| | | |
| | | const props = defineProps({ |
| | | total: { |
| | | type: Number, |
| | | required: true |
| | | }, |
| | | page: { |
| | | type: Number, |
| | | default: 1 |
| | | }, |
| | | limit: { |
| | | type: Number, |
| | | default: 20 |
| | | }, |
| | | pageSizes: { |
| | | type: Array, |
| | | default: () => [10, 20, 30, 50, 100] |
| | | }, |
| | | pagerCount: { |
| | | type: Number, |
| | | default: () => (document.body.clientWidth < 992 ? 5 : 7) |
| | | }, |
| | | layout: { |
| | | type: String, |
| | | default: 'total, sizes, prev, pager, next, jumper' |
| | | }, |
| | | background: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | autoScroll: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | hidden: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }) |
| | | |
| | | const emit = defineEmits(['update:page', 'update:limit', 'pagination']) |
| | | |
| | | const currentPage = computed({ |
| | | get: () => props.page, |
| | | set: (val) => emit('update:page', val) |
| | | }) |
| | | |
| | | const pageSize = computed({ |
| | | get: () => props.limit, |
| | | set: (val) => emit('update:limit', val) |
| | | }) |
| | | |
| | | const handleSizeChange = (val) => { |
| | | if (currentPage.value * val > props.total) { |
| | | currentPage.value = 1 |
| | | } |
| | | emit('pagination', { page: currentPage.value, limit: val }) |
| | | if (props.autoScroll) { |
| | | scrollTo(0, 800) |
| | | } |
| | | } |
| | | |
| | | const handleCurrentChange = (val) => { |
| | | emit('pagination', { page: val, limit: pageSize.value }) |
| | | if (props.autoScroll) { |
| | | scrollTo(0, 800) |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .pagination-container { |
| | | background: #fff; |
| | | padding: 16px 0; |
| | | margin-top: 0; |
| | | } |
| | | .pagination-container.hidden { |
| | | display: none; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-table :data="tableData" :column="columnss" style="width: 100%"> |
| | | <el-table-column type="index" width="50"> |
| | | <template #default="scope"> |
| | | {{ getRowIndex(scope.$index) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in columnss" |
| | | :key="index" |
| | | :prop="item.prop" |
| | | :label="item.label" |
| | | :align="item.align || 'center'" |
| | | :min-width="item.minWidth || '100px'" |
| | | :width="item.width" |
| | | :fixed="item.fixed || false" |
| | | :show-overflow-tooltip="showOverflowTooltip || true" |
| | | > |
| | | </el-table-column> |
| | | </el-table> |
| | | </template> |
| | | <script setup> |
| | | import { ref, onMounted, watch, nextTick } from "vue"; |
| | | |
| | | const props = defineProps({ |
| | | tableData: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | columnss: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | }); |
| | | const getRowIndex = (index) => { |
| | | return index + 1; |
| | | }; |
| | | </script> |
| | | <style scoped></style> |
| | |
| | | */ |
| | | import { ref, reactive, computed, nextTick } from "vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import { clone } from "lodash"; |
| | | import { deepClone } from "@/utils/index.js" |
| | | |
| | | |
| | | /** |
| | | * åå»ºè¡¨åæ°æ®ç®¡çåè½ |
| | |
| | | } |
| | | |
| | | // ååå
¼å®¹çé»è®¤å¯¼åº |
| | | export default function useFormDataSimple(initData) { |
| | | const form = reactive(clone(initData, true)); |
| | | export default function useFormDatas(initData) { |
| | | const form = reactive(deepClone(initData, true)); |
| | | |
| | | function resetForm() { |
| | | const initData2 = JSON.parse(JSON.stringify(initData)); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { ref } from "vue"; |
| | | export function useModal(options) { |
| | | const id = ref(); |
| | | const visible = ref(false); |
| | | const loading = ref(false); |
| | | const modalOptions = ref({}); |
| | | |
| | | const openModal = (e) => { |
| | | id.value = e; |
| | | modalOptions.value = { |
| | | title: e ? `ä¿®æ¹${options.title}` : `æ°å¢${options.title}`, |
| | | content: "ç¡®å®æ§è¡æ¤æä½åï¼", |
| | | confirmText: "ç¡®å®", |
| | | cancelText: "åæ¶", |
| | | }; |
| | | visible.value = true; |
| | | }; |
| | | |
| | | // å
³éæ¨¡ææ¡ |
| | | const closeModal = () => { |
| | | visible.value = false; |
| | | loading.value = false; |
| | | }; |
| | | |
| | | // 确认æä½ |
| | | const handleConfirm = async (callback) => { |
| | | loading.value = true; |
| | | callback(); |
| | | closeModal(); |
| | | }; |
| | | |
| | | return { |
| | | id, |
| | | visible, |
| | | loading, |
| | | modalOptions, |
| | | openModal, |
| | | closeModal, |
| | | handleConfirm, |
| | | }; |
| | | } |
| | |
| | | import { ref, reactive, watchEffect, unref } from "vue"; |
| | | import useFormData from "./useFormData.js"; |
| | | // import { message } from "@/utils/message"; |
| | | import useFormData from "@/hooks/useFormData"; |
| | | import { deepClone, isEqual } from "@/utils/index.js" |
| | | import { ElMessage } from 'element-plus' |
| | | |
| | | import { clone, isEqual } from "lodash"; |
| | | /** |
| | | * å页api |
| | | * @param api æ¥å£ |
| | |
| | | ) { |
| | | const dataList = ref([]); |
| | | const { form: filters, resetForm } = useFormData(initalFilters); |
| | | let lastFilters = clone(initalFilters); |
| | | let lastFilters = deepClone(initalFilters); |
| | | const sorter = reactive(sorters || {}); |
| | | const others = ref({}); |
| | | const loading = ref(true); |
| | |
| | | // å¦æè¿æ¬¡å䏿¬¡çfilterä¸åï¼é£ä¹å°±é置页ç |
| | | if (!isEqual(unref(filters), lastFilters)) { |
| | | pagination.currentPage = 1; |
| | | lastFilters = clone(unref(filters)); |
| | | lastFilters = deepClone(unref(filters)); |
| | | } |
| | | loading.value = true; |
| | | api({ |
| | | ...getFinalParams(), |
| | | current: pagination.currentPage, |
| | | size: pagination.pageSize |
| | | }).then(({ code, data, ...rest }) => { |
| | | }).then(({ code, data, msg, ...rest }) => { |
| | | if (code == 200) { |
| | | // pagination.currentPage = meta.current_page; |
| | | // pagination.pageSize = meta.per_page; |
| | |
| | | loading.value = false; |
| | | } else { |
| | | loading.value = false; |
| | | // message(data.msg, { type: "error" }); |
| | | ElMessage({ message: msg, type: "error" }); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | watchEffect(() => { |
| | | pagination.align = paginationAlign.value; |
| | | pagination.align = paginationAlign.value |
| | | }); |
| | | |
| | | // onMounted(() => { |
| | |
| | | export function isNumberStr(str) { |
| | | return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) |
| | | } |
| | | |
| | | |
| | | export function isEqual(obj1, obj2) { |
| | | return JSON.stringify(obj1) === JSON.stringify(obj2); |
| | | } |
| | |
| | | </el-input> |
| | | </div> |
| | | </el-col> |
| | | <el-col :offset="10" :span="2"> |
| | | <el-col :offset="8" :span="3"> |
| | | <el-button :icon="Delete" type="danger" @click="delHandler" |
| | | >å é¤</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="2"> |
| | | <el-col :span="3"> |
| | | <el-button |
| | | :disabled="!tableSwitch" |
| | | :icon="Plus" |
| | |
| | | :table-data="tableData" |
| | | @edit="handleEdit" |
| | | @selection-change="handleSelectionChange" |
| | | style="height: calc(65vh);" |
| | | > |
| | | </ETable> |
| | | <Pagination |
| | |
| | | treeId: queryParams.treeId, |
| | | current: queryParams.current, |
| | | size: queryParams.pageSize, |
| | | searchAll: queryParams.searchAll, |
| | | }); |
| | | |
| | | if (res.code !== 200) { |
| | |
| | | }; |
| | | |
| | | // ===== çå½å¨æ ===== |
| | | onMounted(getList); |
| | | onMounted(()=>{ |
| | | getList(); |
| | | getArchiveListData(); |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .custom-tree-node { |
| | |
| | | width: 16%; |
| | | } |
| | | } |
| | | |
| | | .app-container{ |
| | | padding: 18px !important; |
| | | } |
| | | .table-toolbar { |
| | | margin-bottom: 20px; |
| | | display: flex; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :inline="true" :model="queryParams" class="search-form"> |
| | | <el-form-item v-if="shouldShowSearch" label="æç´¢"> |
| | | <el-input |
| | | v-model="queryParams.searchAll" |
| | | :placeholder="searchPlaceholder" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="search">æ¥è¯¢</el-button> |
| | | <el-button @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-card> |
| | | <!-- æ ç¾é¡µ --> |
| | | <el-tabs |
| | | v-model="activeTab" |
| | | class="info-tabs" |
| | | @tab-click="handleTabClick" |
| | | > |
| | | <el-tab-pane |
| | | v-for="tab in tabs" |
| | | :key="tab.name" |
| | | :label="tab.label" |
| | | :name="tab.name" |
| | | /> |
| | | </el-tabs> |
| | | |
| | | <!-- æä½æé®åº --> |
| | | <el-row :gutter="24" class="table-toolbar"> |
| | | <el-button :icon="Plus" type="primary" @click="handleAdd" |
| | | >æ°å»º</el-button |
| | | > |
| | | <el-button :icon="Delete" type="danger" @click="handleDelete" |
| | | >å é¤</el-button |
| | | > |
| | | </el-row> |
| | | <!-- è¡¨æ ¼ç»ä»¶ --> |
| | | <div> |
| | | <data-table |
| | | :border="true" |
| | | :columns="columns" |
| | | :loading="loading" |
| | | style="width: 100%; height: calc(100vh - 29em)" |
| | | :show-selection="true" |
| | | :table-data="tableData" |
| | | @edit="handleEdit" |
| | | @viewRow="handleView" |
| | | @selection-change="handleSelectionChange" |
| | | :operations="['edit', 'viewRow']" |
| | | :operationsWidth="200" |
| | | > |
| | | <!-- åæ®µåç§°åçèªå®ä¹ææ§½ - æ¾ç¤ºä¸ºæ ç¾ --> |
| | | <template |
| | | v-if="activeTab === 'coalQualityMaintenance'" |
| | | #fieldIds="{ row }" |
| | | > |
| | | <template |
| | | v-if=" |
| | | typeof row.fieldIds === 'string' && row.fieldIds.includes(',') |
| | | " |
| | | > |
| | | <el-tag |
| | | v-for="(field, index) in row.fieldIds.split(',')" |
| | | :key="index" |
| | | size="small" |
| | | style="margin-right: 4px; margin-bottom: 2px" |
| | | type="primary" |
| | | > |
| | | </el-tag> |
| | | </template> |
| | | <template v-else> |
| | | <el-tag size="small" type="primary"> |
| | | </el-tag> |
| | | </template> |
| | | </template> |
| | | </data-table> |
| | | </div> |
| | | <pagination |
| | | v-if="total > 0" |
| | | :layout="'total, prev, pager, next, jumper'" |
| | | :limit="pageSizes" |
| | | :page="pageNum" |
| | | :total="total" |
| | | @pagination="handPagination" |
| | | /> |
| | | <managementDialog |
| | | v-model:copyForm="copyForm" |
| | | v-model:managementFormDialog="manaDialog" |
| | | :addOrEdit="addOrEdit" |
| | | :form="form" |
| | | @submit="getList" |
| | | ></managementDialog> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, onMounted, reactive, ref } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { Delete, Plus } from "@element-plus/icons-vue"; |
| | | |
| | | // ç»ä»¶å¯¼å
¥ |
| | | import DataTable from "@/components/Table/ETable.vue"; |
| | | import Pagination from "@/components/Pagination"; |
| | | import managementDialog from "./mould/managementDialog.vue"; |
| | | |
| | | // API æå¡å¯¼å
¥ |
| | | import { useDelete } from "@/hooks/useDelete.js"; |
| | | import { getManagementList, delEquipment } from "@/api/equipment/management/index.js"; |
| | | |
| | | // ååºå¼ç¶æç®¡ç |
| | | const form = ref({}); |
| | | const title = ref(""); |
| | | const copyForm = ref({}); |
| | | const addOrEdit = ref("add"); |
| | | const manaDialog = ref(false); |
| | | const loading = ref(false); |
| | | const activeTab = ref("management"); |
| | | const selectedRows = ref([]); |
| | | const tableData = ref([]); |
| | | |
| | | // åé¡µç¶æ |
| | | const pageNum = ref(1); |
| | | const pageSizes = ref(10); |
| | | const total = ref(0); |
| | | |
| | | // æ¥è¯¢åæ° |
| | | const queryParams = reactive({ |
| | | searchAll: "" |
| | | }); |
| | | |
| | | // æ ç¾é¡µé
ç½® - 便äºåç»æ©å± |
| | | const tabsConfig = { |
| | | management: { |
| | | label: "设å¤å表", |
| | | searchPlaceholder: "设å¤ç¼å·/设å¤åç§°/è§æ ¼åå·", |
| | | showSearch: true, |
| | | api: getManagementList, |
| | | deleteApi: delEquipment, |
| | | columns: [ |
| | | { prop: "equipmentId", label: "设å¤ç¼å·", minWidth: 100 }, |
| | | { prop: "equipmentName", label: "设å¤åç§°", minWidth: 100 }, |
| | | { prop: "quantity", label: "æ°é", minWidth: 100 }, |
| | | { prop: "specification", label: "è§æ ¼åå·", minWidth: 100 }, |
| | | { |
| | | prop: "usageStatus", |
| | | label: "使ç¨ç¶æ", |
| | | minWidth: 100, |
| | | formatter: (row) => row.usageStatus == 1 ? "å¯ç¨" : "ç¦ç¨" |
| | | }, |
| | | { prop: "usingDepartment", label: "使ç¨é¨é¨", minWidth: 100 }, |
| | | { prop: "purchaseDate", label: "éè´æ¥æ", minWidth: 100 }, |
| | | { prop: "purchasePrice", label: "éè´ä»·æ ¼", minWidth: 100 }, |
| | | ] |
| | | } |
| | | // åç»å¯ä»¥å¨è¿éæ·»å æ°çæ ç¾é¡µé
ç½® |
| | | }; |
| | | |
| | | // æ ç¾é¡µæ°æ® |
| | | const tabs = reactive( |
| | | Object.entries(tabsConfig).map(([name, config]) => ({ |
| | | name, |
| | | label: config.label |
| | | })) |
| | | ); |
| | | |
| | | // å½åæ ç¾é¡µé
ç½® |
| | | const currentTabConfig = computed(() => tabsConfig[activeTab.value]); |
| | | |
| | | // 计ç®å±æ§ |
| | | const searchPlaceholder = computed(() => currentTabConfig.value?.searchPlaceholder || "请è¾å
¥æç´¢ä¿¡æ¯"); |
| | | const shouldShowSearch = computed(() => currentTabConfig.value?.showSearch || false); |
| | | const columns = computed(() => currentTabConfig.value?.columns || []); |
| | | const selectedCount = computed(() => selectedRows.value.length); |
| | | |
| | | // äºä»¶å¤ç彿° |
| | | const handleTabClick = (tab) => { |
| | | activeTab.value = tab.props.name; |
| | | resetState(); |
| | | getList(); |
| | | }; |
| | | |
| | | const resetState = () => { |
| | | form.value = {}; |
| | | addOrEdit.value = "add"; |
| | | loading.value = true; |
| | | tableData.value = []; |
| | | pageNum.value = 1; |
| | | pageSizes.value = 10; |
| | | total.value = 0; |
| | | queryParams.searchAll = ""; |
| | | }; |
| | | |
| | | const resetQuery = () => { |
| | | queryParams.searchAll = ""; |
| | | pageNum.value = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | const search = () => { |
| | | pageNum.value = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | const handleAdd = () => { |
| | | addOrEdit.value = "add"; |
| | | form.value = {}; |
| | | title.value = `æ°å¢${currentTabConfig.value.label}`; |
| | | manaDialog.value = true; |
| | | }; |
| | | |
| | | const handleEdit = (row) => { |
| | | form.value = { ...row }; |
| | | addOrEdit.value = "edit"; |
| | | title.value = `ç¼è¾${currentTabConfig.value.label}`; |
| | | copyForm.value = { ...row }; |
| | | manaDialog.value = true; |
| | | }; |
| | | |
| | | const handleView = (row) => { |
| | | form.value = { ...row }; |
| | | addOrEdit.value = "viewRow"; |
| | | title.value = `æ¥ç${currentTabConfig.value.label}`; |
| | | copyForm.value = { ...row }; |
| | | manaDialog.value = true; |
| | | }; |
| | | |
| | | const handPagination = (val) => { |
| | | pageNum.value = val.page; |
| | | pageSizes.value = val.limit; |
| | | getList(); |
| | | }; |
| | | |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection; |
| | | }; |
| | | |
| | | |
| | | // å é¤å¤ç |
| | | const { handleDeleteBatch: handleDelete } = useDelete({ |
| | | deleteApi: () => currentTabConfig.value.deleteApi, |
| | | selectedRows: selectedRows, |
| | | getList: () => getList(), |
| | | tableData: tableData, |
| | | total: total, |
| | | confirmText: "确认å é¤éä¸çæ°æ®åï¼", |
| | | successText: "å 餿å", |
| | | }); |
| | | |
| | | // æ°æ®è·å |
| | | const getList = async () => { |
| | | try { |
| | | loading.value = true; |
| | | const apiParams = { |
| | | current: pageNum.value, |
| | | pageSize: pageSizes.value, |
| | | searchAll: queryParams.searchAll, |
| | | }; |
| | | |
| | | const { data, code } = await currentTabConfig.value.api(apiParams); |
| | | |
| | | if (code !== 200) { |
| | | ElMessage.error("è·åæ°æ®å¤±è´¥ï¼" + (data?.msg || "æªç¥é误")); |
| | | return; |
| | | } |
| | | |
| | | tableData.value = data.records || []; |
| | | total.value = data.total || 0; |
| | | } catch (error) { |
| | | ElMessage.error("è·åæ°æ®å¤±è´¥ï¼è¯·ç¨ååè¯"); |
| | | } finally { |
| | | loading.value = false; |
| | | } |
| | | }; |
| | | |
| | | // ç»ä»¶æè½½ |
| | | onMounted(() => { |
| | | handleTabClick({ props: { name: "management" } }); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /* ååºå¼å¸å± */ |
| | | @media screen and (min-width: 768px) { |
| | | .search-form :deep(.el-form-item) { |
| | | width: 50%; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1200px) { |
| | | .search-form :deep(.el-form-item) { |
| | | width: 16%; |
| | | } |
| | | } |
| | | |
| | | .table-toolbar { |
| | | margin-bottom: 20px; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 10px; |
| | | } |
| | | .app-container{ |
| | | padding: 18px !important; |
| | | } |
| | | /* ååºå¼è¡¨æ ¼ */ |
| | | @media screen and (max-width: 768px) { |
| | | .table-toolbar { |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .table-toolbar .el-button { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | /* è¡¨æ ¼å·¥å
·æ */ |
| | | .table-toolbar, |
| | | .table-toolbar > * { |
| | | margin: 0 0 0 0 !important; |
| | | } |
| | | |
| | | .table-toolbar { |
| | | margin-bottom: 20px !important; |
| | | } |
| | | |
| | | .el-form--inline .el-form-item { |
| | | margin-right: 25px; |
| | | } |
| | | |
| | | .main-container { |
| | | background: red !important; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | :title="addOrEdit === 'edit' ? 'ç¼è¾' : 'æ°å¢' + '设å¤'" |
| | | width="800" |
| | | :title-style="{ textAlign: 'center' }" |
| | | :close-on-click-modal="false" |
| | | :before-close="handleClose" |
| | | > |
| | | <el-form |
| | | ref="formRef" |
| | | :model="formData" |
| | | :rules="rules" |
| | | label-width="auto" |
| | | > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="11"> |
| | | <el-form-item label="设å¤ç¼å·" prop="equipmentId"> |
| | | <el-input |
| | | v-model="formData.equipmentId" |
| | | placeholder="请è¾å
¥è®¾å¤ç¼å·" |
| | | :disabled="isViewMode" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item label="设å¤åç§°" prop="equipmentName"> |
| | | <el-input |
| | | v-model="formData.equipmentName" |
| | | placeholder="请è¾å
¥è®¾å¤åç§°" |
| | | :disabled="isViewMode" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item label="æ°é" prop="quantity"> |
| | | <el-input |
| | | v-model="formData.quantity" |
| | | placeholder="请è¾å
¥æ°é" |
| | | :disabled="isViewMode" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item label="è§æ ¼åå·" prop="specification"> |
| | | <el-input |
| | | v-model="formData.specification" |
| | | placeholder="请è¾å
¥è§æ ¼åå·" |
| | | :disabled="isViewMode" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item label="使ç¨ç¶æ" prop="usageStatus"> |
| | | <el-select |
| | | v-model="formData.usageStatus" |
| | | placeholder="è¯·éæ©ä½¿ç¨ç¶æ" |
| | | :disabled="isViewMode" |
| | | > |
| | | <el-option label="å¯ç¨" value="1" /> |
| | | <el-option label="ç¦ç¨" value="0" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item label="使ç¨é¨é¨" prop="usingDepartment"> |
| | | <el-input |
| | | v-model="formData.usingDepartment" |
| | | placeholder="请è¾å
¥ä½¿ç¨é¨é¨" |
| | | :disabled="isViewMode" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item label="åæ¾ä½ç½®" prop="storageLocation"> |
| | | <el-input |
| | | v-model="formData.storageLocation" |
| | | placeholder="请è¾å
¥åæ¾ä½ç½®" |
| | | :disabled="isViewMode" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item label="éè´ä»·æ ¼" prop="purchasePrice"> |
| | | <el-input |
| | | v-model="formData.purchasePrice" |
| | | placeholder="请è¾å
¥éè´ä»·æ ¼" |
| | | :disabled="isViewMode" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item label="éè´æ¥æ" prop="purchaseDate"> |
| | | <el-date-picker |
| | | v-model="formData.purchaseDate" |
| | | type="date" |
| | | placeholder="è¯·éæ©éè´æ¥æ" |
| | | size="default" |
| | | :value-format="'YYYY-MM-DD'" |
| | | style="width: 100%;" |
| | | :disabled="isViewMode" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form-item class="dialog-footer"> |
| | | <el-button v-if="!isViewMode" @click="cancelForm">åæ¶</el-button> |
| | | <el-button v-if="!isViewMode" type="primary" @click="submitForm">ç¡®å®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, watch, computed, reactive } from "vue"; |
| | | import { addOrEditEquipment } from "@/api/equipment/management/index.js"; |
| | | |
| | | const props = defineProps({ |
| | | beforeClose: { |
| | | type: Function, |
| | | default: () => {}, |
| | | }, |
| | | form: { |
| | | type: Object, |
| | | default: () => ({}), |
| | | }, |
| | | addOrEdit: { |
| | | type: String, |
| | | default: "add", |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | }); |
| | | |
| | | const emit = defineEmits(["submit", "handleBeforeClose"]); |
| | | |
| | | // 计ç®å±æ§ï¼ç»ä¸æ§å¶æ¯å¦ç¦ç¨ |
| | | const isViewMode = computed(() => props.addOrEdit === "viewRow"); |
| | | |
| | | // 表åå¼ç¨åæ°æ® |
| | | const formRef = ref(null); |
| | | const formData = ref({}); |
| | | const copyForm = defineModel("copyForm", { |
| | | required: true, |
| | | type: Object, |
| | | default: () => ({}), |
| | | }); |
| | | |
| | | // å¼¹çªå¯è§æ§ |
| | | const dialogVisible = defineModel("managementFormDialog", { |
| | | required: true, |
| | | type: Boolean, |
| | | }); |
| | | |
| | | // çå¬å¤é¨ä¼ å
¥çè¡¨åæ°æ®ååï¼åå¹¶çå¬é»è¾ |
| | | watch( |
| | | [() => props.form, () => props.addOrEdit], |
| | | ([newForm, newAddOrEdit]) => { |
| | | formData.value = { ...newForm }; |
| | | }, |
| | | { deep: true, immediate: true } |
| | | ); |
| | | // æäº¤è¡¨å |
| | | const submitForm = async () => { |
| | | if (!formRef.value) return; |
| | | |
| | | await formRef.value.validate(async (valid) => { |
| | | if (!valid) return; |
| | | |
| | | try { |
| | | const result = await addOrEditEquipment({ ...formData.value }); |
| | | const title = props.title.includes("æ°å¢") ? "æ°å¢" : "ç¼è¾"; |
| | | |
| | | if (result.code === 200 && result.msg) { |
| | | ElMessage.success(`${title}æåï¼${result.msg}`); |
| | | emit("submit", { title, ...formData.value, result }); |
| | | closeDialog(); |
| | | } else { |
| | | ElMessage.error(`${title}失败ï¼${result.msg}`); |
| | | } |
| | | } catch (error) { |
| | | console.error("æäº¤å¤±è´¥:", error); |
| | | ElMessage.error("æäº¤å¤±è´¥ï¼è¯·éè¯"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // å
³éå¼¹çªçç»ä¸æ¹æ³ |
| | | const closeDialog = () => { |
| | | emit("update:managementFormDialog", false); |
| | | formData.value = {}; |
| | | }; |
| | | |
| | | // åæ¶è¡¨å |
| | | const cancelForm = () => { |
| | | closeDialog(); |
| | | }; |
| | | |
| | | // é置表å |
| | | const resetForm = () => { |
| | | if (!formRef.value) return; |
| | | formData.value = JSON.parse(JSON.stringify(copyForm.value)); |
| | | }; |
| | | |
| | | // å
³éå¼¹çª |
| | | const handleClose = () => { |
| | | emit("handleBeforeClose"); |
| | | closeDialog(); |
| | | }; |
| | | const rules = reactive({ |
| | | equipmentId: [ |
| | | { required: true, message: "请è¾å
¥ä¾è´§ååç§°", trigger: "blur" }, |
| | | ], |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .dialog-footer { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | margin-top: 20px; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | // åªä¸ºdialog头é¨å ä¸å线 |
| | | :deep(.el-dialog__header) { |
| | | border-bottom: 1px solid #e8eaec; |
| | | padding: 0 20px 10px 0; |
| | | margin-bottom: 14px; |
| | | } |
| | | </style> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {Download, Delete, Plus} from "@element-plus/icons-vue"; |
| | | import {onMounted, ref} from "vue"; |
| | | const { proxy } = getCurrentInstance() |
| | | import { Delete, Plus } from "@element-plus/icons-vue"; |
| | | import { onMounted, ref, reactive, getCurrentInstance, nextTick } from "vue"; |
| | | |
| | | // ç»ä»¶å¼å
¥ |
| | | import Pagination from "@/components/Pagination/index.vue"; |
| | | import ETable from "@/components/Table/ETable.vue"; |
| | | import FormDia from "@/views/inspectionManagement/components/formDia.vue"; |
| | | import QrCodeDia from "@/views/inspectionManagement/components/qrCodeDia.vue"; |
| | | import ViewFiles from "@/views/inspectionManagement/components/viewFiles.vue"; |
| | | import ViewQrCodeFiles from "@/views/inspectionManagement/components/viewQrCodeFiles.vue"; |
| | | |
| | | // æ¥å£å¼å
¥ |
| | | import { |
| | | delInspectionTask, |
| | | delTimingTask, |
| | | inspectionTaskList, |
| | | timingTaskList |
| | | } from "@/api/inspectionManagement/index.js"; |
| | | import ViewFiles from "@/views/inspectionManagement/components/viewFiles.vue"; |
| | | import {delQrCode, qrCodeList, qrCodeScanRecordList} from "@/api/inspectionUpload/index.js"; |
| | | import ViewQrCodeFiles from "@/views/inspectionManagement/components/viewQrCodeFiles.vue"; |
| | | import { |
| | | delQrCode, |
| | | qrCodeList, |
| | | qrCodeScanRecordList |
| | | } from "@/api/inspectionUpload/index.js"; |
| | | |
| | | const formDia = ref() |
| | | const qrCodeDia = ref() |
| | | const viewFiles = ref() |
| | | const viewQrCodeFiles = ref() |
| | | // å
¨å±åé |
| | | const { proxy } = getCurrentInstance(); |
| | | const formDia = ref(); |
| | | const qrCodeDia = ref(); |
| | | const viewFiles = ref(); |
| | | const viewQrCodeFiles = ref(); |
| | | |
| | | // æ¥è¯¢åæ° |
| | | const queryParams = reactive({ |
| | | searchAll: "", |
| | | }) |
| | | // å½åæ ç¾ |
| | | }); |
| | | |
| | | // æ ç¾é¡µé
ç½® |
| | | const activeTab = ref("task"); |
| | | const tabName = ref("task"); |
| | | // æ ç¾é¡µæ°æ® |
| | | const tabs = reactive([ |
| | | { name: "task", label: "ç产巡æ£" }, |
| | | { name: "qrCodeScanRecord", label: "ç°åºå·¡æ£è®°å½" }, |
| | | ]); |
| | | // åéæ¡ |
| | | |
| | | // åéæ¡é
ç½® |
| | | const activeRadio = ref("taskManage"); |
| | | const radios = reactive([ |
| | | { name: "taskManage", label: "宿¶ä»»å¡ç®¡ç" }, |
| | | { name: "task", label: "宿¶ä»»å¡è®°å½" }, |
| | | { name: "qrCode", label: "äºç»´ç 管ç" }, |
| | | ]); |
| | | // è¡¨æ ¼ |
| | | |
| | | // è¡¨æ ¼æ°æ® |
| | | const selectedRows = ref([]); |
| | | const tableData = ref([]); |
| | | const operationsArr = ref([]); |
| | |
| | | const total = ref(0); |
| | | const pageNum = ref(1); |
| | | const pageSize = ref(10); |
| | | |
| | | // åé
ç½® |
| | | const columns = ref([ |
| | | { prop: "taskName", label: "å·¡æ£ä»»å¡åç§°", minWidth: 160 }, |
| | | { prop: "inspectionLocation", label: "å°ç¹", minWidth: 120 }, |
| | | { prop: "remarks", label: "夿³¨", minWidth: 150 }, |
| | | { prop: "inspector", label: "æ§è¡å·¡æ£äºº", minWidth: 150 }, |
| | | { prop: "frequencyType", label: "颿¬¡", minWidth: 150, |
| | | { |
| | | prop: "frequencyType", |
| | | label: "颿¬¡", |
| | | minWidth: 150, |
| | | formatter: (_, __, val) => ({ |
| | | DAILY: "æ¯æ¥", |
| | | WEEKLY: "æ¯å¨", |
| | | MONTHLY: "æ¯æ", |
| | | QUARTERLY: "å£åº¦" |
| | | }[val] || "") |
| | | }, |
| | | { |
| | | prop: "frequencyDetail", |
| | | label: "å¼å§æ¥æä¸æ¶é´", |
| | | minWidth: 150, |
| | | formatter: (row, column, cellValue) => { |
| | | if (cellValue === 'DAILY') { |
| | | return 'æ¯æ¥'; |
| | | } else if (cellValue === 'MONTHLY') { |
| | | return 'æ¯æ'; |
| | | } else if (cellValue === 'WEEKLY') { |
| | | return 'æ¯å¨'; |
| | | } else { |
| | | return 'å£åº¦' |
| | | // å
夿æ¯å¦æ¯å符串 |
| | | if (typeof cellValue !== 'string') return ''; |
| | | let val = cellValue; |
| | | const replacements = { |
| | | MON: 'å¨ä¸', |
| | | TUE: 'å¨äº', |
| | | WED: 'å¨ä¸', |
| | | THU: 'å¨å', |
| | | FRI: 'å¨äº', |
| | | SAT: 'å¨å
', |
| | | SUN: '卿¥' |
| | | }; |
| | | // ä½¿ç¨æ£å䏿¬¡æ§æ¿æ¢ææå¹é
项 |
| | | return val.replace(/MON|TUE|WED|THU|FRI|SAT|SUN/g, match => replacements[match]); |
| | | } |
| | | }}, |
| | | { prop: "frequencyDetail", label: "å¼å§æ¥æä¸æ¶é´", minWidth: 150 }, |
| | | }, |
| | | { prop: "registrant", label: "ç»è®°äºº", minWidth: 100 }, |
| | | { prop: "createTime", label: "ç»è®°æ¥æ", minWidth: 100 }, |
| | | ]); |
| | | |
| | | const columns1 = ref([ |
| | | { prop: "deviceName", label: "设å¤åç§°", minWidth: 160 }, |
| | | { prop: "location", label: "æå¨ä½ç½®æè¿°", minWidth: 120 }, |
| | |
| | | onMounted(() => { |
| | | radioChange('taskManage'); |
| | | }); |
| | | // æ ç¾é¡µç¹å» |
| | | |
| | | // æ ç¾é¡µç¹å»äºä»¶ |
| | | const handleTabClick = (tab) => { |
| | | tabName.value = tab.props.name; |
| | | tableData.value = []; |
| | | getList(); |
| | | }; |
| | | |
| | | // åéåå |
| | | const radioChange = (value) => { |
| | | if (value === "taskManage") { |
| | | tableColumns.value = columns.value; |
| | | operationsArr.value = ['edit'] |
| | | operationsArr.value = ['edit']; |
| | | } else if (value === "task") { |
| | | tableColumns.value = columns.value; |
| | | operationsArr.value = ['viewFile'] |
| | | operationsArr.value = ['viewFile']; |
| | | } else { |
| | | tableColumns.value = columns1.value; |
| | | operationsArr.value = ['edit'] |
| | | operationsArr.value = ['edit']; |
| | | } |
| | | pageNum.value = 1; |
| | | pageSize.value = 10; |
| | | getList(); |
| | | } |
| | | // ç¹å»æ¥è¯¢ |
| | | }; |
| | | |
| | | // æ¥è¯¢æä½ |
| | | const handleQuery = () => { |
| | | pageNum.value = 1 |
| | | pageSize.value = 10 |
| | | getList() |
| | | } |
| | | pageNum.value = 1; |
| | | pageSize.value = 10; |
| | | getList(); |
| | | }; |
| | | |
| | | // è·ååè¡¨æ°æ® |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | |
| | | const params = { ...queryParams, size: pageSize.value, current: pageNum.value }; |
| | | |
| | | let apiCall; |
| | | if (tabName.value === 'task') { |
| | | if (activeRadio.value === "task") { |
| | | inspectionTaskList({...queryParams, size: pageSize.value, current: pageNum.value}).then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | total.value = res.data.total; |
| | | }) |
| | | } else if (activeRadio.value === "qrCode") { |
| | | qrCodeList({...queryParams, size: pageSize.value, current: pageNum.value}).then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | total.value = res.data.total; |
| | | }) |
| | | } else { |
| | | timingTaskList({...queryParams, size: pageSize.value, current: pageNum.value}).then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | total.value = res.data.total; |
| | | }) |
| | | switch (activeRadio.value) { |
| | | case "task": |
| | | apiCall = inspectionTaskList(params); |
| | | break; |
| | | case "qrCode": |
| | | apiCall = qrCodeList(params); |
| | | break; |
| | | default: |
| | | apiCall = timingTaskList(params); |
| | | } |
| | | } else { |
| | | qrCodeScanRecordList({size: pageSize.value, current: pageNum.value}).then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | total.value = res.data.total; |
| | | }) |
| | | apiCall = qrCodeScanRecordList(params); |
| | | } |
| | | |
| | | |
| | | apiCall.then(res => { |
| | | tableData.value = res.data.records || []; |
| | | total.value = res.data.total || 0; |
| | | }).finally(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | // éç½®æ¥è¯¢ |
| | | const resetQuery = () => { |
| | | Object.keys(queryParams).forEach((key) => { |
| | | if (key !== "pageNum" && key !== "pageSize") { |
| | | for (const key in queryParams) { |
| | | if (!["pageNum", "pageSize"].includes(key)) { |
| | | queryParams[key] = ""; |
| | | } |
| | | }); |
| | | } |
| | | handleQuery(); |
| | | }; |
| | | |
| | | // æ°å¢ãç¼è¾ |
| | | // æ°å¢ / ç¼è¾ |
| | | const handleAdd = (row) => { |
| | | console.log(row) |
| | | const type = row === undefined ? 'add' : 'edit' |
| | | const type = row ? 'edit' : 'add'; |
| | | nextTick(() => { |
| | | if (tabName.value === 'task') { |
| | | if (activeRadio.value === "taskManage") { |
| | | formDia.value?.openDialog(type, row) |
| | | formDia.value?.openDialog(type, row); |
| | | } else if (activeRadio.value === "qrCode") { |
| | | qrCodeDia.value?.openDialog(type, row) |
| | | qrCodeDia.value?.openDialog(type, row); |
| | | } |
| | | } else { |
| | | viewQrCodeFiles.value?.openDialog(row) |
| | | viewQrCodeFiles.value?.openDialog(row); |
| | | } |
| | | }) |
| | | }); |
| | | }; |
| | | |
| | | // æ¥çéä»¶ |
| | | const viewFile = (row) => { |
| | | nextTick(() => { |
| | | viewFiles.value?.openDialog(row) |
| | | }) |
| | | } |
| | | // å é¤ä»»å¡ |
| | | viewFiles.value?.openDialog(row); |
| | | }); |
| | | }; |
| | | |
| | | // å é¤æä½ |
| | | const handleDelete = () => { |
| | | if (selectedRows.value.length === 0) { |
| | | if (!selectedRows.value.length) { |
| | | proxy.$modal.msgWarning("è¯·éæ©è¦å é¤çæ°æ®"); |
| | | return; |
| | | } |
| | | |
| | | const deleteIds = selectedRows.value.map(item => item.id); |
| | | proxy.$modal.confirm('æ¯å¦ç¡®è®¤å 餿鿰æ®é¡¹ï¼').then(function() { |
| | | if (activeRadio.value === "taskManage") { |
| | | return delTimingTask(deleteIds) |
| | | } else { |
| | | return delQrCode(deleteIds) |
| | | } |
| | | const api = activeRadio.value === "taskManage" ? delTimingTask : delQrCode; |
| | | |
| | | proxy.$modal.confirm('æ¯å¦ç¡®è®¤å 餿鿰æ®é¡¹ï¼').then(() => { |
| | | return api(deleteIds); |
| | | }).then(() => { |
| | | handleQuery() |
| | | proxy.$modal.msgSuccess("å 餿å") |
| | | }).catch(() => {}) |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | handleQuery(); |
| | | }).catch(() => {}); |
| | | }; |
| | | // éæ©è¡ |
| | | |
| | | // å¤éåæ´ |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection; |
| | | }; |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="é宿¥æ" prop="saleDate"> |
| | | <el-date-picker |
| | | :disabled="operationType === 'view'" |
| | | v-model="form.saleDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客æ·" prop="customerId"> |
| | | <el-select v-model="form.customerId" placeholder="è¯·éæ©å®¢æ·"> |
| | | <el-select v-model="form.customerId" placeholder="è¯·éæ©å®¢æ·" :disabled="operationType === 'view'"> |
| | | <el-option |
| | | v-for="item in customerOptions" |
| | | :key="item.value" |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç
¤ç§" prop="coalId"> |
| | | <el-select v-model="form.coalId" placeholder="è¯·éæ©ç
¤ç§" @change="setInfo"> |
| | | <el-select v-model="form.coalId" placeholder="è¯·éæ©ç
¤ç§" @change="setInfo" :disabled="operationType === 'view'"> |
| | | <el-option |
| | | v-for="item in coalOptions" |
| | | :key="item.id" |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä½" prop="unit"> |
| | | <el-input v-model="form.unit" placeholder="请è¾å
¥åä½" maxlength="30" /> |
| | | <el-input v-model="form.unit" placeholder="请è¾å
¥åä½" maxlength="30" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºåæ°é" prop="inventoryQuantity"> |
| | | <el-input v-model="form.inventoryQuantity" placeholder="请è¾å
¥é宿°é" maxlength="30" type="number" /> |
| | | <el-input v-model="form.inventoryQuantity" placeholder="请è¾å
¥é宿°é" maxlength="30" type="number" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä»·(å«ç¨)" prop="priceIncludingTax" @change="mathProfit"> |
| | | <el-input v-model="form.priceIncludingTax" placeholder="请è¾å
¥éå®åä»·(å«ç¨)" maxlength="30" type="number" /> |
| | | <el-input v-model="form.priceIncludingTax" placeholder="请è¾å
¥éå®åä»·(å«ç¨)" maxlength="30" type="number" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="é宿°é" prop="saleQuantity" @change="mathProfit"> |
| | | <el-input v-model="form.saleQuantity" placeholder="请è¾å
¥é宿°é" maxlength="30" type="number" /> |
| | | <el-input v-model="form.saleQuantity" placeholder="请è¾å
¥é宿°é" maxlength="30" type="number" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="éå®åä»·(å«ç¨)" prop="salePrice" @change="mathProfit"> |
| | | <el-input v-model="form.salePrice" placeholder="请è¾å
¥éå®åä»·(å«ç¨)" maxlength="30" type="number" /> |
| | | <el-input v-model="form.salePrice" placeholder="请è¾å
¥éå®åä»·(å«ç¨)" maxlength="30" type="number" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="é宿»ä»·(å«ç¨)" prop="totalAmount"> |
| | | <el-input v-model="form.totalAmount" placeholder="请è¾å
¥é宿»ä»·(å«ç¨)" maxlength="30" type="number" /> |
| | | <el-input v-model="form.totalAmount" placeholder="请è¾å
¥é宿»ä»·(å«ç¨)" maxlength="30" type="number" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è¿è´¹" prop="freight"> |
| | | <el-input v-model="form.freight" placeholder="请è¾å
¥é宿»ä»·(å«ç¨)" maxlength="30" type="number" /> |
| | | <el-input v-model="form.freight" placeholder="请è¾å
¥é宿»ä»·(å«ç¨)" maxlength="30" type="number" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è´éç
¤ç¨ç(%)" prop="taxCoal"> |
| | | <el-input v-model="form.taxCoal" placeholder="请è¾å
¥é宿»ä»·(å«ç¨)" maxlength="30" type="number" /> |
| | | <el-input v-model="form.taxCoal" placeholder="请è¾å
¥é宿»ä»·(å«ç¨)" maxlength="30" type="number" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è¿è¾ç¨ç(%)" prop="taxTrans"> |
| | | <el-input v-model="form.taxTrans" placeholder="请è¾å
¥é宿»ä»·(å«ç¨)" maxlength="30" type="number" /> |
| | | <el-input v-model="form.taxTrans" placeholder="请è¾å
¥é宿»ä»·(å«ç¨)" maxlength="30" type="number" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¯å©æ¶¦" prop="grossProfit"> |
| | | <el-input v-model="form.grossProfit" placeholder="æ¯å©æ¶¦" maxlength="30" type="number" /> |
| | | <el-input v-model="form.grossProfit" placeholder="æ¯å©æ¶¦" maxlength="30" type="number" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å婿¶¦" prop="netProfit"> |
| | | <el-input v-model="form.netProfit" placeholder="å婿¶¦" maxlength="30" type="number" /> |
| | | <el-input v-model="form.netProfit" placeholder="å婿¶¦" maxlength="30" type="number" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openDialog = async (type, row) => { |
| | | operationType.value = type |
| | | dialogVisitable.value = true |
| | | form.value.saleDate = proxy.getCurrentDate() |
| | | const [supplyRes, coalRes] = await Promise.all([ |
| | |
| | | form.value.taxCoal = 13 |
| | | form.value.taxTrans = 9 |
| | | form.value.freight = 20 |
| | | if (type === 'edit') { |
| | | if (type !== 'add') { |
| | | form.value = {...row} |
| | | } |
| | | } |
| | |
| | | </el-tabs> |
| | | <!-- æä½æé®åº --> |
| | | <el-space> |
| | | <el-button type="primary" :icon="Plus" @click="openDia()">æ°å»º</el-button> |
| | | <el-button type="primary" :icon="Plus" @click="openDia(undefined, 'add')">æ°å»º</el-button> |
| | | <el-button type="danger" :icon="Delete" @click="handleDelete">å é¤</el-button> |
| | | <!-- <el-button type="info" plain :icon="Download" @click="handleExport">导åº</el-button> --> |
| | | </el-space> |
| | |
| | | @selection-change="handleSelectionChange" |
| | | :show-selection="true" |
| | | :border="true" |
| | | :operations="operationsArr" |
| | | style="width: 100%;height: calc(100vh - 30em)" |
| | | @edit="openDia"></ETable> |
| | | @edit="(row) => openDia(row, 'edit')" |
| | | @viewRow="(row) => openDia(row, 'view')" |
| | | ></ETable> |
| | | </div> |
| | | <pagination |
| | | v-if="total>0" |
| | |
| | | { name: "out", label: "éå®åºåº" }, |
| | | ]); |
| | | // è¡¨æ ¼æ°æ® |
| | | const operationsArr = ref(['edit', 'viewRow']); |
| | | const tableLoading = ref(false); |
| | | const tableData = ref([]); |
| | | const columns = ref([ |
| | |
| | | handleQuery(); |
| | | }; |
| | | // æ°å¢åºåº |
| | | const openDia = (row) => { |
| | | const openDia = (row, type) => { |
| | | console.log(row) |
| | | const type = row === undefined ? 'add' : 'edit' |
| | | nextTick(() => { |
| | | formDia.value?.openDialog(type, row) |
| | | }) |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="registrant" label="ç»è®°äºº" width="180"/> |
| | | <el-table-column prop="registrationDate" label="ç»è®°æ¥æ" width="180"/> |
| | | <el-table-column fixed="right" label="æä½" min-width="60" align="center"> |
| | | <el-table-column fixed="right" label="æä½" min-width="100" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" @click="reviewDia(scope.row)" v-if="activeTab !== 'officialInventory'">å®¡æ ¸</el-button> |
| | | <el-button link type="primary" size="small" @click="mergeRows('edit', scope.row)" v-else>ç¼è¾</el-button> |
| | | <el-button link type="primary" size="small" @click="mergeRows('edit', scope.row)" v-if="activeTab === 'officialInventory'">ç¼è¾</el-button> |
| | | <el-button link type="primary" size="small" @click="mergeRows('view', scope.row)" v-if="activeTab === 'officialInventory'">详æ
</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¾åºååç§°" prop="supplierId"> |
| | | <el-select v-model="mergeForm.supplierId" placeholder="è¯·éæ©ä¾åºå"> |
| | | <el-select v-model="mergeForm.supplierId" placeholder="è¯·éæ©ä¾åºå" :disabled="operationType === 'view'"> |
| | | <el-option :label="item.label" v-for="item in supplyList" :key="item.value" :value="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç
¤ç§" prop="coalId"> |
| | | <el-select v-model="mergeForm.coalId" placeholder="è¯·éæ©ç
¤ç§"> |
| | | <el-select v-model="mergeForm.coalId" placeholder="è¯·éæ©ç
¤ç§" :disabled="operationType === 'view'"> |
| | | <el-option :label="item.label" v-for="item in coalList" :key="item.value" :value="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä½" prop="unit"> |
| | | <el-input v-model="mergeForm.unit" placeholder="请è¾å
¥åä½" maxlength="30" /> |
| | | <el-input v-model="mergeForm.unit" placeholder="请è¾å
¥åä½" maxlength="30" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åºåæ°é" prop="inventoryQuantity"> |
| | | <el-input v-model="mergeForm.inventoryQuantity" placeholder="请è¾å
¥åºåæ°é" :max="inventoryQuantity" type="number"/> |
| | | <el-input v-model="mergeForm.inventoryQuantity" placeholder="请è¾å
¥åºåæ°é" :max="inventoryQuantity" type="number" :disabled="operationType === 'view'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä»·(å«ç¨)" prop="priceIncludingTax"> |
| | | <el-input v-model="mergeForm.priceIncludingTax" placeholder="请è¾å
¥åä»·(å«ç¨)" maxlength="30" /> |
| | | <el-input v-model="mergeForm.priceIncludingTax" placeholder="请è¾å
¥åä»·(å«ç¨)" maxlength="30" :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ»ä»·(å«ç¨)" prop="totalPriceIncludingTax"> |
| | | <el-input v-model="mergeForm.totalPriceIncludingTax" placeholder="请è¾å
¥æ»ä»·(å«ç¨)" maxlength="30" /> |
| | | <el-input v-model="mergeForm.totalPriceIncludingTax" placeholder="请è¾å
¥æ»ä»·(å«ç¨)" maxlength="30" :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä»·(ä¸å«ç¨)" prop="priceExcludingTax"> |
| | | <el-input v-model="mergeForm.priceExcludingTax" placeholder="请è¾å
¥åä»·(ä¸å«ç¨)" maxlength="30" /> |
| | | <el-input v-model="mergeForm.priceExcludingTax" placeholder="请è¾å
¥åä»·(ä¸å«ç¨)" maxlength="30" :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ»ä»·(ä¸å«ç¨)" prop="totalPriceExcludingTax"> |
| | | <el-input v-model="mergeForm.totalPriceExcludingTax" placeholder="请è¾å
¥æ»ä»·(ä¸å«ç¨)" maxlength="30" /> |
| | | <el-input v-model="mergeForm.totalPriceExcludingTax" placeholder="请è¾å
¥æ»ä»·(ä¸å«ç¨)" maxlength="30" :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç
¤è´¨æ¹æ¡" prop="coalPlanId"> |
| | | <el-select v-model="mergeForm.coalPlanId" placeholder="è¯·éæ©" @change="coalPlanByIdList" clearable> |
| | | <el-select v-model="mergeForm.coalPlanId" placeholder="è¯·éæ©" @change="coalPlanByIdList" clearable :disabled="operationType === 'view'"> |
| | | <el-option |
| | | v-for="dict in qualityPlanOption" |
| | | :key="dict.id" |
| | |
| | | <el-row> |
| | | <el-col :span="12" v-for="item in filteredList" :key="item.id"> |
| | | <el-form-item :label="item.fieldName"> |
| | | <el-input v-model="mergeForm[item.fields]" /> |
| | | <el-input v-model="mergeForm[item.fields]" :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | coalPlanListOptions() |
| | | mergeVisible.value = true; |
| | | operationType.value = type; |
| | | if (type === 'edit') { |
| | | if (type !== 'merge') { |
| | | mergeForm.value = {...row} |
| | | } else { |
| | | if (selectedRows.value.length < 2) { |