| | |
| | | <!--<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 --> |
| | |
| | | { |
| | | title: '类型', |
| | | align: 'center', |
| | | dataIndex: 'type' |
| | | dataIndex: 'vacationType' |
| | | }, |
| | | { |
| | | title: '备注', |
| | |
| | | ], |
| | | url: { |
| | | list: '/mdc/mdcVacationManagement/pageList', |
| | | delete: '/mdc/mdcVacationManagement/deleteBatchVacation', |
| | | deleteBatch: '/mdc/mdcVacationManagement/deleteBatchVacation', |
| | | getEquipmentByPid: '/mdc/mdcequipment/getEquipmentByPid', |
| | | exportXlsUrl: "/mdc/MdcTorqueConfig/exportXls", |
| | |
| | | this.selectedRowKeys = [] |
| | | }, |
| | | handleDelete: function (id) { |
| | | if(!this.url.deleteBatch){ |
| | | if(!this.url.delete){ |
| | | this.$message.error("请设置url.delete属性!") |
| | | return |
| | | } |
| | | var that = this; |
| | | deleteAction(that.url.deleteBatch, {id: id}).then((res) => { |
| | | deleteAction(that.url.delete, {id: id}).then((res) => { |
| | | if (res.success) { |
| | | //重新计算分页问题 |
| | | that.reCalculatePage(1) |
| | |
| | | } |
| | | }); |
| | | }, |
| | | batchDel: function () { |
| | | if(!this.url.deleteBatch){ |
| | | this.$message.error("请设置url.deleteBatch属性!") |
| | | return |
| | | } |
| | | if (this.selectedRowKeys.length <= 0) { |
| | | this.$message.warning('请选择一条记录!'); |
| | | return; |
| | | } else { |
| | | var ids = ""; |
| | | for (var a = 0; a < this.selectedRowKeys.length; a++) { |
| | | ids += this.selectedRowKeys[a] + ","; |
| | | } |
| | | var that = this; |
| | | this.$confirm({ |
| | | title: "确认删除", |
| | | content: "是否删除选中数据?", |
| | | onOk: function () { |
| | | that.loading = true; |
| | | deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => { |
| | | if (res.success) { |
| | | //重新计算分页问题 |
| | | that.reCalculatePage(that.selectedRowKeys.length) |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | that.onClearSelected(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.loading = false; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | handleAdd() { |
| | | this.$refs.modalForm.add(this.node) |
| | | this.$refs.modalForm.title = '新增' |
| | |
| | | <a-col :span="12"> |
| | | <a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="disableSubmit" placeholder="请输入类型" |
| | | v-decorator="['type', validatorRules.type]"/> |
| | | v-decorator="['vacationType', validatorRules.vacationType]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'equipmentId', 'equipmentName', 'vacationDate', 'type', 'notes', |
| | | this.form.setFieldsValue(pick(this.model, 'equipmentId', 'equipmentName', 'vacationDate', 'vacationType', 'notes', |
| | | )) |
| | | }) |
| | | }, |
| | |
| | | <a-col :span="12"> |
| | | <a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="disableSubmit" placeholder="请输入类型" |
| | | v-decorator="['type', validatorRules.type]"/> |
| | | v-decorator="['vacationType', validatorRules.vacationType]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | |
| | | // this.editStart = (this.model.startTime).replace(/:/g,''); |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model,'equipmentId', 'equipmentName','vacationDate', 'type','notes' |
| | | this.form.setFieldsValue(pick(this.model,'equipmentId', 'equipmentName','vacationDate', 'vacationType','notes' |
| | | )) |
| | | }) |
| | | }, |
| | |
| | | <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 --> |
| | |
| | | ], |
| | | url: { |
| | | list: '/mdc/MdcTorqueConfig/pageList', |
| | | deleteBatch: '/mdc/MdcTorqueConfig/deleteMdcTorqueConfig', |
| | | delete: '/mdc/MdcTorqueConfig/deleteMdcTorqueConfig', |
| | | deleteBatch: '/mdc/MdcTorqueConfig/deleteBatchMdcTorqueConfig', |
| | | getEquipmentByPid: '/mdc/mdcequipment/getEquipmentByPid', |
| | | exportXlsUrl: "/mdc/MdcTorqueConfig/exportXls", |
| | | importExcelUrl: "/mdc/MdcTorqueConfig/importExcel", |
| | |
| | | this.selectedRowKeys = [] |
| | | }, |
| | | handleDelete: function (id) { |
| | | if(!this.url.deleteBatch){ |
| | | if(!this.url.delete){ |
| | | this.$message.error("请设置url.delete属性!") |
| | | return |
| | | } |
| | | var that = this; |
| | | deleteAction(that.url.deleteBatch, {id: id}).then((res) => { |
| | | deleteAction(that.url.delete, {id: id}).then((res) => { |
| | | if (res.success) { |
| | | //重新计算分页问题 |
| | | that.reCalculatePage(1) |
| | |
| | | } |
| | | }); |
| | | }, |
| | | batchDel: function () { |
| | | if(!this.url.deleteBatch){ |
| | | this.$message.error("请设置url.deleteBatch属性!") |
| | | return |
| | | } |
| | | if (this.selectedRowKeys.length <= 0) { |
| | | this.$message.warning('请选择一条记录!'); |
| | | return; |
| | | } else { |
| | | var ids = ""; |
| | | for (var a = 0; a < this.selectedRowKeys.length; a++) { |
| | | ids += this.selectedRowKeys[a] + ","; |
| | | } |
| | | var that = this; |
| | | this.$confirm({ |
| | | title: "确认删除", |
| | | content: "是否删除选中数据?", |
| | | onOk: function () { |
| | | that.loading = true; |
| | | deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => { |
| | | if (res.success) { |
| | | //重新计算分页问题 |
| | | that.reCalculatePage(that.selectedRowKeys.length) |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | that.onClearSelected(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.loading = false; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | handleAdd() { |
| | | this.$refs.modalForm.add(this.node) |
| | | this.$refs.modalForm.title = '新增' |