¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-drawer |
| | | :title="title" |
| | | :width="drawerWidth" |
| | | :visible="visible" |
| | | @close="handleCancel" |
| | | :confirmLoading="confirmLoading" |
| | | :maskClosable="maskClosable" |
| | | > |
| | | <a-card :style="getBackground()"> |
| | | <template> |
| | | <a-card> |
| | | <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> |
| | | <a-row :style="{textAlign:'left'}"> |
| | | <a-button |
| | | :style="{marginRight: '8px'}" |
| | | @click="handleSW" |
| | | :disabled=SWbuttonDistable |
| | | type="primary" |
| | | v-has="'dailyInspectionOrder:SW'" |
| | | >å¼å·¥</a-button> |
| | | <a-button |
| | | :style="{marginRight: '8px'}" |
| | | @click="handleReport" |
| | | :disabled="buttonDistable" |
| | | type="primary" |
| | | v-has="'dailyInspectionOrder:report'" |
| | | >æ¥å·¥</a-button> |
| | | <a-button |
| | | :style="{marginRight: '8px'}" |
| | | @click="handleReset" |
| | | :disabled="revocationDistable" |
| | | type="primary" |
| | | v-has="'dailyInspectionOrder:reset'" |
| | | >æ¤é</a-button> |
| | | </a-row> |
| | | </div> |
| | | <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="6"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="设å¤ç¼ç " |
| | | class="hightColor" |
| | | > |
| | | <span |
| | | v-if="this.model != null" |
| | | class="hightColor" |
| | | >{{ this.model.equipmentNum }}</span> |
| | | <span |
| | | v-else |
| | | class="frozenRowClass" |
| | | >-</span> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="设å¤åç§°" |
| | | class="hightColor" |
| | | > |
| | | <span |
| | | v-if="this.model != null" |
| | | class="hightColor" |
| | | >{{ this.model.equipmentName }}</span> |
| | | <span |
| | | v-else |
| | | class="frozenRowClass" |
| | | >-</span> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="è§æ ¼" |
| | | class="hightColor" |
| | | > |
| | | <span |
| | | v-if="this.model != null" |
| | | class="hightColor" |
| | | >{{ this.model.specification }}</span> |
| | | <span |
| | | v-else |
| | | class="frozenRowClass" |
| | | >-</span> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="åå·" |
| | | class="hightColor" |
| | | > |
| | | <span |
| | | v-if="this.model != null" |
| | | class="hightColor" |
| | | >{{ this.model.equipmentModel }}</span> |
| | | <span |
| | | v-else |
| | | class="frozenRowClass" |
| | | >-</span> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </div> |
| | | |
| | | <a-tabs |
| | | type="card" |
| | | defaultActiveKey="1" |
| | | > |
| | | <a-tab-pane |
| | | tab='ç¹æ£æç»' |
| | | key="1" |
| | | class="hightColor" |
| | | > |
| | | |
| | | <div> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | @change="handleTableChange" |
| | | :scroll="{ x: 'calc(1200px + 50%)', y: 900 }" |
| | | > |
| | | <template |
| | | v-for="col in columns" |
| | | :slot="col.dataIndex" |
| | | slot-scope='text, record, index' |
| | | > |
| | | <div :key="col.dataIndex"> |
| | | <span |
| | | v-if=" col.dataIndex == 'photo' && !text" |
| | | style="font-size: 12px;font-style: italic;" |
| | | >æ å¾ç</span> |
| | | <img |
| | | v-if="col.dataIndex == 'photo' && text" |
| | | :src="getImgView(text)" |
| | | :preview="record.inspectionStandardDetailId" |
| | | height="25px" |
| | | alt="" |
| | | style="max-width:80px;font-size: 12px;font-style: italic;" |
| | | /> |
| | | <a-select |
| | | v-if="col.dataIndex == 'inspectionProjectResult' && record.testValueType == '2'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | style="width: 100%" |
| | | :disabled="record.disabled" |
| | | > |
| | | <!-- :options="record.inspectionCycles" --> |
| | | <a-select-option value="1">æ£å¸¸</a-select-option> |
| | | <a-select-option value="2">å¼å¸¸</a-select-option> |
| | | </a-select> |
| | | <a-input-number |
| | | :value="text" |
| | | v-if="col.dataIndex == 'inspectionProjectResult' && record.testValueType == '1'" |
| | | :min="0" |
| | | :max="20000" |
| | | @change="(e)=>handleChange(e, record.key, col, index,record)" |
| | | style="width: 100%" |
| | | :disabled="record.disabled" |
| | | /> |
| | | <a-textarea |
| | | :value="text" |
| | | v-if="col.dataIndex == 'abnormalDesc'" |
| | | :maxLength="500" |
| | | auto-size |
| | | placeholder="请è¾å
¥å¼å¸¸æè¿°" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | :disabled="record.disabled" |
| | | /> |
| | | <a-select |
| | | v-if="col.dataIndex == 'treatmentMeasure'" |
| | | :value="text" |
| | | :options="record.treatmentMeasures" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | style="width: 100%" |
| | | :disabled="record.disabled" |
| | | /> |
| | | |
| | | <j-image-upload |
| | | :value="text" |
| | | v-if="col.dataIndex == 'abnormalPhoto'" |
| | | :isMultiple="false" |
| | | auto-size |
| | | placeholder="请ä¸ä¼ å¾ç" |
| | | @change="(e)=>handleChange(e, record.key, col, index)" |
| | | :disabled="record.disabled" |
| | | > |
| | | </j-image-upload> |
| | | |
| | | <!-- <Tooltip |
| | | placement="top" |
| | | title="é¢è§å¾ç" |
| | | > |
| | | <img |
| | | v-if=" col.dataIndex == 'action' && record.upload.path && (record.upload.format.toLowerCase()=='jpg'||record.upload.format.toLowerCase()=='bmp'||record.upload.format.toLowerCase()=='png'||record.upload.format.toLowerCase()=='jpeg'||record.upload.format.toLowerCase()=='gif')" |
| | | width="30" |
| | | height="14" |
| | | border="1" |
| | | draggable="false" |
| | | preview="1" |
| | | :preview-text="''" |
| | | :src="record.upload.src" |
| | | /> |
| | | </Tooltip> |
| | | |
| | | <a |
| | | v-if=" col.dataIndex == 'action' && record.upload.path && record.upload.format.toLowerCase()=='pdf'" |
| | | href="javascript:;" |
| | | @click="view(record.upload)" |
| | | > |
| | | é¢è§ |
| | | </a> |
| | | |
| | | <a-divider |
| | | v-if=" col.dataIndex == 'action' && record.upload.path && (record.upload.format.toLowerCase()=='jpg'||record.upload.format.toLowerCase()=='bmp'||record.upload.format.toLowerCase()=='png'||record.upload.format.toLowerCase()=='jpeg'||record.upload.format.toLowerCase()=='gif'||record.upload.format.toLowerCase()=='pdf')" |
| | | type="vertical" |
| | | /> |
| | | <a |
| | | v-if=" col.dataIndex == 'action'" |
| | | href="javascript:;" |
| | | @click="handleUpload(record)" |
| | | :disabled="record.disabled" |
| | | >ä¸ä¼ </a> |
| | | |
| | | <a-divider |
| | | v-if=" col.dataIndex == 'action' && record.upload.path && (record.upload.format.toLowerCase()=='jpg'||record.upload.format.toLowerCase()=='bmp'||record.upload.format.toLowerCase()=='png'||record.upload.format.toLowerCase()=='jpeg'||record.upload.format.toLowerCase()=='gif'||record.upload.format.toLowerCase()=='pdf')" |
| | | type="vertical" |
| | | /> |
| | | <a |
| | | v-if=" col.dataIndex == 'action' && record.upload.path" |
| | | href="javascript:;" |
| | | @click="handleDownload(record)" |
| | | :disabled="record.disabled" |
| | | >ä¸è½½</a> --> |
| | | </div> |
| | | |
| | | </template> |
| | | </a-table> |
| | | </div> |
| | | </a-tab-pane> |
| | | |
| | | </a-tabs> |
| | | </a-card> |
| | | </template> |
| | | </a-card> |
| | | |
| | | <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> |
| | | <a-row :style="{textAlign:'right'}"> |
| | | <a-button |
| | | :style="{marginRight: '8px'}" |
| | | @click="handleCancel" |
| | | > |
| | | åæ¶ |
| | | </a-button> |
| | | <a-button |
| | | :style="{marginRight: '8px'}" |
| | | @click="handleTS" |
| | | :disabled="buttonDistable" |
| | | type="primary" |
| | | v-has="'dailyInspectionOrder:TS'" |
| | | >æå</a-button> |
| | | <a-button |
| | | @click="handleOk" |
| | | :disabled="buttonDistable" |
| | | type="primary" |
| | | v-has="'dailyInspectionOrder:save'" |
| | | >ä¿å</a-button> |
| | | </a-row> |
| | | </div> |
| | | |
| | | <pdf-view ref="pdfview"></pdf-view> |
| | | <upload-model |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></upload-model> |
| | | </a-drawer> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { requestPut, getAction, downFile } from '@/api/manage' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import UploadModel from './UploadModel' |
| | | import { preview } from 'vue-photo-preview' |
| | | import { ACCESS_TOKEN } from '@/store/mutation-types' |
| | | import Vue from 'vue' |
| | | import PdfView from '@views/common/PdfView' |
| | | import { getFileAccessHttpUrl } from '@/api/manage'; |
| | | |
| | | export default { |
| | | name: 'DailyMaintenanceOrderExeDrawer', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | PdfView, |
| | | preview, |
| | | Tooltip, |
| | | UploadModel |
| | | }, |
| | | data() { |
| | | return { |
| | | title: "æ¥å¸¸ç¹æ£å·¥åæ§è¡", |
| | | visible: false, |
| | | maskClosable: true, |
| | | confirmLoading: false, |
| | | drawerWidth: "100%", |
| | | buttonDistable: false, |
| | | SWbuttonDistable: false, |
| | | revocationDistable: false, |
| | | dataSource: [], |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | }, |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | width: 50, |
| | | }, |
| | | { |
| | | title: 'é¨ä½', |
| | | align: 'center', |
| | | dataIndex: 'location', |
| | | }, |
| | | // class: "notshow" |
| | | { |
| | | title: '示æå¾', |
| | | align: 'center', |
| | | dataIndex: 'photo', |
| | | scopedSlots: { customRender: 'photo' }, |
| | | }, |
| | | // class: "notshow" |
| | | { |
| | | title: 'ç¹æ£é¡¹ç®', |
| | | align: 'center', |
| | | dataIndex: 'inspectionProjectId_dictText', |
| | | }, |
| | | { |
| | | title: 'æ£æµæ å', |
| | | align: 'center', |
| | | dataIndex: 'detectionStandard', |
| | | }, |
| | | { |
| | | title: 'åæ ¼èå´', |
| | | align: 'center', |
| | | dataIndex: 'acceptabilityLimit', |
| | | }, |
| | | { |
| | | title: 'æ¹æ³', |
| | | align: 'center', |
| | | dataIndex: 'inspectionMethod_dictText', |
| | | }, |
| | | { |
| | | title: 'å·¥å
·', |
| | | align: 'center', |
| | | dataIndex: 'inspectionTool', |
| | | }, |
| | | { |
| | | title: '*ç¹æ£ç»æ', |
| | | align: 'center', |
| | | dataIndex: 'inspectionProjectResult', |
| | | scopedSlots: { customRender: 'inspectionProjectResult' }, |
| | | className: 'red', |
| | | }, |
| | | { |
| | | title: 'å¤å®', |
| | | align: 'center', |
| | | dataIndex: 'judgmentResult', |
| | | customRender: (text) => { |
| | | if (text == 'pass') { |
| | | return "æ£å¸¸"; |
| | | } else if (text == 'fail') { |
| | | return "å¼å¸¸"; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | title: 'å¼å¸¸æè¿°', |
| | | align: 'center', |
| | | dataIndex: 'abnormalDesc', |
| | | scopedSlots: { customRender: 'abnormalDesc' }, |
| | | }, |
| | | // { |
| | | // title: 'å¼å¸¸æç
§', |
| | | // align: 'center', |
| | | // dataIndex: 'abnormalPhoto', |
| | | // scopedSlots: { customRender: 'abnormalPhoto' }, |
| | | // }, |
| | | { |
| | | title: '*å¼å¸¸å¤ç½®', |
| | | align: 'center', |
| | | dataIndex: 'treatmentMeasure', |
| | | className: 'red', |
| | | scopedSlots: { customRender: 'treatmentMeasure' }, |
| | | }, |
| | | ], |
| | | url: { |
| | | list: "/eam/inspectionOrderDetail/list", |
| | | // save: "/eam/specialtyInspectionOrderDetail/save", |
| | | edit: "/eam/inspectionOrderDetail/edit", |
| | | urlDownload: window._CONFIG['staticDomainURL'], |
| | | download: '/sys/upload/downloadFile', |
| | | editStatus: "/eam/inspectionOrder/editStatus", |
| | | revocation: "/eam/inspectionOrder/revocation", |
| | | report: "/eam/inspectionOrder/report", |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('closeDrawer', (data) => { |
| | | this.visible = false; |
| | | }) |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | |
| | | handleShow(record) { |
| | | this.model = Object.assign({}, record); |
| | | this.dataSource = [] |
| | | this.visible = true; |
| | | this.queryParam.inspectionOrderId = record.id |
| | | this.loadData1(1) |
| | | }, |
| | | loadData1(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error("请设置url.list屿§!") |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | // for (let i = 0; i < res.result.records.length; i++) { |
| | | // let r = res.result.records[i].upload; |
| | | // r.src = this.getSrc(res.result.records[i].upload); |
| | | // let p = res.result.records[i].sketchPhoto; |
| | | // p.srcP = this.getSrc(res.result.records[i].sketchPhoto); |
| | | // } |
| | | //update-begin---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | this.dataSource = res.result.records || res.result; |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total; |
| | | } else { |
| | | this.ipagination.total = 0; |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | modalFormOk() { |
| | | //æ¸
空å表éä¸ |
| | | this.onClearSelected() |
| | | this.loadData1(1) |
| | | }, |
| | | loadData() { |
| | | this.loadData1(1) |
| | | }, |
| | | getBackground() { |
| | | return "background-color:rgba(127, 127, 127,0.08)"; |
| | | }, |
| | | handleCancel() { |
| | | this.$emit('ok'); |
| | | this.alterFlag = new Date(); |
| | | this.close() |
| | | }, |
| | | close() { |
| | | this.visible = false; |
| | | }, |
| | | |
| | | handleUpload: function (record) { |
| | | this.$refs.modalForm.edit(record); |
| | | this.$refs.modalForm.title = "æä»¶ä¸ä¼ "; |
| | | this.$refs.modalForm.disableSubmit = false; |
| | | }, |
| | | //æå |
| | | handleTS() { |
| | | const that = this; |
| | | that.confirmLoading = true; |
| | | let formData = Object.assign(this.model); |
| | | formData.inspectionOrderDetails = that.dataSource |
| | | requestPut(this.url.edit, formData).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success("æåæå!"); |
| | | that.$emit('ok'); |
| | | that.alterFlag = new Date(); |
| | | that.loadData1(1) |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | // that.close(); |
| | | }) |
| | | }, |
| | | //å¼å·¥ |
| | | handleSW() { |
| | | const that = this; |
| | | that.confirmLoading = true; |
| | | this.$confirm({ |
| | | title: 'ç¹æ£å·¥åå¼å·¥', |
| | | content: 'æç¤ºï¼å¼å·¥åæ æ³æ¤åï¼è¯·è°¨æ
æä½ï¼', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk() { |
| | | requestPut(that.url.editStatus, { id: that.model.id, status: '4' }).then((res) => { |
| | | if (res.success) { |
| | | that.model.status = '4' |
| | | that.$message.success("å·¥åå¼å·¥æåï¼") |
| | | that.buttonDistable = false |
| | | that.revocationDistable = true |
| | | that.SWbuttonDistable = true |
| | | that.loadData1(1) |
| | | } else { |
| | | that.$message.warning("å·¥åå¼å·¥å¤±è´¥ï¼") |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | // that.close(); |
| | | }) |
| | | }, |
| | | }) |
| | | }, |
| | | //æ¥å·¥ |
| | | handleReport() { |
| | | const that = this; |
| | | that.confirmLoading = true; |
| | | let formData = Object.assign(this.model); |
| | | for (let i = 0; i < that.dataSource.length; i++) { |
| | | let o = this.dataSource[i] |
| | | if (o.inspectionProjectResult == null || o.inspectionProjectResult == '') { |
| | | that.$message.warning('请è¾å
¥ç¹æ£ç»æï¼') |
| | | that.confirmLoading = false; |
| | | return |
| | | } |
| | | if (o.treatmentMeasure == null || o.treatmentMeasure == '') { |
| | | that.$message.warning('è¯·éæ©å¼å¸¸å¤ç½®ï¼') |
| | | that.confirmLoading = false; |
| | | return |
| | | } |
| | | } |
| | | formData.inspectionOrderDetailList = that.dataSource; |
| | | formData.id = that.model.id; |
| | | formData.status = "5"; |
| | | formData.equipmentId = that.model.equipmentId; |
| | | this.$confirm({ |
| | | title: 'ç¹æ£å·¥åæ¥å·¥', |
| | | content: 'æç¤ºï¼æ¥å·¥åç¹æ£å·¥åå®å·¥ï¼è¯·è°¨æ
æä½ï¼', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk() { |
| | | requestPut(that.url.report, formData).then((res) => { |
| | | if (res.success) { |
| | | that.model.status = '5' |
| | | that.$message.success(res.message) |
| | | that.buttonDistable = false |
| | | that.revocationDistable = true |
| | | that.SWbuttonDistable = true |
| | | that.$emit('ok'); |
| | | that.alterFlag = new Date(); |
| | | that.close(); |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | // |
| | | }) |
| | | }, |
| | | }) |
| | | }, |
| | | |
| | | //ä¿å |
| | | handleOk() { |
| | | const that = this; |
| | | that.confirmLoading = true; |
| | | let formData = Object.assign(this.model); |
| | | for (let i = 0; i < that.dataSource.length; i++) { |
| | | let o = this.dataSource[i] |
| | | if (o.inspectionProjectResult == null || o.inspectionProjectResult == '') { |
| | | that.$message.warning('请è¾å
¥ç¹æ£ç»æï¼') |
| | | that.confirmLoading = false; |
| | | return |
| | | } |
| | | if (o.treatmentMeasure == null || o.treatmentMeasure == '') { |
| | | that.$message.warning('è¯·éæ©å¼å¸¸å¤ç½®ï¼') |
| | | that.confirmLoading = false; |
| | | return |
| | | } |
| | | } |
| | | formData.inspectionOrderDetails = that.dataSource |
| | | requestPut(this.url.edit, formData).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success("ä¿åæå!"); |
| | | that.$emit('ok'); |
| | | that.alterFlag = new Date(); |
| | | that.loadData1(1) |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | // that.close(); |
| | | }) |
| | | }, |
| | | //æ¤é |
| | | handleReset() { |
| | | const that = this; |
| | | that.confirmLoading = true; |
| | | this.$confirm({ |
| | | title: 'å®å·¥æ¤é', |
| | | content: 'æç¤ºï¼å®å·¥æ¤éåå¯ç»§ç»æ¥å·¥æä½ï¼', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk() { |
| | | requestPut(that.url.revocation, { id: that.model.id, status: '4' }).then((res) => { |
| | | if (res.success) { |
| | | that.model.status = '4' |
| | | that.$message.success(res.message) |
| | | that.buttonDistable = false |
| | | that.revocationDistable = true |
| | | that.SWbuttonDistable = true |
| | | that.loadData1(1) |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | // that.close(); |
| | | }) |
| | | }, |
| | | }) |
| | | }, |
| | | |
| | | handleChange(value, key, column, index) { |
| | | let that = this; |
| | | const temp = [...that.dataSource]; |
| | | const target = temp.filter(item => key === item.key)[index]; |
| | | if (target) { |
| | | |
| | | if (column.dataIndex == 'inspectionProjectResult') { |
| | | if (target.testValueType === "1") { |
| | | target[column.dataIndex] = value; |
| | | let maxValue = target.maxValue |
| | | let minValue = target.minValue |
| | | if (value > minValue && value < maxValue) { |
| | | target['judgmentResult'] = "pass"; |
| | | } else { |
| | | target['judgmentResult'] = "fail"; |
| | | } |
| | | if (value == null || value == "") { |
| | | target['judgmentResult'] = ""; |
| | | } |
| | | } else { |
| | | target[column.dataIndex] = value; |
| | | if (value == "1") { |
| | | target['judgmentResult'] = "pass"; |
| | | } else { |
| | | target['judgmentResult'] = "fail"; |
| | | } |
| | | if (value == null || value == "") { |
| | | target['judgmentResult'] = ""; |
| | | } |
| | | } |
| | | } |
| | | if (column.dataIndex == 'abnormalDesc') { |
| | | target[column.dataIndex] = value.target.value; |
| | | } |
| | | if (column.dataIndex == 'treatmentMeasure') { |
| | | target[column.dataIndex] = value; |
| | | } |
| | | if ('abnormalPhoto' == column.dataIndex) { |
| | | target['abnormalPhoto'] = value; |
| | | } |
| | | //æ¾ç¤ºå¸¦è¿æ¥çæ°æ® |
| | | that.dataSource = temp; |
| | | } |
| | | }, |
| | | |
| | | view(record) { |
| | | this.$refs.pdfview.showPdf(record.src); |
| | | }, |
| | | |
| | | handleDownload(record) { |
| | | downFile(this.url.download, { id: record.upload.id }).then((res) => { |
| | | if (!res) { |
| | | this.$message.warning('æä»¶ä¸è½½å¤±è´¥') |
| | | return |
| | | } else { |
| | | let fileName = record.upload.name; |
| | | if (typeof window.navigator.msSaveBlob !== 'undefined') { |
| | | window.navigator.msSaveBlob(new Blob([res]), fileName); |
| | | } else { |
| | | let url = window.URL.createObjectURL(new Blob([res])); |
| | | let link = document.createElement('a'); |
| | | link.style.display = 'none'; |
| | | link.href = url; |
| | | link.setAttribute('download', fileName); |
| | | document.body.appendChild(link); |
| | | link.click() |
| | | document.body.removeChild(link) //ä¸è½½å®æç§»é¤å
ç´ |
| | | window.URL.revokeObjectURL(url) //éæ¾æblob对象 |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | getSrc(record) { |
| | | if (!record.path) { |
| | | return ''; |
| | | } |
| | | //æ¬å°ï¼local\Minioï¼minio\é¿éäºï¼alioss |
| | | if (record.uploadType == 'local') { |
| | | |
| | | let ssoLoginFlag = Vue.ls.get("ssoLoginFlag"); |
| | | let deployMode = Vue.ls.get("deployMode"); |
| | | |
| | | if (ssoLoginFlag && deployMode == "container") { |
| | | var baseProject = Vue.ls.get("baseProject"); |
| | | console.log("baseProject==>" + baseProject) |
| | | |
| | | var hostname = window.location.protocol + "//" + window.location.host; |
| | | var url = hostname + '/' + baseProject + '/sys/common/static'; |
| | | return getFileAccessHttpUrl(record.path + record.encodeName, url, window._CONFIG['hyperTextTransfer']) |
| | | } else { |
| | | //æ ¹æ®åå¸ç¶æä¿®æ¹https æ http |
| | | return getFileAccessHttpUrl(record.path + record.encodeName, this.url.urlDownload, window._CONFIG['hyperTextTransfer']) |
| | | } |
| | | |
| | | } else if (record.uploadType == 'alioss') { |
| | | |
| | | const OSS = require('ali-oss') |
| | | const client = new OSS({ |
| | | // region以æå·ä¸ºä¾ï¼oss-cn-hangzhouï¼ï¼å
¶ä»regionæå®é
æ
åµå¡«åã |
| | | region: window._CONFIG['region'], |
| | | // é¿éäºä¸»è´¦å·AccessKeyæ¥æææAPIçè®¿é®æéï¼é£é©å¾é«ã强ç建议æ¨å建并使ç¨RAMè´¦å·è¿è¡APIè®¿é®ææ¥å¸¸è¿ç»´ï¼è¯·ç»å½RAMæ§å¶å°å建RAMè´¦å·ã |
| | | accessKeyId: window._CONFIG['accessKeyId'], |
| | | accessKeySecret: window._CONFIG['accessKeySecret'], |
| | | bucket: window._CONFIG['bucket'], |
| | | }) |
| | | // object-key表示ä»OSSä¸è½½æä»¶æ¶éè¦æå®å
嫿件åç¼å¨å
ç宿´è·¯å¾ï¼ä¾å¦abc/efg/123.jpgã |
| | | return client.signatureUrl(record.path) |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | .hightColor { |
| | | height: 10%; |
| | | font-weight: bold; |
| | | font-size: 20px; |
| | | color: #1b1e1e; |
| | | } |
| | | .frozenRowClass { |
| | | color: #c9c9c9; |
| | | } |
| | | .fontweight { |
| | | font-weight: bold; |
| | | } |
| | | .hight { |
| | | color: #f5222d; |
| | | } |
| | | /deep/ .red { |
| | | color: red; |
| | | } |
| | | </style> |