刀具刃磨-新增异常调整 工具报损 -选择工具调整 刃磨-选择工具调整
| | |
| | | { |
| | | title: '刀具编号', |
| | | align: 'center', |
| | | dataIndex: 'toolCode' |
| | | dataIndex: 'toolId' |
| | | }, |
| | | { |
| | | title: '工具类型', |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | // handleEdit: function (record) { |
| | | // this.$refs.modalForm.edit(record); |
| | | // this.$refs.modalForm.title = "编辑"; |
| | | // this.$refs.modalForm.disableSubmit = false; |
| | | // }, |
| | | // handleAdd: function () { |
| | | // this.$refs.modalForm.add(); |
| | | // this.$refs.modalForm.title = "新增"; |
| | | // this.$refs.modalForm.disableSubmit = false; |
| | | // }, |
| | | |
| | | modalFormOk() { |
| | | this.$refs.lossboundDetailList.clearList() |
| | | this.loadData() |
| | |
| | | { |
| | | title: '工具编码', |
| | | align: 'center', |
| | | dataIndex: 'toolCode' |
| | | dataIndex: 'toolId' |
| | | }, |
| | | { |
| | | title: '中文名称', |
| | |
| | | width: 50 |
| | | }, |
| | | { |
| | | title: '刀具编号', |
| | | dataIndex: 'toolCode', |
| | | title: '刀具编码', |
| | | dataIndex: 'toolId', |
| | | align: 'center', |
| | | width: 150 |
| | | width: 200 |
| | | }, |
| | | |
| | | { |
| | |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | for (let i = 0; i < data.length; i++) { |
| | | this.dataSource.push({ |
| | | toolId: data[i].id, |
| | | toolCode: data[i].toolCode, |
| | | toolCode:data[i].toolCode, |
| | | toolId:data[i].toolId, |
| | | classifyId: data[i].classifyId, |
| | | applicationType: data[i].applicationType_dictText, |
| | | chineseName: data[i].chineseName, |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | |
| | | <!-- 查询区域 --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="刃磨时间"> |
| | | <a-range-picker v-model="queryParam.sharpeningTime" @change="onInspectionDateChange" format="YYYY-MM-DD" value-format="YYYY-MM-DD" /> |
| | | <a-range-picker v-model="queryParam.sharpeningTime" @change="onToolSharpeningDateChange" format="YYYY-MM-DD" value-format="YYYY-MM-DD" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- 查询区域-END --> |
| | | |
| | | <!-- 操作按钮区域 --> |
| | | <div class="table-operator"> |
| | | <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
| | | </div> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
| | | <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" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="null" |
| | | class="j-table-force-nowrap" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | |
| | | |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleDetail(record)">详情</a> |
| | | <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 @click="handleEdit(record)">编辑</a> |
| | | <a @click="handleDetail(record)">详情</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
| | | <a>删除</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | <!-- table区域-end --> |
| | | |
| | | <tools-sharpening-modal ref="modalForm" @ok="modalFormOk"></tools-sharpening-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import ToolsSharpeningModal from './modules/ToolsSharpeningModal' |
| | | import { getAction, putAction, deleteAction } from '../../../api/manage' |
| | | |
| | | export default { |
| | | name: 'ToolSharpeningList ', |
| | | mixins:[JeecgListMixin, mixinDevice], |
| | | name: 'ToolSharpeningList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | ToolsSharpeningModal |
| | | }, |
| | | data () { |
| | | data() { |
| | | return { |
| | | description: '刀具刃磨', |
| | | description: '刀具刃磨页面', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | |
| | | exportXlsUrl: "/tms/toolSharpening/exportXls", |
| | | importExcelUrl: "tms/toolSharpening/importExcel", |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | |
| | | } |
| | | }, |
| | | created() {}, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | onInspectionDateChange: function(value, dateString) { |
| | | this.queryParam.sharpeningTimeBegin = dateString[0] |
| | | this.queryParam.sharpeningTimeEnd = dateString[1] |
| | | }, |
| | | |
| | | |
| | | handleEdit: function (record) { |
| | | console.log('record:', record) |
| | | this.$refs.modalForm.title = '编辑' |
| | | this.$refs.modalForm.disableSubmit = false |
| | | this.$refs.modalForm.edit(record) |
| | | |
| | | }, |
| | | handleDetail:function(record){ |
| | | this.$refs.modalForm.title="详情"; |
| | | this.$refs.modalForm.disableSubmit = true; |
| | | this.$refs.modalForm.edit(record); |
| | | }, |
| | | |
| | | |
| | | handleDelete: function (id) { |
| | | if (!this.url.delete) { |
| | | this.$message.error('请设置url.delete属性!') |
| | | return |
| | | } |
| | | deleteAction(this.url.delete, { id: id }).then((res) => { |
| | | if (res.success) { |
| | | //重新计算分页问题 |
| | | this.$message.success(res.message) |
| | | this.ipagination.current = 1 |
| | | this.loadData() // 强制从第一页加载 |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.loadData(1) |
| | | }, |
| | | modalFormOk() { |
| | | this.loadData() |
| | | }, |
| | | |
| | | onToolSharpeningDateChange: function(value, dateString) { |
| | | this.queryParam.sharpeningTimeBegin = dateString[0] |
| | | this.queryParam.sharpeningTimeEnd = dateString[1] |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | .enable { |
| | | color: green; |
| | | } |
| | | .disable { |
| | | color: red; |
| | | } |
| | | </style> |
| | |
| | | columns: [{ |
| | | title: '工具编码', |
| | | align: 'center', |
| | | dataIndex: 'toolCode' |
| | | dataIndex: 'toolId' |
| | | }, |
| | | { |
| | | title: '工具类型', |
| | |
| | | { |
| | | title: '工具参数标识', |
| | | align: 'center', |
| | | dataIndex: 'paramaTableName' |
| | | dataIndex: 'paramaTableName_dictText' |
| | | }, |
| | | { |
| | | title: '型号/图号', |
| | |
| | | this.close() |
| | | }, |
| | | handleOk() { |
| | | this.$bus.$emit('selectionRows', this.selectionRows) |
| | | this.$emit('sendSelectionRows', this.selectionRows[0]) |
| | | this.close() |
| | | }, |
| | | } |
| | |
| | | @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="12"> |
| | | <a-form-model-item prop="standardCode" label="工具编号"> |
| | | <a-input-search v-model="model.toolId" placeholder="请选择工具编号" :disabled="disableSubmit" |
| | | <a-form-model-item prop="standardCode" label="工具编码"> |
| | | <a-input-search v-model="model.toolId" placeholder="请选择工具编码" :disabled="disableSubmit" |
| | | @search="selectTools" enter-button |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="classify_id" label="工具分类编码"> |
| | | <a-form-model-item prop="classify_id" label="工具分类名称"> |
| | | <a-input placeholder="请输入工具分类名称" v-model="model.classifyId" readOnly :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item prop="paramaTableName" label="工具参数标识"> |
| | | <a-input placeholder="选择设备后自动带出" readOnly v-model="model.paramaTableName" readOnly |
| | | <a-input placeholder="选择设备后自动带出" readOnly v-model="model.paramaTableName_dictText" readOnly |
| | | :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="工具类型"> |
| | | <a-input placeholder="选择设备后自动带出" v-model="model.applicationType" readOnly |
| | | <a-input placeholder="选择设备后自动带出" v-model="model.applicationType_dictText" readOnly |
| | | :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="存储位置" prop="storageLocation"> |
| | | <a-input placeholder="选择填写存储位置" v-model="model.positionCode" readOnly |
| | | :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="备注"> |
| | | <a-form-model-item label="备注" prop="remark"> |
| | | <a-textarea v-model="model.remark" rows="3" placeholder="请输入备注" :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | |
| | | |
| | | <a-button @click="handleOk()" :disabled="disableSubmit" type="primary" :loading="confirmLoading">确定</a-button> |
| | | </template> |
| | | <tools-modal ref="toolListModel"></tools-modal> |
| | | <tools-modal ref="toolListModel" @sendSelectionRows="getRows"></tools-modal> |
| | | |
| | | |
| | | </j-modal> |
| | |
| | | import { getAction, postAction, requestPut } from '@/api/manage' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import ToolsModal from '@views/tms/requirement/modules/ToolsModal.vue' |
| | | import pick from 'lodash.pick' |
| | | import DeviceListModel from '@views/mdc/base/modules/EquipmentList/DeviceListModal.vue' |
| | | |
| | | export default { |
| | | name: 'ToolsSharpeningModal', |
| | | mixins: [JVxeTableModelMixin], |
| | | components: { |
| | | DeviceListModel, |
| | | ToolsModal |
| | | }, |
| | | data() { |
| | |
| | | { required: true, message: '请输入刃磨结果及建议!' } |
| | | ] |
| | | }, |
| | | lastSelectionData: null, |
| | | url: { |
| | | add: '/tms/toolSharpening/add', |
| | | edit: '/tms/toolSharpening/edit', |
| | | queryDetailList: '/tms/toolSharpening/listToolSharpening' |
| | | // queryDetailList: '/tms/toolSharpening/listToolSharpening' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | console.log('selectionRows', data) |
| | | if (data && data.length > 0) { |
| | | const item = data[0] |
| | | // 使用 $set 确保 model 的属性是响应式的 |
| | | this.$set(this.model, 'toolId', item.toolCode) |
| | | this.$set(this.model, 'toolCode', item.id) |
| | | |
| | | methods: { |
| | | getRows(item) { |
| | | console.log(item) |
| | | if (item.id) { |
| | | this.$set(this.model, 'toolId', item.toolId) |
| | | this.$set(this.model, 'toolCode', item.toolCode) |
| | | this.$set(this.model, 'classifyId', item.classifyId) |
| | | this.$set(this.model, 'paramaTableName', item.paramaTableName_dictText) |
| | | this.$set(this.model, 'applicationType', item.applicationType_dictText) |
| | | this.$set(this.model, 'paramaTableName_dictText', item.paramaTableName_dictText) |
| | | this.$set(this.model, 'applicationType_dictText', item.applicationType_dictText) |
| | | this.$set(this.model, 'toolModel', item.toolModel) |
| | | this.$set(this.model, 'provinceCity', item.provinceCity) |
| | | this.$set(this.model, 'warehouseId', item.warehouseId) |
| | | this.$set(this.model, 'positionCode', item.positionCode) |
| | | this.$set(this.model, 'mainUnit', item.mainUnit) |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | methods: { |
| | | }, |
| | | |
| | | selectTools: function() { |
| | | this.$refs.toolListModel.showModals() |
| | |
| | | }, |
| | | |
| | | add() { |
| | | this.addShow = false |
| | | this.edit() |
| | | this.edit({}) |
| | | }, |
| | | |
| | | edit(record) { |
| | | console.log(record) |
| | | // this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | getAction(this.url.queryDetailList, { |
| | | id: record.id, |
| | | pageNo: 1, |
| | | pageSize: 99999 |
| | | }).then((res) => { |
| | | if (res.success) { |
| | | const readOnlyData = res.result.records[0] || {} |
| | | this.model = Object.assign({}, this.model, { |
| | | paramaTableName: readOnlyData.paramaTableName_dictText, |
| | | applicationType: readOnlyData.applicationType_dictText, |
| | | provinceCity: readOnlyData.provinceCity, |
| | | warehouseId: readOnlyData.warehouseId, |
| | | positionCode: readOnlyData.positionCode, |
| | | mainUnit: readOnlyData.mainUnit, |
| | | toolModel: readOnlyData.toolModel |
| | | }) |
| | | let that = this |
| | | that.visible = true |
| | | that.model = Object.assign({}, record) |
| | | // this.$nextTick(() => { |
| | | // this.form.setFieldsValue(pick(that.model, 'selectedDeparts', 'selectedProduction', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort', |
| | | // 'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName', 'systemValue')) |
| | | // }) |
| | | }, |
| | | // edit(record) { |
| | | // let that = this |
| | | // that.visible = true |
| | | // that.model = Object.assign({}, record) |
| | | // |
| | | // // 如果有 selectionRows 数据,则重新赋值 |
| | | // if (this.lastSelectionData && this.lastSelectionData.length > 0) { |
| | | // this.assignModelFromSelection(this.lastSelectionData[0]) |
| | | // console.log('this.model',this.assignModelFromSelection(this.lastSelectionData[0])) |
| | | // } |
| | | // }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | |
| | | } else { |
| | | this.dataSource = null |
| | | } |
| | | }) |
| | | }, |
| | | handleOk() { |
| | | const that = this |
| | |
| | | this.close() |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.$refs.form.clearValidate() |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |
| | | </style> |
| | | |
| | | |
| | | |