| | |
| | | <a @click.stop="event=>event.stopPropagation()">å é¤</a> |
| | | </a-popconfirm> |
| | | </template> |
| | | |
| | | <template v-if="record.standardStatus != 'WAIT_SUBMIT'"> |
| | | <a-divider type="vertical"/> |
| | | |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a @click.stop="event=>event.stopPropagation()">å é¤</a> |
| | | </a-popconfirm> |
| | | </template> |
| | | </span> |
| | | </a-table> |
| | | |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="1200" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen |
| | | @ok="handleOk" @cancel="handleCancel" cancelText="å
³é"> |
| | | <a-spin :spinning="spinning"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-row :gutter="24"> |
| | |
| | | <a-col :span="8"> |
| | | <a-form-model-item prop="maintenancePeriod" label="ä¿å
»å¨æ"> |
| | | <a-input-number v-model="model.maintenancePeriod" placeholder="请è¾å
¥ä¿å
»å¨æ" :min="1" :precision="0" |
| | | :disabled="model.maintenanceCategory=='POINT_INSPECTION'||model.maintenanceCategory=='SECOND_MAINTENANCE'" |
| | | style="width: 100%"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <j-vxe-table |
| | | ref="editableDetailTable" |
| | | :rowNumber="true" |
| | | :rowSelection="true" |
| | | :bordered="true" |
| | | :alwaysEdit="true" |
| | | :toolbar="true" |
| | | :toolbarConfig="detail.toolbarConfig" |
| | | keep-source |
| | | :height="300" |
| | | :loading="detail.loading" |
| | | :dataSource="detail.dataSource" |
| | | :columns="detail.columns" |
| | | style="margin-top: 8px;"> |
| | | <template v-slot:itemPart="props"> |
| | | <a-textarea v-model="props.row.itemPart" allowClear @blur="$refs.editableDetailTable.validateTable()" |
| | | :placeholder="!Boolean(model.maintenanceCategory)?'è¯·éæ©ä¿å
»åç±»':'请è¾å
¥é¨ä½'" :rows="1" |
| | | autoSize :disabled="!Boolean(model.maintenanceCategory)"/> |
| | | <a-tabs :active-key="activeTabKey" v-if="model.maintenanceCategory" @change="handleTabChange"> |
| | | <!--ç¹æ£--> |
| | | <template v-if="model.maintenanceCategory=='POINT_INSPECTION'"> |
| | | <a-tab-pane tab="æ¥ç¹æ£" key="1" forceRender> |
| | | <j-vxe-table ref="editableDetailTable1" rowNumber rowSelection bordered alwaysEdit toolbar |
| | | :toolbarConfig="detail.toolbarConfig" keep-source :height="300" |
| | | :dataSource="detail.dayInspectionList" :columns="detail.inspectionColumns"/> |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="å¨ç¹æ£" key="2" forceRender> |
| | | <j-vxe-table ref="editableDetailTable2" rowNumber rowSelection bordered alwaysEdit toolbar |
| | | :toolbarConfig="detail.toolbarConfig" keep-source :height="300" |
| | | :dataSource="detail.weekInspectionList" :columns="detail.inspectionColumns"/> |
| | | </a-tab-pane> |
| | | </template> |
| | | |
| | | <template v-slot:itemCategory="props"> |
| | | <j-dict-select-tag v-model="props.row.itemCategory" :dict-code="encodedDictCode" |
| | | @change="$refs.editableDetailTable.validateTable()" |
| | | :placeholder="!Boolean(model.maintenanceCategory)?'è¯·éæ©ä¿å
»åç±»':'è¯·éæ©é¡¹ä¿å
»åç±»'" |
| | | :disabled="!Boolean(model.maintenanceCategory)"/> |
| | | <!--äºä¿--> |
| | | <template v-if="model.maintenanceCategory=='SECOND_MAINTENANCE'"> |
| | | <a-tab-pane tab="æä½å·¥" key="1" forceRender> |
| | | <j-vxe-table ref="editableDetailTable1" rowNumber rowSelection bordered alwaysEdit toolbar |
| | | :toolbarConfig="detail.toolbarConfig" keep-source :height="300" |
| | | :dataSource="detail.operatorMaintenanceList" :columns="detail.secondMaintenanceColumns"/> |
| | | </a-tab-pane> |
| | | <a-tab-pane tab="维修工" key="2" forceRender> |
| | | <j-vxe-table ref="editableDetailTable2" rowNumber rowSelection bordered alwaysEdit toolbar |
| | | :toolbarConfig="detail.toolbarConfig" keep-source :height="300" |
| | | :dataSource="detail.repairerMaintenanceList" :columns="detail.secondMaintenanceColumns"/> |
| | | </a-tab-pane> |
| | | </template> |
| | | </j-vxe-table> |
| | | |
| | | <!--ä¸ä¿--> |
| | | <template v-if="model.maintenanceCategory=='THIRD_MAINTENANCE'"> |
| | | <a-tab-pane tab="ä¸ä¿" key="1"> |
| | | <j-vxe-table ref="editableDetailTable1" rowNumber rowSelection bordered alwaysEdit toolbar |
| | | :toolbarConfig="detail.toolbarConfig" keep-source :height="300" |
| | | :dataSource="detail.thirdMaintenanceList" :columns="detail.thirdMaintenanceColumns"/> |
| | | </a-tab-pane> |
| | | </template> |
| | | </a-tabs> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | |
| | | }, |
| | | confirmLoading: false, |
| | | spinning: false, |
| | | activeTabKey: '1', |
| | | validatorRules: { |
| | | standardName: [ |
| | | { required: true, message: '请è¾å
¥è§èåç§°', trigger: 'change' } |
| | |
| | | upgrade: '/eam/maintenanceStandard/upgrade' |
| | | }, |
| | | detail: { |
| | | loading: false, |
| | | dataSource: [], |
| | | columns: [ |
| | | dayInspectionList: [], |
| | | weekInspectionList: [], |
| | | operatorMaintenanceList: [], |
| | | repairerMaintenanceList: [], |
| | | thirdMaintenanceList: [], |
| | | inspectionColumns: [ |
| | | { |
| | | title: 'ID', |
| | | key: 'id', |
| | |
| | | align: 'center', |
| | | placeholder: '请è¾å
¥é¡¹ç®åºå·', |
| | | width: 150, |
| | | validateRules: [ |
| | | { required: true, message: '请è¾å
¥é¡¹ç®åºå·' }, |
| | | { unique: true, message: '项ç®åºå·ä¸è½éå¤' } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'é¨ä½', |
| | | key: 'itemPart', |
| | | type: JVXETypes.slot, |
| | | slotName: 'itemPart', |
| | | placeholder: '请è¾å
¥é¨ä½', |
| | | align: 'center', |
| | | validateRules: [{ handler: this.itemPartValidate }] |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¡¹åç±»', |
| | | key: 'itemCategory', |
| | | type: JVXETypes.slot, |
| | | slotName: 'itemCategory', |
| | | align: 'center', |
| | | validateRules: [{ handler: this.itemCategoryValidate }] |
| | | validateRules: [{ required: true, message: '请è¾å
¥${title}' }] |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¡¹ç®', |
| | |
| | | placeholder: '请è¾å
¥ä¿å
»é¡¹ç®', |
| | | type: JVXETypes.textarea, |
| | | align: 'center', |
| | | validateRules: [ |
| | | { required: true, message: '请è¾å
¥ä¿å
»é¡¹ç®' } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'ä¿å
»è§èæè¦æ±', |
| | | key: 'itemDemand', |
| | | placeholder: '请è¾å
¥ä¿å
»è§èæè¦æ±', |
| | | type: JVXETypes.textarea, |
| | | align: 'center', |
| | | validateRules: [ |
| | | { required: true, message: '请è¾å
¥ä¿å
»è§èæè¦æ±' } |
| | | ] |
| | | validateRules: [{ required: true, message: '请è¾å
¥${title}' }] |
| | | } |
| | | ], |
| | | defaultColumns: [ |
| | | secondMaintenanceColumns: [ |
| | | { |
| | | title: 'ID', |
| | | key: 'id', |
| | |
| | | align: 'center', |
| | | placeholder: '请è¾å
¥é¡¹ç®åºå·', |
| | | width: 150, |
| | | validateRules: [ |
| | | { required: true, message: '请è¾å
¥é¡¹ç®åºå·' }, |
| | | { unique: true, message: '项ç®åºå·ä¸è½éå¤' } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'é¨ä½', |
| | | key: 'itemPart', |
| | | type: JVXETypes.slot, |
| | | slotName: 'itemPart', |
| | | placeholder: '请è¾å
¥é¨ä½', |
| | | align: 'center', |
| | | validateRules: [{ handler: this.itemPartValidate }] |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¡¹åç±»', |
| | | key: 'itemCategory', |
| | | type: JVXETypes.slot, |
| | | slotName: 'itemCategory', |
| | | align: 'center', |
| | | validateRules: [{ handler: this.itemCategoryValidate }] |
| | | validateRules: [{ required: true, message: '请è¾å
¥${title}' }] |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¡¹ç®', |
| | |
| | | placeholder: '请è¾å
¥ä¿å
»é¡¹ç®', |
| | | type: JVXETypes.textarea, |
| | | align: 'center', |
| | | validateRules: [ |
| | | { required: true, message: '请è¾å
¥ä¿å
»é¡¹ç®' } |
| | | ] |
| | | validateRules: [{ required: true, message: '请è¾å
¥${title}' }] |
| | | }, |
| | | { |
| | | title: 'ä¿å
»è§èæè¦æ±', |
| | |
| | | placeholder: '请è¾å
¥ä¿å
»è§èæè¦æ±', |
| | | type: JVXETypes.textarea, |
| | | align: 'center', |
| | | validateRules: [ |
| | | { required: true, message: '请è¾å
¥ä¿å
»è§èæè¦æ±' } |
| | | ] |
| | | validateRules: [{ required: true, message: '请è¾å
¥${title}' }] |
| | | } |
| | | ], |
| | | thirdMaintenanceColumns: [ |
| | | { |
| | | title: 'ID', |
| | | key: 'id', |
| | | type: JVXETypes.hidden |
| | | }, |
| | | { |
| | | title: 'standardId', |
| | | key: 'standardId', |
| | | type: JVXETypes.hidden |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¨ä½', |
| | | key: 'itemPart', |
| | | type: JVXETypes.textarea, |
| | | slotName: 'itemPart', |
| | | align: 'center', |
| | | validateRules: [{ required: true, message: '请è¾å
¥${title}' }] |
| | | }, |
| | | { |
| | | title: 'ä¿å
Ȍ
容', |
| | | key: 'itemName', |
| | | placeholder: '请è¾å
¥${title}', |
| | | type: JVXETypes.textarea, |
| | | align: 'center', |
| | | validateRules: [{ required: true, message: '请è¾å
¥${title}' }] |
| | | }, |
| | | { |
| | | title: 'éªæ¶æ å', |
| | | key: 'itemDemand', |
| | | placeholder: '请è¾å
¥${title}', |
| | | type: JVXETypes.textarea, |
| | | align: 'center', |
| | | validateRules: [{ required: true, message: '请è¾å
¥${title}' }] |
| | | } |
| | | ], |
| | | toolbarConfig: { |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | watch: { |
| | | 'model.maintenanceCategory': { |
| | | handler(val) { |
| | | if (val) { |
| | | if (val != 'THIRD_MAINTENANCE') this.detail.columns = [...this.detail.defaultColumns.filter(item => item.key != 'itemPart')] |
| | | else this.detail.columns = [...this.detail.defaultColumns.filter(item => item.key != 'itemCategory')] |
| | | } |
| | | else this.detail.columns = [...this.detail.defaultColumns] |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | encodedDictCode() { |
| | | let suffix |
| | | if (!Boolean(this.model.maintenanceCategory) || this.model.maintenanceCategory === 'THIRD_MAINTENANCE') return |
| | | else suffix = this.model.maintenanceCategory.split('_')[1] |
| | | |
| | | const dictCode = `sys_dict_item,item_text,item_value,item_value like '%${suffix}' and dict_id='1940598438685134850'` |
| | | return encodeURIComponent(dictCode) |
| | | } |
| | | }, |
| | | methods: { |
| | | // 主页é¢ç¹å»æ°å¢å触å |
| | | add() { |
| | | this.resetData() |
| | | this.model = {} |
| | | this.visible = true |
| | | this.editable = true |
| | | this.upgradeFlag = false |
| | | this.detail.dataSource = [] |
| | | }, |
| | | |
| | | /** |
| | |
| | | * @param record 主页é¢å表è¡è®°å½ |
| | | */ |
| | | edit(record) { |
| | | this.resetData() |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.editable = false |
| | | this.upgradeFlag = false |
| | | this.detail.dataSource = [] |
| | | this.loadDetail(record.id) |
| | | }, |
| | | |
| | |
| | | * @param record 主页é¢å表è¡è®°å½ |
| | | */ |
| | | upgrade(record) { |
| | | this.resetData() |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.editable = false |
| | | this.upgradeFlag = true |
| | | this.detail.dataSource = [] |
| | | this.loadDetail(record.id) |
| | | }, |
| | | |
| | | //å 载详æ
æ°æ® |
| | | loadDetail(standardId) { |
| | | this.spinning = true |
| | | getAction(this.url.detail, { standardId }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | switch (this.model.maintenanceCategory) { |
| | | case 'POINT_INSPECTION': |
| | | this.detail.dayInspectionList = res.result.filter(item => item.itemCategory == 'DAY_INSPECTION') |
| | | this.detail.weekInspectionList = res.result.filter(item => item.itemCategory == 'WEEK_INSPECTION') |
| | | break |
| | | case 'SECOND_MAINTENANCE': |
| | | this.detail.operatorMaintenanceList = res.result.filter(item => item.itemCategory == 'OPERATOR_MAINTENANCE') |
| | | this.detail.repairerMaintenanceList = res.result.filter(item => item.itemCategory == 'REPAIRER_MAINTENANCE') |
| | | break |
| | | case 'THIRD_MAINTENANCE': |
| | | this.detail.thirdMaintenanceList = res.result.filter(item => !Boolean(item.itemCategory)) |
| | | break |
| | | default: |
| | | } |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.spinning = false |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | |
| | | * @param value ä¿å
»åç±»å¼ |
| | | */ |
| | | handleMaintenanceCategoryChange(value) { |
| | | delete this.model.maintenancePeriod |
| | | switch (value) { |
| | | case 'THIRD_MAINTENANCE': |
| | | this.model.periodUnit = 'å¹´' |
| | | if (this.activeTabKey != '1') this.activeTabKey = '1' |
| | | break |
| | | case 'SECOND_MAINTENANCE': |
| | | this.model.periodUnit = 'æ' |
| | | this.model.maintenancePeriod = 6 |
| | | break |
| | | case 'POINT_INSPECTION': |
| | | this.model.periodUnit = '天' |
| | | this.model.maintenancePeriod = 1 |
| | | break |
| | | default: |
| | | delete this.model.periodUnit |
| | | } |
| | | |
| | | const tableData = this.$refs.editableDetailTable.getTableData() |
| | | tableData.forEach(item => { |
| | | if (value !== 'THIRD_MAINTENANCE') delete item.itemPart |
| | | delete item.itemCategory |
| | | }) |
| | | |
| | | this.detail.dataSource = [...tableData] |
| | | this.$refs.editableDetailTable.validateTable() |
| | | if (this.model.maintenancePeriod) this.$refs.form.clearValidate('maintenancePeriod') |
| | | }, |
| | | |
| | | /** |
| | | * ä¿å
»é¨ä½æ ¡éª |
| | | * @param cellValue è¾å
¥å¼ |
| | | * @param callback åè°å½æ° |
| | | */ |
| | | itemPartValidate({ cellValue }, callback) { |
| | | if (this.model.maintenanceCategory === 'THIRD_MAINTENANCE') { |
| | | if (cellValue) callback(true) |
| | | else callback(false, 'è¯·éæ©${title}') |
| | | } else { |
| | | callback(true) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹åç±»æ ¡éª |
| | | * @param cellValue è¾å
¥å¼ |
| | | * @param callback åè°å½æ° |
| | | */ |
| | | itemCategoryValidate({ cellValue }, callback) { |
| | | if (this.model.maintenanceCategory === 'THIRD_MAINTENANCE') { |
| | | callback(true) |
| | | } else { |
| | | if (cellValue) callback(true) |
| | | else callback(false, 'è¯·éæ©${title}') |
| | | } |
| | | async handleTabChange(tabKey) { |
| | | let errMap = await this.$refs['editableDetailTable' + this.activeTabKey].validateTable() |
| | | if (errMap) return |
| | | this.activeTabKey = tabKey |
| | | }, |
| | | |
| | | // æäº¤äºä»¶ |
| | | async handleOk() { |
| | | // ä¿å
»å类为空æ¶ä¸æ ¡éªæç» |
| | | if (this.model.maintenanceCategory) { |
| | | // æ ¡éªå½ä¸tabä¸çè¡¨æ ¼æ¯å¦ä¸ºç©º |
| | | let tableData = this.$refs['editableDetailTable' + this.activeTabKey].getTableData() |
| | | if (tableData.length == 0) { |
| | | this.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'å½åä¿å
»æç»ä¸è½ä¸ºç©º' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | // æ ¡éªå½åtabä¸çè¡¨æ ¼æ ¡éªè§å |
| | | let errMap = await this.$refs['editableDetailTable' + this.activeTabKey].validateTable() |
| | | if (errMap) return false |
| | | |
| | | // æ ¡éªå¦ä¸tabä¿å
»æç»è¡¨æ ¼æ¯å¦ä¸ºç©º(ä¸ä¿æ é) |
| | | if (this.model.maintenanceCategory != 'THIRD_MAINTENANCE') { |
| | | if (this.activeTabKey == '1') tableData = this.$refs.editableDetailTable2.getTableData() |
| | | else tableData = this.$refs.editableDetailTable1.getTableData() |
| | | |
| | | if (tableData.length == 0) { |
| | | this.activeTabKey = this.activeTabKey == '1' ? '2' : '1' |
| | | this.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'å½åä¿å
»æç»ä¸è½ä¸ºç©º' |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | } |
| | | |
| | | const that = this |
| | | let errMap = await that.$refs.editableDetailTable.validateTable() |
| | | if (errMap) return false |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | let tableData = that.$refs.editableDetailTable.getTableData() |
| | | let removeData = that.$refs.editableDetailTable.getDeleteData() |
| | | that.model.tableDetailList = [...tableData] |
| | | that.model.removeDetailList = [...removeData] |
| | | |
| | | let tableData1 = that.$refs.editableDetailTable1.getTableData() |
| | | let tableData2 = [] |
| | | let currentTabItemMaintenanceList = [] |
| | | if (this.model.maintenanceCategory != 'THIRD_MAINTENANCE') { |
| | | tableData2 = that.$refs.editableDetailTable2.getTableData() |
| | | if (this.model.maintenanceCategory == 'POINT_INSPECTION') currentTabItemMaintenanceList = ['DAY_INSPECTION', 'WEEK_INSPECTION'] |
| | | else currentTabItemMaintenanceList = ['OPERATOR_MAINTENANCE', 'REPAIRER_MAINTENANCE'] |
| | | } |
| | | if (currentTabItemMaintenanceList.length != 0) { |
| | | tableData1 = tableData1.map(item => { |
| | | return { |
| | | ...item, |
| | | itemCategory: currentTabItemMaintenanceList[0] |
| | | } |
| | | }) |
| | | tableData2 = tableData2.map(item => { |
| | | return { |
| | | ...item, |
| | | itemCategory: currentTabItemMaintenanceList[1] |
| | | } |
| | | }) |
| | | } |
| | | that.model.tableDetailList = [...tableData1, ...tableData2] |
| | | that.confirmLoading = that.spinning = true |
| | | let httpUrl = '' |
| | | let method = '' |
| | |
| | | }) |
| | | }, |
| | | |
| | | resetData() { |
| | | this.activeTabKey = '1' |
| | | this.detail.dayInspectionList = [] |
| | | this.detail.weekInspectionList = [] |
| | | this.detail.operatorMaintenanceList = [] |
| | | this.detail.repairerMaintenanceList = [] |
| | | this.detail.thirdMaintenanceList = [] |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.$refs.form.clearValidate() |
| | | }, |
| | | |
| | | //å 载详æ
æ°æ® |
| | | loadDetail(standardId) { |
| | | this.spinning = true |
| | | this.detail.dataSource = [] |
| | | if (standardId) { |
| | | getAction(this.url.detail, { standardId }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.detail.dataSource = [...res.result] |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.spinning = false |
| | | }) |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | :pagination="ipagination" :loading="loading" :scroll="{ x: 'max-content' }" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> |
| | | <!--ç»ä¸ç¼ç --> |
| | | <template slot="equipmentCode" slot-scope="text"> |
| | | <template slot="equipmentCode" slot-scope="text,record"> |
| | | <a href="#" @click="handleDetail(record)" style="display: inline-block;height: 100%">{{text}}</a> |
| | | </template> |
| | | |
| | |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.loadAllProductionTree() |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.editable = true |
| | |
| | | }, |
| | | handleInspection(id) { |
| | | var that = this |
| | | getAction(that.url.receiveInspectionOrder, { id }).then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.loadData() |
| | | } else { |
| | | // that.$message.warning(res.message); |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | this.loading = true |
| | | getAction(that.url.receiveInspectionOrder, { id }) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.loadData() |
| | | } else { |
| | | // that.$message.warning(res.message); |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | this.loading = false |
| | | } |
| | | }) |
| | | }, |
| | | handleOrReceive(id) { |
| | | if (!this.url.cancelInspectionOrder) { |
| | |
| | | onInspectionDateChange: function(value, dateString) { |
| | | this.queryParam.inspectionDateBegin = dateString[0] |
| | | this.queryParam.inspectionDateEnd = dateString[1] |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | type: JVXETypes.normal, |
| | | width: 100, |
| | | align: 'center', |
| | | disabled: true |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¡¹', |
| | | key: 'itemName', |
| | | type: JVXETypes.textarea, |
| | | type: JVXETypes.normal, |
| | | align: 'center', |
| | | disabled: true |
| | | }, |
| | | { |
| | | title: 'ä¿å
»è§èæè¦æ±', |
| | | key: 'itemDemand', |
| | | type: JVXETypes.textarea, |
| | | type: JVXETypes.normal, |
| | | align: 'center', |
| | | disabled: true |
| | | } |
| | | ], |
| | | weekInspectionColumns: [], |
| | |
| | | type: JVXETypes.normal, |
| | | width: 60, |
| | | align: 'center', |
| | | disabled: true |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¡¹', |
| | | key: 'itemName', |
| | | type: JVXETypes.textarea, |
| | | type: JVXETypes.normal, |
| | | align: 'center', |
| | | disabled: true |
| | | }, |
| | | { |
| | | title: 'ä¿å
»è¦æ±', |
| | | key: 'itemDemand', |
| | | type: JVXETypes.textarea, |
| | | type: JVXETypes.normal, |
| | | align: 'center', |
| | | disabled: true |
| | | }, |
| | | { |
| | | title: 'ç¹æ£ç»æ', |
| | | key: 'inspectionResult', |
| | | type: JVXETypes.textarea, |
| | | type: JVXETypes.select, |
| | | dictCode: 'inspection_project_result', |
| | | align: 'center', |
| | | disabled: true |
| | | }, |
| | | { |
| | | title: 'å¼å¸¸æè¿°', |
| | | key: 'exceptionDescription', |
| | | type: JVXETypes.textarea, |
| | | type: JVXETypes.normal, |
| | | align: 'center', |
| | | disabled: true |
| | | }, |
| | | { |
| | | title: 'å¼å¸¸æ¯å¦æ¥ä¿®', |
| | | key: 'reportFlag', |
| | | type: JVXETypes.textarea, |
| | | type: JVXETypes.select, |
| | | ditCode: 'yn', |
| | | align: 'center', |
| | | disabled: true |
| | | } |
| | |
| | | }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | if (res.result.length > 0) { |
| | | this.detail.weekInspectionList = res.result |
| | | if (res.result.list.length > 0) { |
| | | this.detail.weekInspectionList = res.result.list |
| | | this.detail.weekInspectionColumns = this.detail.weekInspectionOrderColumns |
| | | } |
| | | } |
| | |
| | | <maintenance-standard-approval-modal ref="maintenanceStandardApprovalModal" @modalFormOk="modalFormOk" |
| | | :selectShenpiData="selectedRowData"/> |
| | | |
| | | <inspection-order-handle ref="modalFormInspectionOrder" :selectShenpiData="selectedRowData"/> |
| | | <inspection-order-handle ref="modalFormInspectionOrder" :selectShenpiData="selectedRowData" |
| | | @modalFormOk="modalFormOk"/> |
| | | </a-card> |
| | | </template> |
| | | |
| | |
| | | |
| | | handInspectionOrder(record) { |
| | | console.log('record----->', record) |
| | | this.selectInspectionOrderData = Object.assign({}, record) |
| | | this.selectedRowData = Object.assign({}, record) |
| | | this.$refs.modalFormInspectionOrder.visible = true |
| | | this.$refs.modalFormInspectionOrder.title = record.name |
| | | this.$refs.modalFormInspectionOrder.getAllApproveData(record) |
| | |
| | | <template> |
| | | <j-modal :title="title" :width="1200" :visible="visible" |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit||!hasInspectionDateArrived} }" @ok="submitForm" |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @ok="submitForm" |
| | | @cancel="handleCancel" :mask-closable="false" :confirmLoading="confirmLoading" fullscreen> |
| | | <a-spin :spinning="spinning"> |
| | | <a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol" :wrapperCol="wrapperCol" |
| | |
| | | </a-tabs> |
| | | </a-col> |
| | | |
| | | <a-col :span="disableSubmit||tableRowRecord.inspectionStatus=='UNDER_INSPECTION'?16:10"> |
| | | <a-tabs v-model="activeTabKey"> |
| | | <a-col :span="!isDisplayConfirm?16:10"> |
| | | <a-tabs :active-key="activeTabKey" @change="handleTabChange"> |
| | | <a-tab-pane key="1" tab="æ¥ç¹æ£"> |
| | | <j-vxe-table ref="editableDetailTable" :rowNumber="false" rowSelection bordered |
| | | <j-vxe-table ref="editableDetailTable1" :rowNumber="false" rowSelection bordered |
| | | alwaysEdit :toolbar="false" keep-source :height="300" :loading="detail.loading" |
| | | :dataSource="detail.dataSource" :columns="detail.columns" |
| | | @selectRowChange="handleTableSelectRowChange"> |
| | | :dataSource="detail.dayInspectionList" :columns="detail.columns" |
| | | @selectRowChange="handleTableSelectRowChange($event,'Day')"> |
| | | <template v-slot:inspectionResult="props"> |
| | | <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="eam_inspection_result" |
| | | <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="inspection_project_result" |
| | | :disabled="isDisableOperation" placeholder="è¯·éæ©ç¹æ£ç»æ" |
| | | @change="handleInspectionResultSelectChange($event,props.row)" |
| | | style="width: 100%"/> |
| | |
| | | |
| | | <template v-slot:exceptionDescription="props"> |
| | | <a-textarea style="height: 32px" v-model="props.row.exceptionDescription" |
| | | :placeholder="props.row.inspectionResult==='2'?'请è¾å
¥å¼å¸¸æè¿°':''" |
| | | :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"/> |
| | | :placeholder="props.row.inspectionResult&&props.row.inspectionResult!='NORMAL'?'请è¾å
¥å¼å¸¸æè¿°':''" |
| | | :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult=='NORMAL'"/> |
| | | </template> |
| | | |
| | | <template v-slot:reportFlag="props"> |
| | | <j-dict-select-tag v-model="props.row.reportFlag" |
| | | :placeholder="props.row.inspectionResult==='2'?'è¯·éæ©å¼å¸¸æ¯å¦æ¥ä¿®':''" |
| | | :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'" |
| | | :placeholder="props.row.inspectionResult&&props.row.inspectionResult!='NORMAL'?'è¯·éæ©å¼å¸¸æ¯å¦æ¥ä¿®':''" |
| | | :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult=='NORMAL'" |
| | | dictCode="yn" style="width: 100%"/> |
| | | </template> |
| | | </j-vxe-table> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane key="2" tab="å¨ç¹æ£"> |
| | | <j-vxe-table ref="editableDetailTable" :rowNumber="false" rowSelection bordered |
| | | <a-tab-pane key="2" tab="å¨ç¹æ£" forceRender> |
| | | <j-vxe-table ref="editableDetailTable2" :rowNumber="false" rowSelection bordered |
| | | alwaysEdit :toolbar="false" keep-source :height="300" :loading="detail.loading" |
| | | :dataSource="detail.weekInspectionList" :columns="detail.columns" |
| | | @selectRowChange="handleTableSelectRowChange"> |
| | | @selectRowChange="handleTableSelectRowChange($event,'Week')"> |
| | | <template v-slot:inspectionResult="props"> |
| | | <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="eam_inspection_result" |
| | | :disabled="isDisableOperation" placeholder="è¯·éæ©ç¹æ£ç»æ" |
| | | <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="inspection_project_result" |
| | | :disabled="isDisableOperation||detail.weekInspectionFinishedFlag" |
| | | placeholder="è¯·éæ©ç¹æ£ç»æ" |
| | | @change="handleInspectionResultSelectChange($event,props.row)" |
| | | style="width: 100%"/> |
| | | </template> |
| | | |
| | | <template v-slot:exceptionDescription="props"> |
| | | <a-textarea style="height: 32px" v-model="props.row.exceptionDescription" |
| | | :placeholder="props.row.inspectionResult==='2'?'请è¾å
¥å¼å¸¸æè¿°':''" |
| | | :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"/> |
| | | :placeholder="props.row.inspectionResult&&props.row.inspectionResult!='NORMAL'?'请è¾å
¥å¼å¸¸æè¿°':''" |
| | | :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult=='NORMAL'"/> |
| | | </template> |
| | | |
| | | <template v-slot:reportFlag="props"> |
| | | <j-dict-select-tag v-model="props.row.reportFlag" |
| | | :placeholder="props.row.inspectionResult==='2'?'è¯·éæ©å¼å¸¸æ¯å¦æ¥ä¿®':''" |
| | | :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'" |
| | | :placeholder="props.row.inspectionResult&&props.row.inspectionResult!='NORMAL'?'è¯·éæ©å¼å¸¸æ¯å¦æ¥ä¿®':''" |
| | | :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult=='NORMAL'" |
| | | dictCode="yn" style="width: 100%"/> |
| | | </template> |
| | | </j-vxe-table> |
| | | </a-tab-pane> |
| | | |
| | | <template v-if="selectShenpiData.procInstId"> |
| | | <a-tab-pane key='3' tab='æµç¨èç¹'> |
| | | <a-card :bordered="false"> |
| | | <a-timeline> |
| | | <a-timeline-item v-for="(item,index) in hitaskDataSource" :key="index"> |
| | | <div> |
| | | <h3 style="font-weight: bold;">{{item.taskName}}</h3> |
| | | <div>å¤ç人ï¼{{item.assignee_dictText}}</div> |
| | | <div v-if="index !==0">å¤çæ¶é¿ï¼{{item.duration}}</div> |
| | | <div v-if="item.name !== 'æäº¤ç³è¯·'">å¤çç±»åï¼{{item.sequenceFlowName}}</div> |
| | | <div v-if="item.description">å¤çæè§ï¼{{item.description}}</div> |
| | | </div> |
| | | </a-timeline-item> |
| | | </a-timeline> |
| | | </a-card> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane key='4' tab='æµç¨å¾'> |
| | | <img :src="imageSrc" width="100%" v-if="imageSrc"/> |
| | | <a-tab-pane key='3' tab='æµç¨å¾'> |
| | | <img :src="imageSrc" v-if="imageSrc"/> |
| | | </a-tab-pane> |
| | | </template> |
| | | |
| | | <a-button |
| | | v-if="selectedRowKeys.length>0&&!isDisableOperation&&hasInspectionDateArrived&&activeTabKey==='1'&&activeTabKey==='2'" |
| | | v-if="activeTabKey=='1'||activeTabKey=='2'" |
| | | :disabled="(activeTabKey=='1'&&selectedDayInspectionRowKeys.length==0)||(activeTabKey=='2'&&selectedWeekInspectionRowKeys.length==0)||(activeTabKey=='2'&&detail.weekInspectionFinishedFlag)||isDisableOperation" |
| | | slot="tabBarExtraContent" type="primary" |
| | | @click="handleSelectAllInspectionResult">æ¹éç¹æ£æ£å¸¸ |
| | | </a-button> |
| | | </a-tabs> |
| | | </a-col> |
| | | |
| | | <a-col v-if="!disableSubmit&&isDisplayConfirm" :span="6"> |
| | | <a-col v-if="isDisplayConfirm" :span="6"> |
| | | <a-tabs> |
| | | <a-tab-pane tab="维修工确认"> |
| | | <a-row> |
| | |
| | | confirmLoading: false, |
| | | spinning: false, |
| | | tableRowRecord: {}, |
| | | hitaskDataSource: [], |
| | | validatorRules: { |
| | | confirmDealType: [ |
| | | { required: true, message: 'è¯·éæ©å¤çç±»å' } |
| | |
| | | weekInspectionOrderList: '/eam/eamWeekInspectionDetail/queryStandardList' |
| | | }, |
| | | detail: { |
| | | loading: false, |
| | | dataSource: [], |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | |
| | | ] |
| | | } |
| | | ], |
| | | weekInspectionList: [] |
| | | dayInspectionList: [], |
| | | weekInspectionList: [], |
| | | weekInspectionFinishedFlag: false |
| | | }, |
| | | selectedRowKeys: [], |
| | | selectedDayInspectionRowKeys: [], |
| | | selectedWeekInspectionRowKeys: [], |
| | | disableSubmit: false, |
| | | activeTabKey: '1', |
| | | title: '' |
| | | } |
| | | }, |
| | | computed: { |
| | | hasInspectionDateArrived() { |
| | | return moment(this.tableRowRecord.inspectionDate).diff(moment(), 'hours') <= 0 |
| | | }, |
| | | isDisplayConfirm() { |
| | | return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.inspectionStatus) |
| | | }, |
| | |
| | | const param = { procInstId } |
| | | const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey } |
| | | const that = this |
| | | |
| | | getAction(this.url.queryHisTaskList, param) |
| | | .then(res => { |
| | | that.hitaskDataSource = res.result |
| | | }) |
| | | |
| | | downFile(this.url.diagramView, imageParam, 'get') |
| | | .then((res => { |
| | |
| | | */ |
| | | async getBasicInformation(record) { |
| | | this.activeTabKey = '1' |
| | | this.detail.dataSource = [] |
| | | this.detail.dayInspectionList = this.detail.weekInspectionList = [] |
| | | this.spinning = true |
| | | const param = { id: record.dataId } |
| | | let res = await getAction(this.url.queryById, param) |
| | | this.tableRowRecord = Object.assign({}, res.result) |
| | | this.loadDetail(record.dataId) |
| | | this.getDayInspectionOrderListByApi(record.dataId) |
| | | console.log('record', record) |
| | | this.getWeekInspectionOrderListByApi(this.tableRowRecord.standardId) |
| | | }, |
| | | |
| | | /** |
| | | * è·åç¹æ£å·¥åä¸çæ¥ç¹æ£å表 |
| | | * @param orderId å·¥åå· |
| | | */ |
| | | getDayInspectionOrderListByApi(orderId) { |
| | | if (orderId) { |
| | | getAction(this.url.detailList, { orderId }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.detail.dayInspectionList = [...res.result] |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.spinning = false |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * è·åç¹æ£å·¥åä¸çå¨ç¹æ£å表 |
| | | * @param standardId è§èid |
| | | */ |
| | | getWeekInspectionOrderListByApi(standardId) { |
| | | console.log('standardId-------------------------', standardId) |
| | | getAction(this.url.weekInspectionOrderList, { standardId, inspectionDate: this.tableRowRecord.inspectionDate }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.detail.weekInspectionList = res.result.list |
| | | this.detail.weekInspectionFinishedFlag = res.result.weekInsFlag |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.spinning = false |
| | | }) |
| | | }, |
| | | |
| | | handleTabChange(tabKey) { |
| | | if (this.activeTabKey == '1') this.$refs.editableDetailTable1.clearValidate() |
| | | this.activeTabKey = tabKey |
| | | }, |
| | | |
| | | // æäº¤äºä»¶ |
| | | async submitForm() { |
| | | let errMap = await this.$refs.editableDetailTable.validateTable() |
| | | let errMap = await this.$refs.editableDetailTable1.validateTable() |
| | | if (errMap) { |
| | | console.log('err', errMap) |
| | | if (this.activeTabKey != '1') { |
| | | this.activeTabKey = '1' |
| | | // å
鍿 ¡éªæç¤ºå tab忢æ¶å®ä½åºç°é®é¢å æ¤å¨æ¤å¤æ¸
æ¥å
鍿 ¡éªæç¤ºï¼å¢å notificationæç¤º |
| | | this.$refs.editableDetailTable1.clearValidate() |
| | | this.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'æ¥ç¹æ£ç»æä¸è½ä¸ºç©º' |
| | | }) |
| | | } |
| | | return |
| | | } |
| | | |
| | |
| | | flowTaskVo.taskId = this.selectShenpiData.id |
| | | flowTaskVo.userId = this.selectShenpiData.assignee |
| | | flowTaskVo.instanceId = this.selectShenpiData.procInstId |
| | | flowTaskVo.values = this.selectShenpiData.variables |
| | | flowTaskVo.confirmDealType = this.tableRowRecord.confirmDealType |
| | | flowTaskVo.confirmComment = this.tableRowRecord.confirmComment |
| | | flowTaskVo.tableDetailList = this.$refs.editableDetailTable.getTableData() |
| | | flowTaskVo.tableDetailList = this.$refs.editableDetailTable1.getTableData() |
| | | if (!this.detail.weekInspectionFinishedFlag) flowTaskVo.tableWeekDetailList = this.$refs.editableDetailTable2.getTableData() |
| | | const that = this |
| | | postAction(this.url.approve, flowTaskVo) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | //å·æ°è¡¨æ ¼ |
| | | that.$emit('searchReset') |
| | | that.$emit('modalFormOk') |
| | | that.handleCancel() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | |
| | | |
| | | // æ¹ééæ©ææç¹æ£ç»æ |
| | | handleSelectAllInspectionResult() { |
| | | this.selectedRowKeys.forEach(key => { |
| | | const dataItem = this.detail.dataSource.find(item => item.id === key) |
| | | if (dataItem && dataItem.inspectionResult !== '1') { |
| | | let selectedRowKeys, prefix |
| | | if (this.activeTabKey == '1') { |
| | | selectedRowKeys = this.selectedDayInspectionRowKeys |
| | | prefix = 'day' |
| | | } |
| | | else if (this.activeTabKey == '2') { |
| | | selectedRowKeys = this.selectedWeekInspectionRowKeys |
| | | prefix = 'week' |
| | | } |
| | | else selectedRowKeys = [] |
| | | if (selectedRowKeys.length == 0) return |
| | | |
| | | selectedRowKeys.forEach(key => { |
| | | const dataItem = this.detail[prefix + 'InspectionList'].find(item => item.id === key) |
| | | if (dataItem && dataItem.inspectionResult !== 'NORMAL') { |
| | | delete dataItem.exceptionDescription |
| | | delete dataItem.reportFlag |
| | | dataItem.inspectionResult = '1' |
| | | dataItem.inspectionResult = 'NORMAL' |
| | | } |
| | | }) |
| | | this.$refs.editableDetailTable.clearCheckboxRow() |
| | | this.selectedRowKeys = [] |
| | | this.$refs['editableDetailTable' + this.activeTabKey].clearCheckboxRow() |
| | | this['selected' + prefix.charAt(0).toUpperCase() + prefix.slice(1) + 'InspectionRowKeys'] = [] |
| | | }, |
| | | |
| | | /** |
| | | * è¡¨æ ¼å¤éæ¡åçæ¹åæ¶è§¦å |
| | | * @param {selectedRowIds} è¡¨æ ¼ä¸å·²éæ©çIDå表 |
| | | * @param key ç¹æ£åºåkey |
| | | */ |
| | | handleTableSelectRowChange({ selectedRowIds }) { |
| | | this.selectedRowKeys = selectedRowIds |
| | | handleTableSelectRowChange({ selectedRowIds }, key) { |
| | | this['selected' + key + 'InspectionRowKeys'] = selectedRowIds |
| | | }, |
| | | |
| | | /** |
| | |
| | | if (record.reportFlag) delete record.reportFlag |
| | | }, |
| | | |
| | | /** |
| | | * å¼å¸¸æè¿°ä¸å¼å¸¸æ¯å¦ä¿ä¿®å段èªå®ä¹æ ¡éªæ¹æ³ |
| | | * @param cellValue åå
æ ¼å
çå¼ |
| | | * @param row å½åè¡è®°å½ |
| | | * @param callback ç»æåè°å½æ° |
| | | */ |
| | | customValidator({ cellValue, row }, callback) { |
| | | if (row.inspectionResult === '2') { |
| | | if (this.activeTabKey == '1' && row.inspectionResult != 'NORMAL') { |
| | | if (!cellValue) { |
| | | callback(false, '${title}ä¸è½ä¸ºç©ºï¼') // false = æªéè¿ï¼å¯ä»¥è·èªå®ä¹æç¤º |
| | | callback(false, '请è¾å
¥${title}') // false = æªéè¿ï¼å¯ä»¥è·èªå®ä¹æç¤º |
| | | } else { |
| | | callback(true) // true = éè¿éªè¯ |
| | | } |
| | |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.selectedRowKeys = [] |
| | | this.selectedDayInspectionRowKeys = this.selectedWeekInspectionRowKeys = [] |
| | | this.visible = false |
| | | }, |
| | | |
| | | /** |
| | | * è·åæ¥ç¹æ£æç» |
| | | * @param orderId |
| | | */ |
| | | loadDetail(orderId) { |
| | | if (orderId) { |
| | | getAction(this.url.detailList, { orderId }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.detail.dataSource = [...res.result] |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.spinning = false |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * è·åç¹æ£å·¥åä¸çå¨ç¹æ£å表 |
| | | * @param standardId è§èid |
| | | */ |
| | | getWeekInspectionOrderListByApi(standardId) { |
| | | console.log('standardId-------------------------', standardId) |
| | | getAction(this.url.weekInspectionOrderList, { standardId, inspectionDate: this.tableRowRecord.inspectionDate }) |
| | | .then(res => { |
| | | if (res.success) this.detail.weekInspectionList = res.result |
| | | }) |
| | | .finally(() => { |
| | | this.spinning = false |
| | | }) |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="åæ°åç§°"> |
| | | <a-input placeholder="请è¾å
¥åæ°åç§°" v-model="queryParam.settingName"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <!-- <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <a-button type="primary" icon="download" @click="handleExportXls('ç³»ç»åæ°è¡¨')">导åº</a-button> |
| | | <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | | </a-upload> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>å é¤</a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ <a-icon type="down" /></a-button> |
| | | </a-dropdown> |
| | | </div> --> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> --> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | <span slot="rowIndex" slot-scope="text, record, index"> |
| | | {{(ipagination.current-1)*ipagination.pageSize+index+1}} |
| | | </span> |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></div> |
| | | </template> |
| | | <template slot="imgSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ å¾ç</span> |
| | | <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="uploadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <!-- <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> --> |
| | | <template> |
| | | <!-- <div v-if="record.settingValue=='OPEN'"> |
| | | <a-switch @click="edit(record)" checked-children="å¼" un-checked-children="å
³" default-checked /> |
| | | </div> |
| | | <div v-else> |
| | | <a-switch @click="edit(record)" checked-children="å¼" un-checked-children="å
³" /> |
| | | </div> --> |
| | | </template> |
| | | </span> |
| | | |
| | | <!-- å符串è¶
é¿æªåçç¥å·æ¾ç¤º--> |
| | | <span slot="settingValue" slot-scope="text"> |
| | | <j-ellipsis :value="text"/> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | |
| | | <sysParams-modal ref="modalForm" @ok="modalFormOk"></sysParams-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@/api/manage' |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import SysParamsModal from './modules/SysParamsModal' |
| | | import JDictSelectTag from '../../components/dict/JDictSelectTag.vue' |
| | | |
| | | export default { |
| | | name: "SysParamsList", |
| | | mixins:[JeecgListMixin, mixinDevice], |
| | | components: { |
| | | JDictSelectTag, |
| | | SysParamsModal, |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'ç³»ç»åæ°è¡¨ç®¡ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | scopedSlots: { customRender: 'rowIndex' } |
| | | }, |
| | | { |
| | | title:'åæ°åç§°', |
| | | align:"center", |
| | | dataIndex: 'settingName' |
| | | }, |
| | | { |
| | | title:'åæ°é®', |
| | | align:"center", |
| | | dataIndex: 'settingKey' |
| | | }, |
| | | { |
| | | title:'åæ°å¼', |
| | | align:"center", |
| | | dataIndex: 'settingValue', |
| | | key: 'settingValue', |
| | | scopedSlots: { customRender: 'settingValue' } |
| | | }, |
| | | { |
| | | title:'夿³¨', |
| | | align:"center", |
| | | dataIndex: 'remark' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | // fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/system/sysParams/list", |
| | | delete: "/system/sysParams/delete", |
| | | deleteBatch: "/system/sysParams/deleteBatch", |
| | | exportXlsUrl: "/system/sysParams/exportXls", |
| | | importExcelUrl: "system/sysParams/importExcel", |
| | | edit: "/system/sysParams/edit", |
| | | }, |
| | | dictOptions:{}, |
| | | } |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | }, |
| | | methods: { |
| | | initDictConfig(){ |
| | | }, |
| | | edit(sysParams) { |
| | | if(sysParams.settingValue == "CLOSE"){ |
| | | sysParams.settingValue = "OPEN"; |
| | | }else{ |
| | | sysParams.settingValue = "CLOSE"; |
| | | } |
| | | const that = this; |
| | | httpAction("/system/sysParams/edit",sysParams,'put').then((res)=>{ |
| | | if(res.success){ |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | |
| | | <a-form-item label="åæ°é®" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input disabled v-decorator="['settingKey']" placeholder="请è¾å
¥åæ°é®"></a-input> |
| | | </a-form-item> |
| | | <a-form-item label="åæ°å¼" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-decorator="['settingValue']" placeholder="请è¾å
¥åæ°å¼"></a-input> |
| | | </a-form-item> |
| | | <a-form-item label="夿³¨" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-textarea disabled v-decorator="['remark']" rows="4" placeholder="请è¾å
¥å¤æ³¨"/> |
| | | </a-form-item> |
| | | |
| | | </a-form> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@/api/manage' |
| | | import pick from 'lodash.pick' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | |
| | | export default { |
| | | name: "SysParamsModal", |
| | | components: { |
| | | }, |
| | | data () { |
| | | return { |
| | | form: this.$form.createForm(this), |
| | | title:"æä½", |
| | | width:800, |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | }, |
| | | url: { |
| | | add: "/system/sysParams/add", |
| | | edit: "/system/sysParams/edit", |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit({}); |
| | | }, |
| | | edit (record) { |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model,'settingKey','settingValue','remark')) |
| | | }) |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk () { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if(!this.model.id){ |
| | | httpurl+=this.url.add; |
| | | method = 'post'; |
| | | }else{ |
| | | httpurl+=this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | let formData = Object.assign(this.model, values); |
| | | console.log("表åæäº¤æ°æ®",formData) |
| | | httpAction(httpurl,formData,method).then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | popupCallback(row){ |
| | | this.form.setFieldsValue(pick(row,'settingKey','settingValue','remark')) |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-drawer |
| | | :title="title" |
| | | :width="width" |
| | | placement="right" |
| | | :closable="false" |
| | | @close="close" |
| | | :visible="visible"> |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | |
| | | <a-form-item label="åæ°é®" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-decorator="['settingKey']" placeholder="请è¾å
¥åæ°é®"></a-input> |
| | | </a-form-item> |
| | | <a-form-item label="åæ°å¼" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-decorator="['settingValue']" placeholder="请è¾å
¥åæ°å¼"></a-input> |
| | | </a-form-item> |
| | | <a-form-item label="夿³¨" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-decorator="['remark']" placeholder="请è¾å
¥å¤æ³¨"></a-input> |
| | | </a-form-item> |
| | | |
| | | </a-form> |
| | | </a-spin> |
| | | <a-button type="primary" @click="handleOk">ç¡®å®</a-button> |
| | | <a-button type="primary" @click="handleCancel">åæ¶</a-button> |
| | | </a-drawer> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@/api/manage' |
| | | import pick from 'lodash.pick' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | export default { |
| | | name: "SysParamsModal", |
| | | components: { |
| | | }, |
| | | data () { |
| | | return { |
| | | form: this.$form.createForm(this), |
| | | title:"æä½", |
| | | width:800, |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | }, |
| | | url: { |
| | | add: "/system/sysParams/add", |
| | | edit: "/system/sysParams/edit", |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit({}); |
| | | }, |
| | | edit (record) { |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model,'settingKey','settingValue','remark')) |
| | | }) |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk () { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if(!this.model.id){ |
| | | httpurl+=this.url.add; |
| | | method = 'post'; |
| | | }else{ |
| | | httpurl+=this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | let formData = Object.assign(this.model, values); |
| | | console.log("表åæäº¤æ°æ®",formData) |
| | | httpAction(httpurl,formData,method).then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | popupCallback(row){ |
| | | this.form.setFieldsValue(pick(row,'settingKey','settingValue','remark')) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | /** Buttonæé®é´è· */ |
| | | .ant-btn { |
| | | margin-left: 30px; |
| | | margin-bottom: 30px; |
| | | float: right; |
| | | } |
| | | </style> |