| | |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="刀具名称"> |
| | | <a-input placeholder="请输入刀具名称" v-model="queryParam.toolName"></a-input> |
| | | <j-input placeholder="请输入刀具名称" v-model="queryParam.toolName"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="刃磨结果"> |
| | | <a-input placeholder="请输入刃磨结果" v-model="queryParam.grindingResult"></a-input> |
| | | <j-input placeholder="请输入刃磨结果" v-model="queryParam.grindingResult"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <tools-sharpening-modal ref="modalForm" :treeSelected="treeSelected" @ok="modalFormOk"></tools-sharpening-modal> |
| | | <tools-sharpening-modal ref="modalForm" @ok="modalFormOk"></tools-sharpening-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | |
| | | { |
| | | title:'刀具分类', |
| | | align:"center", |
| | | dataIndex: 'warehouseId' |
| | | dataIndex: 'paramaTableName_dictText' |
| | | }, |
| | | { |
| | | title:'刀具编号', |
| | | align:"center", |
| | | dataIndex: 'warehouseName' |
| | | dataIndex: 'toolId' |
| | | }, |
| | | { |
| | | title:'刀具名称', |
| | | align:"center", |
| | | dataIndex: 'warehouseName' |
| | | }, |
| | | { |
| | | title:'刀具材料', |
| | | align:"center", |
| | | dataIndex: 'parentWarehouseName', |
| | | }, |
| | | { |
| | | title:'厂家', |
| | | align:"center", |
| | | dataIndex: 'status', |
| | | }, |
| | | { |
| | | title:'零件材料', |
| | | align:"center", |
| | | dataIndex: 'remark' |
| | | dataIndex: 'typeName' |
| | | }, |
| | | |
| | | { |
| | | title:'厂家', |
| | | align:"center", |
| | | dataIndex: 'supplierId', |
| | | }, |
| | | { |
| | | title:'刃磨时间', |
| | | align:"center", |
| | | dataIndex: 'createBy' |
| | | dataIndex: 'sharpeningTime' |
| | | }, |
| | | { |
| | | title:'刃磨结果及建议', |
| | | align:"center", |
| | | dataIndex: 'createBy' |
| | | dataIndex: 'sharpeningResult' |
| | | }, |
| | | { |
| | | title:'责任人', |
| | | align:"center", |
| | | dataIndex: 'createBy' |
| | | dataIndex: 'responsiblePerson_dictText' |
| | | }, |
| | | |
| | | { |
| | |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/tms/toolSharpening/list", |
| | | list: "/tms/toolSharpening/listToolSharpening", |
| | | add: "/tms/toolSharpening/add", |
| | | delete: "/tms/toolSharpening/delete", |
| | | edit: "/tms/toolSharpening/edit", |
| | | deleteBatch: "/tms/toolSharpening/deleteBatch", |
| | |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | treeSelected: {}, |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | created() {}, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | addFlag: function(){ |
| | | return !(this.treeSelected.key && this.treeSelected.entity.leafFlag === '2'); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.handleGetCurrSelected = (data) => { |
| | | this.treeSelected = data; |
| | | this.queryParam.parentId = data.key; |
| | | this.loadData(); |
| | | } |
| | | this.$bus.$on('getCurrSelected', this.handleGetCurrSelected); |
| | | }, |
| | | beforeDestroy() { |
| | | this.$bus.$off('getCurrSelected', this.handleGetCurrSelected); |
| | | }, |
| | | |
| | | methods: { |
| | | handleStatus(record) { |
| | | getAction(this.url.list, { parentId: record.id }).then((res) => { |
| | | if (res.success) { |
| | | if (res.result.total > 0) { |
| | | this.$message.warning('该节点下存在子节点,不能变更状态!') |
| | | } else { |
| | | const params = { |
| | | id: record.id, |
| | | status: record.status === '1' ? '2' : '1' |
| | | } |
| | | putAction(this.url.edit, params).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success(res.message) |
| | | this.loadData() |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | this.$message.warning(res.message); |
| | | } |
| | | }); |
| | | onInspectionDateChange: function(value, dateString) { |
| | | this.queryParam.inspectionDateBegin = dateString[0] |
| | | this.queryParam.inspectionDateEnd = dateString[1] |
| | | }, |
| | | |
| | | |
| | | handleEdit: function (record) { |
| | | console.log('record:', record) |
| | | this.$refs.modalForm.title = '编辑' |
| | | this.$refs.modalForm.disableSubmit = false |
| | | this.$refs.modalForm.edit(record) |
| | | |
| | | }, |
| | | handleDelete(id) { |
| | | getAction(this.url.list, { parentId: id }).then((res) => { |
| | | 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) { |
| | | if (res.result.total > 0) { |
| | | this.$message.warning('请先删除子节点'); |
| | | } else { |
| | | deleteAction(this.url.delete, {id: id}).then((res) => { |
| | | if (res.success) { |
| | | //重新计算分页问题 |
| | | this.loadData() |
| | | this.$message.success(res.message); |
| | | this.$bus.$emit('queryTreeData') |
| | | } else { |
| | | this.$message.warning(res.message); |
| | | } |
| | | }); |
| | | } |
| | | //重新计算分页问题 |
| | | this.reCalculatePage(1) |
| | | this.$message.success(res.message) |
| | | this.$refs.toolStockingBoundDetail.dataSource = [] |
| | | this.loadData() |
| | | } else { |
| | | this.$message.warning(res.message); |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = { |
| | | parentId: this.treeSelected.key |
| | | } |
| | | this.loadData(1) |
| | | }, |
| | | modalFormOk() { |
| | | this.loadData() |
| | | this.$bus.$emit('queryTreeData') |
| | | }, |
| | | initDictConfig(){ |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'string',value:'toolId',text:'工具编号',dictCode:''}) |
| | | fieldList.push({type:'string',value:'warehouseName',text:'仓库名称',dictCode:''}) |
| | | fieldList.push({type:'string',value:'parentId',text:'父节点编号',dictCode:''}) |
| | | fieldList.push({type:'string',value:'seq',text:'展示序号',dictCode:''}) |
| | | fieldList.push({type:'string',value:'leafFlag',text:'是否叶子节点(1是;2否)',dictCode:''}) |
| | | fieldList.push({type:'string',value:'status',text:'状态(1启用;2停用)',dictCode:''}) |
| | | fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''}) |
| | | fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''}) |
| | | fieldList.push({type:'date',value:'createTime',text:'创建时间'}) |
| | | this.superFieldList = fieldList |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |