From 92ff846fb659c62037a32b1d8c15eae9df9d9b54 Mon Sep 17 00:00:00 2001 From: zenglf <18502938215@163.com> Date: 星期一, 18 九月 2023 13:24:30 +0800 Subject: [PATCH] Merge branch 'develop' of http://117.34.109.166:18448/r/vue_mdc_430 --- src/views/eam/DailyInspectionStandardList.vue | 437 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 437 insertions(+), 0 deletions(-) diff --git a/src/views/eam/DailyInspectionStandardList.vue b/src/views/eam/DailyInspectionStandardList.vue new file mode 100644 index 0000000..1f7cf59 --- /dev/null +++ b/src/views/eam/DailyInspectionStandardList.vue @@ -0,0 +1,437 @@ +<template> + <a-card + title="鏃ュ父鐐规" + :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.num' + ></a-input> + </a-form-item> + </a-col> + <a-col + :xl='6' + :lg='7' + :md='8' + :sm='24' + > + <a-form-item label='璁惧鍚嶇О'> + <a-input + placeholder='璇疯緭鍏ヨ澶囧悕绉�' + v-model='queryParam.name' + ></a-input> + </a-form-item> + </a-col> + <a-col + :md="10" + :sm="8" + > + <a-form-item label="鐗堟湰鐘舵��"> + <a-radio-group + v-model="queryParam.versionStatus" + @change="onChange" + default-value="2" + > + <a-radio-button value="1"> + 鏈敓鏁� + </a-radio-button> + <a-radio-button value="2"> + 宸茬敓鏁� + </a-radio-button> + <a-radio-button value="3"> + 宸插け鏁� + </a-radio-button> + </a-radio-group> + </a-form-item> + </a-col> + </a-row> + </a-form> + </div> + + <div class="table-operator"> + <a-button + @click='handleAdd' + type='primary' + icon='plus' + v-has="'dailyInspectionStandard:add'" + >鏂板</a-button> + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="primary" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </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' + :scroll="{ x: 'calc(1600px + 50%)', y: 900 }" + :columns='columns' + :dataSource='dataSource' + :pagination='ipagination' + :loading='loading' + :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' + :customRow='clickThenSelect' + @change='handleTableChange' + > + + <!-- <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> + </span> --> + + <span + slot="action" + slot-scope="text, record" + > + <a + v-if="record.versionStatus == '2'" + @click="handleRevise(record)" + v-has="'dailyInspectionStandard:revise'" + >鍗囩増</a> + <a-divider type="vertical" /> + <a + v-if="record.versionStatus == '1'" + @click="handleTakeEffect(record)" + v-has="'dailyInspectionStandard:takeEffect'" + >鐢熸晥</a> + <a-divider type="vertical" /> + <a + v-if="record.versionStatus == '1'" + @click="handleEdit(record)" + v-has="'dailyInspectionStandard:edit'" + >缂栬緫</a> + <a-divider type="vertical" /> + <a-popconfirm + v-if="record.versionStatus == '1'" + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + v-has="'dailyInspectionStandard:delete'" + > + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + + </a-table> + <a-tabs defaultActiveKey="1"> + <a-tab-pane + tab='鐐规鏄庣粏' + key="1" + > + <div + class="table-operator" + style="margin:-16px" + > + <daily-inspection-standard-detail :inspectionStandardId='inspectionStandardId' /> + </div> + </a-tab-pane> + + </a-tabs> + </div> + + <dailylnspection-standard-modal + ref='modalForm' + @ok='modalFormOk' + ></dailylnspection-standard-modal> + </a-card> +</template> + +<script> + +import { JeecgListMixin } from '@/mixins/JeecgListMixin' + +import { getAction, requestPut } from '@/api/manage' +import DailyInspectionStandardDetail from './modules/dailyInspectionStandard/DailyInspectionStandardDetail' +import DailylnspectionStandardModal from './modules/dailyInspectionStandard/DailylnspectionStandardModal' +import '@/assets/less/TableExpand.less' + +export default { + name: 'DailyInspectionStandardList', + mixins: [JeecgListMixin], + components: { + DailyInspectionStandardDetail, + DailylnspectionStandardModal + }, + data() { + return { + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鐗堟湰', + align: 'center', + dataIndex: 'version', + }, + { + title: '鐗堟湰鐘舵��', + align: 'center', + dataIndex: 'versionStatusName', + }, + { + title: '鏍囧噯缂栫爜', + align: 'center', + dataIndex: 'num', + }, + { + title: '瀵硅薄閮ㄩ棬', + align: 'center', + dataIndex: 'useDepartName', + }, + { + title: '璁惧缂栫爜', + align: 'center', + dataIndex: 'equipmentNum', + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + }, + { + title: '璁惧鍨嬪彿', + align: 'center', + dataIndex: 'equipmentModel', + }, + { + title: '璐d换鐝粍', + align: 'center', + dataIndex: 'teamName', + }, + { + title: '娲惧伐鏂瑰紡', + align: 'center', + dataIndex: 'assignModeName', + }, + { + title: '鐢熸晥鏃堕棿', + align: 'center', + dataIndex: 'takeEffectTime', + }, + { + title: '澶辨晥鏃堕棿', + align: 'center', + dataIndex: 'loseEfficacyTime', + }, + { + title: '鍒涘缓浜�', + align: 'center', + dataIndex: 'createBy', + }, + { + title: '鍒涘缓鏃ユ湡', + align: 'center', + dataIndex: 'createTime', + }, + // { + // title: '鏇存柊浜�', + // align: 'center', + // dataIndex: 'updateBy', + // }, + // { + // title: '鏇存柊鏃ユ湡', + // align: 'center', + // dataIndex: 'updateTime', + // }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + scopedSlots: { customRender: 'action' }, + width: 200, + } + ], + url: { + list: '/eam/inspectionStandard/getInspectionStandardList', + delete: '/eam/inspectionStandard/delete', + deleteBatch: '/eam/inspectionStandard/deleteBatch', + versionTakeEffect: "/eam/inspectionStandard/versionTakeEffect", + }, + version: '1.0', + dictOptions: {}, + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 5, + pageSizeOptions: ['5', '10', '50'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + inspectionStandardId: '-1' + } + }, + methods: { + clickThenSelect(record) { + return { + on: { + click: () => { + this.onSelectChange(record.id.split(','), [record]) + } + } + } + }, + onClearSelected() { + this.selectedRowKeys = [] + this.selectionRows = [] + this.inspectionStandardId = '-1' + }, + onSelectChange(selectedRowKeys, selectionRows) { + if (selectedRowKeys.length == 1) { + this.inspectionStandardId = selectionRows[0]['id'] + } else { + this.inspectionStandardId = '-1' + } + this.selectedRowKeys = selectedRowKeys + this.selectionRows = selectionRows + }, + + handleEdit: function (record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '缂栬緫' + this.$refs.modalForm.disableSubmit = false + this.$refs.modalForm.isRevise = false; + }, + handleAdd: function () { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鏂板' + this.$refs.modalForm.disableSubmit = false + this.$refs.modalForm.isRevise = false; + }, + + //鍗囩増 + handleRevise: function (record) { + this.$refs.modalForm.edit(record); + this.$refs.modalForm.title = "鐐规鏍囧噯鐗堟湰鍗囩骇"; + this.$refs.modalForm.disableSubmit = false; + this.$refs.modalForm.isRevise = true; + }, + + //鐢熸晥 + handleTakeEffect(record) { + const that = this; + that.confirmLoading = true; + this.$confirm({ + title: '鏃ュ父鐐规鏍囧噯鐗堟湰鐢熸晥锛�', + content: '鎻愮ず锛氱増鏈敓鏁堝悗涓婁竴鐗堟湰灏嗚嚜鍔ㄥけ鏁堬紝璇疯皑鎱庢搷浣滐紒', + okText: '纭', + cancelText: '鍙栨秷', + onOk() { + requestPut(that.url.versionTakeEffect, { id: record.id, num: record.num, versionStatus: '2' }).then((res) => { + if (res.success) { + that.$message.success("鐗堟湰鐢熸晥鎴愬姛锛�") + that.loadData(1) + } else { + that.$message.warning("鐗堟湰鐢熸晥澶辫触锛�") + } + }).finally(() => { + that.confirmLoading = false; + }) + }, + }) + }, + + onChange(e) { + this.queryParam.versionStatus = e.target.value; + this.loadData(); + }, + + loadData(arg) { + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1 + } + this.onClearSelected() + var params = this.getQueryParams()//鏌ヨ鏉′欢 + this.loading = true + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records + this.ipagination.total = res.result.total + } + if (res.code === 510) { + this.$message.warning(res.message) + } + this.loading = false + }) + }, + searchReset() { + this.inspectionStandardId = '-1' + this.queryParam = {} + this.loadData(1); + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +.table-operator .ant-btn { + margin: 10px 8px 8px 10px; +} +</style> \ No newline at end of file -- Gitblit v1.9.3