ÎļþÃû´Ó src/views/system/ProductionManager.vue ÐÞ¸Ä |
| | |
| | | <!--@rightClick="rightHandle"--> |
| | | <!--:selectedKeys="selectedKeys"--> |
| | | <!--:checkedKeys="checkedKeys"--> |
| | | <!--:treeData="departTree"--> |
| | | <!--:treeData="factoryTree"--> |
| | | <!--:checkStrictly="checkStrictly"--> |
| | | <!--:expandedKeys="iExpandedKeys"--> |
| | | <!--:autoExpandParent="autoExpandParent"--> |
| | |
| | | @rightClick="rightHandle" |
| | | :selectedKeys="selectedKeys" |
| | | :checkedKeys="checkedKeys" |
| | | :treeData="departTree" |
| | | :treeData="factoryTree" |
| | | :checkStrictly="checkStrictly" |
| | | :expandedKeys="iExpandedKeys" |
| | | :autoExpandParent="autoExpandParent" |
| | |
| | | <a-tab-pane tab="åºæ¬ä¿¡æ¯" key="1"> |
| | | <a-card :bordered="false" v-if="selectedKeys.length>0"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionCode" label="车é´ç¼å·"> |
| | | <a-input placeholder="请è¾å
¥äº§çº¿/车é´ç¼å·" v-model="model.productionCode"/> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryCode" label="车é´ç¼å·"> |
| | | <a-input placeholder="请è¾å
¥äº§çº¿/车é´ç¼å·" v-model="model.factoryCode"/> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionName" label="车é´åç§°"> |
| | | <a-input placeholder="请è¾å
¥äº§çº¿/车é´åç§°" v-model="model.productionName"/> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryName" label="车é´åç§°"> |
| | | <a-input placeholder="请è¾å
¥äº§çº¿/车é´åç§°" v-model="model.factoryName"/> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="ä¸çº§è½¦é´"> |
| | | <a-tree-select |
| | |
| | | </a-tree-select> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="æåº"> |
| | | <a-input-number v-model="model.productionOrder"/> |
| | | <a-input-number v-model="model.sorter"/> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="夿³¨"> |
| | | <a-textarea placeholder="请è¾å
¥å¤æ³¨" v-model="model.memo"/> |
| | | <a-textarea placeholder="请è¾å
¥å¤æ³¨" v-model="model.remark"/> |
| | | </a-form-model-item> |
| | | </a-form-model> |
| | | <div class="anty-form-btn"> |
| | |
| | | </a-empty> |
| | | </a-card> |
| | | </a-tab-pane> |
| | | <!--<a-tab-pane tab="é¨é¨æé" key="2" forceRender>--> |
| | | <!--<depart-auth-modal ref="departAuth"/>--> |
| | | <!--</a-tab-pane>--> |
| | | <a-tab-pane tab="设å¤å表" key="2" forceRender> |
| | | <!--<depart-auth-modal/>--> |
| | | <production-equipment ref="departAuth"></production-equipment> |
| | | </a-tab-pane> |
| | | |
| | | <!-- <a-tab-pane tab="设å¤å表" key="2" forceRender> |
| | | <factory-equipment ref="departAuth"></factory-equipment> |
| | | </a-tab-pane> --> |
| | | </a-tabs> |
| | | |
| | | </a-col> |
| | | <production-modal ref="departModal" @ok="loadTree"></production-modal> |
| | | <factory-modal ref="departModal" @ok="loadTree"></factory-modal> |
| | | </a-row> |
| | | </template> |
| | | <script> |
| | | import ProductionEquipment from './modules/ProductionManager/ProductionEquipment' |
| | | import { queryProductionTreeList, searchByKeywords, deleteByProduction } from '@/api/api' |
| | | import FactoryEquipment from './modules/FactoryManager/FactoryEquipment' |
| | | import { queryFactoryTreeList, searchByKeywords, deleteByFactory } from '@/api/api' |
| | | import { httpAction, deleteAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import ProductionModal from './modules/ProductionManager/ProductionModal' |
| | | import FactoryModal from './modules/FactoryManager/FactoryModal' |
| | | |
| | | export default { |
| | | name: 'ProductionManager', |
| | | name: 'FactoryManager', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | ProductionEquipment, |
| | | ProductionModal |
| | | FactoryEquipment, |
| | | FactoryModal |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | disable: true, |
| | | treeData: [], |
| | | visible: false, |
| | | departTree: [], |
| | | factoryTree: [], |
| | | rightClickSelectedKey: '', |
| | | rightClickSelectedOrgCode: '', |
| | | hiding: true, |
| | |
| | | edges: [] |
| | | }, |
| | | validatorRules: { |
| | | productionName: [{ required: true, message: '请è¾å
¥äº§çº¿/车é´åç§°!' }] |
| | | factoryName: [{ required: true, message: '请è¾å
¥äº§çº¿/车é´åç§°!' }] |
| | | }, |
| | | url: { |
| | | delete: '/mdc/mdcProduction/delete', |
| | | edit: '/mdc/mdcProduction/edit', |
| | | deleteBatch: '/mdc/mdcProduction/deleteBatch', |
| | | exportXlsUrl: '/mdc/mdcProduction/exportXls', |
| | | importExcelUrl: '/mdc/mdcProduction/importExcel' |
| | | delete: '/base/factory/delete', |
| | | edit: '/base/factory/edit', |
| | | deleteBatch: '/base/factory/deleteBatch', |
| | | exportXlsUrl: '/base/factory/exportXls', |
| | | importExcelUrl: '/base/factory/importExcel' |
| | | }, |
| | | orgCategoryDisabled: false, |
| | | isIncludesNotLeaf: false |
| | |
| | | loadTree() { |
| | | var that = this |
| | | that.treeData = [] |
| | | that.departTree = [] |
| | | queryProductionTreeList().then((res) => { |
| | | that.factoryTree = [] |
| | | queryFactoryTreeList().then((res) => { |
| | | if (res.success) { |
| | | //é¨é¨å
¨éåï¼åæ·»å é¨é¨ï¼é䏿°éå¢å¤ |
| | | this.allTreeKeys = [] |
| | | for (let i = 0; i < res.result.length; i++) { |
| | | let temp = res.result[i] |
| | | that.treeData.push(temp) |
| | | that.departTree.push(temp) |
| | | that.factoryTree.push(temp) |
| | | that.setThisExpandedKeys(temp) |
| | | that.getAllKeys(temp) |
| | | // console.log(temp.id) |
| | |
| | | batchDel: function() { |
| | | console.log(this.checkedKeys) |
| | | this.isIncludesNotLeaf = false |
| | | this.includesNotLeaf(this.departTree) |
| | | this.includesNotLeaf(this.factoryTree) |
| | | console.log('isIncludesNotLeaf', this.isIncludesNotLeaf) |
| | | |
| | | // 为trueå表示éä¸é¡¹å
å«éå¶åç»ç¹ falseå表示éä¸é¡¹å为å¶åç»ç¹ |
| | |
| | | if (value) { |
| | | searchByKeywords({ keyWord: value }).then((res) => { |
| | | if (res.success) { |
| | | that.departTree = [] |
| | | that.factoryTree = [] |
| | | for (let i = 0; i < res.result.length; i++) { |
| | | let temp = res.result[i] |
| | | that.departTree.push(temp) |
| | | that.factoryTree.push(temp) |
| | | } |
| | | } else { |
| | | // that.$message.warning(res.message) |
| | |
| | | this.$refs.departModal.add(this.selectedKeys) |
| | | this.$refs.departModal.title = 'æ°å¢' |
| | | } else { |
| | | this.$refs.departModal.add(this.rightClickSelectedKey) |
| | | this.$refs.departModal.add(this.currSelected) |
| | | this.$refs.departModal.title = 'æ°å¢' |
| | | } |
| | | }, |
| | |
| | | title: '确认å é¤', |
| | | content: `ç¡®å®è¦å é¤ ${that.currSelected.productionName} å?`, |
| | | onOk: function() { |
| | | deleteByProduction({ id: that.currSelected.id }).then((resp) => { |
| | | deleteByFactory({ id: that.currSelected.id }).then((resp) => { |
| | | if (resp.success) { |
| | | //å 餿ååï¼å»é¤å·²éä¸ä¸çæ°æ® |
| | | // that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1) |