From 137bf2c0666b60cfc0d98b1a9ca7ead860ee4e7c Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期三, 28 十月 2026 17:57:29 +0800
Subject: [PATCH] feat(device,supply,satisfaction): 设备计划改造、耗材采购调整与满意度照片上传
---
src/views/CNAS/resourceDemand/device/component/equipmentMaintenance.vue | 393 +++++++++++++++++++++++++------------------------------
1 files changed, 177 insertions(+), 216 deletions(-)
diff --git a/src/views/CNAS/resourceDemand/device/component/equipmentMaintenance.vue b/src/views/CNAS/resourceDemand/device/component/equipmentMaintenance.vue
index 0c661a4..732cf21 100644
--- a/src/views/CNAS/resourceDemand/device/component/equipmentMaintenance.vue
+++ b/src/views/CNAS/resourceDemand/device/component/equipmentMaintenance.vue
@@ -1,62 +1,110 @@
<template>
+ <!-- 璁惧缁存姢淇濆吇锛堝彧璇诲彴璐︼紝璁板綍鐢变繚鍏昏鍒掔敓鎴愶級-->
<div>
<div class="search">
<el-button size="small" type="primary" @click="refreshTableList">鍒锋柊</el-button>
- <el-button size="small" type="primary" @click="openDia('add')">鏂� 寤�</el-button>
<el-button :loading="outLoading" size="small" type="primary" @click="openHandleOut">瀵� 鍑�</el-button>
</div>
<div>
- <lims-table :tableData="tableData" :column="column"
- height="calc(100vh - 20em)" @pagination="pagination"
- :page="page" :tableLoading="tableLoading"></lims-table>
+ <el-table v-loading="tableLoading" :data="tableData" border height="calc(100vh - 20em)" style="width: 100%;">
+ <el-table-column align="center" header-align="center" label="搴忓彿" prop="prop" type="index"
+ width="60"></el-table-column>
+ <el-table-column align="center" header-align="center" label="缁存姢鏃ユ湡" min-width="110">
+ <template #default="scope">{{ formatDate(scope.row.maintenanceDate) }}</template>
+ </el-table-column>
+ <el-table-column align="center" header-align="center" label="缁存姢淇濆吇鍐呭">
+ <el-table-column v-for="item in checkColumns" :key="item.prop" align="center" header-align="center"
+ :label="item.label" width="110">
+ <template #default="scope">{{ scope.row[item.prop] || '鈥�' }}</template>
+ </el-table-column>
+ </el-table-column>
+ <el-table-column align="center" header-align="center" label="缁存姢浜�" min-width="100">
+ <template #default="scope">{{ scope.row.maintenanceUserName || '鈥�' }}</template>
+ </el-table-column>
+ <el-table-column label="瀹℃牳鐘舵��" min-width="100">
+ <template #default="scope">
+ <el-tag v-if="scope.row.recordStatus === 1" type="warning" disable-transitions>寰呭鏍�</el-tag>
+ <el-tag v-else-if="scope.row.recordStatus === 2" type="success" disable-transitions>閫氳繃</el-tag>
+ <el-tag v-else-if="scope.row.recordStatus === 3" type="danger" disable-transitions>涓嶉�氳繃</el-tag>
+ <el-tag v-else type="info" disable-transitions>鍘嗗彶</el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column label="澶囨敞" min-width="140" show-overflow-tooltip>
+ <template #default="scope">{{ scope.row.remark || '鈥�' }}</template>
+ </el-table-column>
+ <el-table-column align="center" fixed="right" label="鎿嶄綔" min-width="120">
+ <template #default="scope">
+ <el-button size="small" link type="primary" @click="handleView(scope.row)">鏌ョ湅</el-button>
+ <el-button v-if="scope.row.recordStatus === 1 || scope.row.recordStatus === 3" size="small" link
+ type="danger" @click="handleDeleteClick(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination :current-page="pagination.current" :page-size="pagination.size"
+ :page-sizes="[10, 20, 30, 50, 100]" background :total="pagination.total"
+ layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
+ @current-change="handleCurrentChange">
+ </el-pagination>
</div>
- <el-dialog v-model="dialogVisible" title="浠櫒璁惧浣跨敤缁存姢淇濆吇琛�" width="55%">
- <el-form ref="form" :model="form" label-width="130px" :rules="rules">
+ <el-dialog :close-on-click-modal="false" v-model="dialogVisible" title="鏌ョ湅淇濆吇璁板綍" width="880px">
+ <el-form :model="form" label-width="150px" size="small">
<el-row>
<el-col :span="12">
- <el-form-item label="缁存姢鏃ユ湡:" prop="maintenanceDate">
- <el-date-picker v-model="form.maintenanceDate" :disabled="operationType === 'view'"
- format="YYYY-MM-DD" size="small" placeholder="閫夋嫨鏃ユ湡" style="width:100%"
- type="date" value-format="YYYY-MM-DD">
- </el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item label="缁存姢鍐呭:" prop="maintenanceContentArr">
- <el-checkbox-group v-if="qualificationList.length" v-model="form.maintenanceContentArr"
- :disabled="operationType === 'view'">
- <el-checkbox v-for="city in qualificationList" :key="city.label" :label="city.label"
- :value="city.label"></el-checkbox>
- </el-checkbox-group>
- <el-input v-else v-model="form.maintenanceContentText" :disabled="operationType === 'view'"
- size="small" placeholder="璇疯緭鍏ョ淮鎶ゅ唴瀹�" style="width: 100%"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="缁存姢浜�:" prop="maintenanceUserId">
- <el-select v-model="form.maintenanceUserId"
- clearable filterable
- placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
- <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
+ <el-form-item label="璁惧鍚嶇О锛�">
+ <el-input v-model="form.deviceName" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="澶囨敞:" prop="remark">
- <el-input v-model="form.remark" :disabled="operationType === 'view'" size="small"
- style="width: 100%;"></el-input>
+ <el-form-item label="璁惧缂栧彿锛�">
+ <el-input v-model="form.managementNumber" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="缁存姢鏃ユ湡锛�">
+ <el-input v-model="form.maintenanceDate" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="缁存姢浜猴細">
+ <el-input v-model="form.maintenanceUserName" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
+ <div class="form-section-title">缁存姢淇濆吇鍐呭</div>
+ <el-row>
+ <el-col v-for="item in checkColumns" :key="item.prop" :span="12">
+ <el-form-item :label="item.label + '锛�'">
+ <el-input v-model="form[item.prop]" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-form-item label="淇濆吇澶囨敞锛�">
+ <el-input v-model="form.remark" :rows="2" disabled type="textarea"></el-input>
+ </el-form-item>
+ <el-form-item label="瀹℃牳鐘舵�侊細">
+ <el-tag v-if="form.recordStatus === 1" type="warning" disable-transitions>寰呭鏍�</el-tag>
+ <el-tag v-else-if="form.recordStatus === 2" type="success" disable-transitions>閫氳繃</el-tag>
+ <el-tag v-else-if="form.recordStatus === 3" type="danger" disable-transitions>涓嶉�氳繃</el-tag>
+ <el-tag v-else type="info" disable-transitions>鍘嗗彶</el-tag>
+ </el-form-item>
+ <el-row v-if="form.reviewUserName || form.reviewTime">
+ <el-col :span="12">
+ <el-form-item label="瀹℃牳浜猴細">
+ <el-input v-model="form.reviewUserName" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瀹℃牳鏃堕棿锛�">
+ <el-input v-model="form.reviewTime" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-form-item v-if="form.reviewRemark" label="瀹℃牳鎰忚锛�">
+ <el-input v-model="form.reviewRemark" :rows="2" disabled type="textarea"></el-input>
+ </el-form-item>
</el-form>
- <template #footer><span class="dialog-footer">
- <el-button @click="closeDia">鍙� 娑�</el-button>
- <el-button v-if="operationType !== 'view'" type="primary" @click="saveRecord" :loading="buttonLoading">纭� 瀹�</el-button>
+ <template #footer><span class="dialog-footer">
+ <el-button @click="dialogVisible = false">鍏� 闂�</el-button>
</span></template>
</el-dialog>
</div>
@@ -64,18 +112,28 @@
<script>
import {
- addDeviceMaintenance,
- deleteDeviceMaintenance, exportDeviceMaintenance,
- selectDeviceMaintenancePage
-} from "@/api/cnas/resourceDemand/device";
-import limsTable from "@/components/Table/lims-table.vue";
-import {selectUserCondition} from "@/api/system/user";
-import {saveBlobOrShowError} from '@/utils/saveBlob'
+ deleteDeviceMaintenance,
+ exportDeviceMaintenance,
+ selectDeviceMaintenancePage,
+} from '@/api/cnas/resourceDemand/device'
+import { formatDateOnly, formatListDate } from './dateFormat'
+import { saveBlobOrShowError } from '@/utils/saveBlob'
+
+// 缁存姢淇濆吇妫�鏌ラ」锛屼笌浠櫒璁惧缁存姢淇濆吇璁板綍琛ㄤ竴鑷�
+const CHECK_ITEMS = [
+ { label: '澶栬鏄惁鑹ソ', prop: 'appearanceGood' },
+ { label: '鏄惁鍙互姝e父浣跨敤', prop: 'normalUse' },
+ { label: '鏄惁娓呮磥浠櫒琛ㄩ潰', prop: 'surfaceClean' },
+ { label: '鏍囪瘑鏄惁瀹屽ソ', prop: 'labelIntact' },
+ { label: '鏄剧ず鍣ㄧ伅鏄惁姝e父', prop: 'displayLightNormal' },
+ { label: '浠櫒鏄惁鐢熼攬', prop: 'noRust' },
+ { label: '鏍″噯鏄惁姝e父', prop: 'calibrationNormal' },
+ { label: '閰嶄欢鏄惁闇�瑕佹洿鎹�', prop: 'partsReplace' },
+ { label: '缁存姢缁撴灉鏄惁姝e父', prop: 'resultNormal' },
+]
export default {
- name: '',
- // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
- components: {limsTable},
+ name: 'equipment-maintenance',
props: {
clickNodeVal: {
type: Object,
@@ -85,170 +143,97 @@
},
},
data() {
- // 杩欓噷瀛樻斁鏁版嵁
return {
- search: {
- maintenanceDate: '',
- },
outLoading: false,
tableData: [],
tableLoading: false,
- page: {
+ pagination: {
total: 0,
size: 20,
- current: 1
+ current: 1,
},
- column: [
- { label: '缁存姢鏃ユ湡', prop: 'maintenanceDate' },
- { label: '缁存姢鍐呭', prop: 'maintenanceContent' },
- { label: '缁存姢浜�', prop: 'maintenanceUserName' },
- { label: '澶囨敞', prop: 'remark' },
- {
- dataType: 'action',
- label: '鎿嶄綔',
- operation: [
- {
- name: '缂栬緫',
- type: 'text',
- clickFun: (row) => {
- this.openDia('edit', row);
- },
- },
- {
- name: '鍒犻櫎',
- type: 'text',
- clickFun: (row) => {
- this.handleDeleteClick(row);
- },
- },
- ]
- }
- ],
+ checkColumns: CHECK_ITEMS.map(item => ({ ...item })),
dialogVisible: false,
- form: {
- id: '',
- deviceId: '',
- maintenanceDate: '',
- maintenanceContentArr: [],
- maintenanceContent: '',
- maintenanceContentText: '',
- maintenanceUserId: '',
- remark: '',
- },
- operationType: '',
- buttonLoading: false,
- qualificationList: [],
- rules: {
- maintenanceDate: [{ required: true, message: '璇烽�夋嫨缁存姢鏃ユ湡', trigger: 'change' }],
- maintenanceContentArr: [{
- validator: (rule, value, callback) => {
- if (this.qualificationList.length) {
- if (!value || value.length === 0) {
- return callback(new Error('璇烽�夋嫨缁存姢鍐呭'))
- }
- } else if (!this.form.maintenanceContentText || !this.form.maintenanceContentText.trim()) {
- return callback(new Error('璇疯緭鍏ョ淮鎶ゅ唴瀹�'))
- }
- callback()
- },
- trigger: 'change'
- }],
- maintenanceUserId: [{ required: true, message: '璇烽�夋嫨缁存姢浜�', trigger: 'change' }],
- },
- responsibleOptions: [],
+ form: {},
};
},
mounted() {
this.refreshTableList()
},
- // 鏂规硶闆嗗悎
methods: {
// 鐐瑰嚮鍒锋柊
- refreshTableList () {
- this.page.current = 1;
+ refreshTableList() {
+ this.pagination.current = 1
this.getTableList()
},
- // 鍒嗛〉鍒囨崲
- pagination(page) {
- this.page.current = page.page
- this.page.size = page.limit
+ formatDate(value) {
+ return formatDateOnly(value) || '鈥�'
+ },
+ // 鍒嗛〉
+ handleSizeChange(val) {
+ this.pagination.size = val
this.getTableList()
},
- getTableList () {
+ // 鍒嗛〉
+ handleCurrentChange(val) {
+ this.pagination.current = val
+ this.getTableList()
+ },
+ getTableList() {
+ if (!this.clickNodeVal.value) {
+ this.tableData = []
+ this.pagination.total = 0
+ return
+ }
this.tableLoading = true
selectDeviceMaintenancePage({
deviceId: this.clickNodeVal.value,
- ...this.page
+ current: this.pagination.current,
+ size: this.pagination.size,
}).then(res => {
this.tableLoading = false
- this.tableData = res.data.records
- this.page.total = res.data.total
- }).catch(err => {
+ if (res.code == 200) {
+ this.tableData = res.data.records || []
+ this.pagination.total = res.data.total || 0
+ }
+ }).catch(() => {
this.tableLoading = false
})
},
- // 鎵撳紑鎿嶄綔寮规
- openDia (type, row) {
- this.operationType = type
- this.dialogVisible = true
- this.$nextTick(() => {
- this.$refs['form'].resetFields()
- this.form.id = ''
- if (this.operationType === 'edit') {
- this.form = {...row}
- this.form['maintenanceContentArr'] = this.form.maintenanceContent ? this.form.maintenanceContent.split(',') : []
- this.form['maintenanceContentText'] = this.form.maintenanceContent || ''
- }
- })
- this.getDictS()
- this.getUserList()
- },
- // 鏌ヨ缁存姢鍐呭閫夋嫨妗嗗唴瀹�
- getDictS () {
- // 瀹氫箟瀹為獙瀹ゅ悕绉颁笌缁存姢鍐呭绫诲瀷鐨勬槧灏勫叧绯�
- const labTypeMapping = {
- '鑰佸寲瀹�': 'aging_maintenance_content',
- '鑰佸寲瀹為獙瀹�': 'aging_maintenance_content',
- '鐢垫�ц兘瀹為獙瀹�': 'electrical_maintenance_content',
- '鐜瀹為獙瀹�': 'environmental_maintenance_content',
- '鐕冪儳瀹為獙瀹�': 'burn_maintenance_content',
- '娣风偧瀹為獙瀹�': 'mixing_maintenance_content',
- '妫�娴嬩腑蹇冪數鎬ц兘瀹為獙瀹�': 'center_electrical_maintenance_content',
- '鎭掓俯浜�': 'temperature2_maintenance_content',
- '鎭掓俯涓�': 'temperature1_maintenance_content',
- '鍖栧瀹為獙瀹�': 'chemistry_maintenance_content',
- '鍒舵牱瀹�': 'sample_maintenance_content',
- '浣庢俯瀹為獙瀹�': 'hypothermia_maintenance_content',
- };
- // 鍙栬澶囧瓨鏀剧偣鍚嶇О浣滀负鏄犲皠閿�
- const name = this.clickNodeVal.storagePoint || '鍏朵粬';
- // 鏍规嵁鏄犲皠鍏崇郴鑾峰彇瀵瑰簲鐨勭被鍨�
- const type = labTypeMapping[name];
- if (!type) {
- this.qualificationList = [];
- return;
+ // 鏌ョ湅淇濆吇璁板綍锛堝彧璇伙級
+ handleView(row) {
+ this.form = {
+ deviceName: row.deviceName || '',
+ managementNumber: row.managementNumber || '',
+ maintenanceDate: formatDateOnly(row.maintenanceDate),
+ maintenanceUserName: row.maintenanceUserName || '',
+ remark: row.remark || '',
+ reviewUserName: row.reviewUserName || '',
+ reviewTime: formatListDate(row.reviewTime) || '',
+ reviewRemark: row.reviewRemark || '',
+ recordStatus: row.recordStatus,
}
- this.getDicts(type).then((response) => {
- this.qualificationList = response.data.map((m) => {
- return {
- label: m.dictLabel,
- value: m.dictValue,
- };
- });
- });
+ this.checkColumns.forEach(item => {
+ this.form[item.prop] = row[item.prop] || ''
+ })
+ this.dialogVisible = true
},
- openHandleOut () {
+ openHandleOut() {
+ if (!this.clickNodeVal.value) {
+ this.$message.warning('璇峰厛閫夋嫨璁惧')
+ return
+ }
this.outLoading = true
exportDeviceMaintenance({
deviceId: this.clickNodeVal.value
}).then(res => {
this.outLoading = false
- saveBlobOrShowError(res, '璁惧缁存姢淇濆吇.doc', 'application/msword')
+ saveBlobOrShowError(res, '浠櫒璁惧缁存姢淇濆吇璁板綍.docx', 'application/msword')
}).catch(() => {
this.outLoading = false
})
-
},
+ // 鍙厑璁稿垹闄ゅ緟瀹℃牳/涓嶉�氳繃鐨勮褰曪紙鍘嗗彶涓庡鏍搁�氳繃璁板綍鐣欐。锛�
handleDeleteClick(row) {
this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ潯淇濆吇璁板綍, 鏄惁缁х画?', '鎻愮ず', {
confirmButtonText: '纭畾',
@@ -260,7 +245,7 @@
type: 'success',
message: '鍒犻櫎鎴愬姛!'
});
- this.refreshTableList()
+ this.getTableList()
})
}).catch(() => {
this.$message({
@@ -269,46 +254,11 @@
});
});
},
- // 鎻愪氦鏂板鍜屼繚瀛�
- saveRecord () {
- this.$refs.form.validate((valid) => {
- if (valid) {
- this.buttonLoading = true;
- this.form.maintenanceContent = this.qualificationList.length
- ? this.form.maintenanceContentArr.join(',')
- : (this.form.maintenanceContentText || '').trim()
- this.form.deviceId = this.clickNodeVal.value
- addDeviceMaintenance(this.form).then(res => {
- this.buttonLoading = false;
- this.$message.success('鏂板鎴愬姛')
- this.closeDia()
- this.getTableList()
- }).catch(err => {
- this.buttonLoading = false;
- })
- }
- })
- },
- closeDia () {
- this.$refs['form'].resetFields();
- this.dialogVisible = false
- this.refreshTableList()
- },
- // 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
- getUserList() {
- selectUserCondition({type: 2}).then(res => {
- if (res.code == 200) {
- this.responsibleOptions = res.data
- }
- })
- },
},
watch: {
// 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
clickNodeVal(newVal) {
- if (newVal.value) {
- this.refreshTableList();
- }
+ this.refreshTableList();
},
}
};
@@ -316,8 +266,19 @@
<style scoped>
.search {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
height: 46px;
- text-align: right;
margin-top: 10px;
}
+
+.form-section-title {
+ font-size: 14px;
+ font-weight: 600;
+ color: var(--lims-text);
+ margin: 4px 0 16px;
+ padding-left: 8px;
+ border-left: 4px solid var(--el-color-primary);
+}
</style>
--
Gitblit v1.9.3