已重命名3个文件
已添加5个文件
已修改1个文件
已删除1个文件
| | |
| | | const queryMyDepartTreeList = (params)=>getAction("/sys/sysDepart/queryMyDeptTreeList",params); |
| | | |
| | | //车é´ç®¡ç |
| | | const queryProductionTreeList = (params)=>getAction("/mdc/mdcProduction/queryTreeList",params); |
| | | const queryById = (params)=>getAction("/mdc/mdcProduction/queryIdTree",params); |
| | | const deleteByProduction = (params)=>deleteAction("/mdc/mdcProduction/delete",params); |
| | | const queryFactoryTreeList = (params)=>getAction("/base/factory/queryTreeList",params); |
| | | const queryById = (params)=>getAction("/base/factory/queryIdTree",params); |
| | | const deleteByFactory = (params)=>deleteAction("/base/factory/delete",params); |
| | | |
| | | |
| | | //æ¥å¿ç®¡ç |
| | |
| | | queryMyDepartTreeList, |
| | | getUserNoticeInfo, |
| | | getDictItemsFromCache, |
| | | queryProductionTreeList, |
| | | deleteByProduction, |
| | | queryFactoryTreeList, |
| | | deleteByFactory, |
| | | queryById, |
| | | addEquipment, |
| | | editEquipment |
ÎļþÃû´Ó 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) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-row :gutter="10"> |
| | | <a-col :md="leftColMd" :sm="24" style="margin-bottom: 20px"> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <!-- æç´¢åºå --> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :md="12" :sm="8"> |
| | | <a-form-item label="çç»åç§°" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}"> |
| | | <a-input placeholder="" v-model="queryParam.groupName"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-col :md="12" :sm="24"> |
| | | <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | </a-col> |
| | | </span> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator" style="margin: 5px 0 10px 2px"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | </div> |
| | | |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"> |
| | | </i> 已鿩 <a><b>{{ selectedRowKeys1.length }}</b></a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected1">æ¸
空</a> |
| | | </div> |
| | | |
| | | <div style="margin-top: 15px"> |
| | | <a-table |
| | | style="height:500px" |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type:'radio'}" |
| | | @change="handleTableChange"> |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleOpen(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-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete1(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | <!-- å³ä¾§çè§è²æéé
ç½® --> |
| | | <group-modal ref="modalForm" @ok="modalFormOk"></group-modal> |
| | | </a-card> |
| | | </a-col> |
| | | <a-col :md="rightColMd" :sm="24" v-if="this.rightcolval == 1"> |
| | | <a-card :bordered="false"> |
| | | <div style="text-align: right;"> |
| | | <a-icon type="close-circle" @click="hideUserList" /> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline"> |
| | | <a-row :gutter="24"> |
| | | |
| | | <a-col :md="12" :sm="12"> |
| | | <a-form-item label="ç¨æ·è´¦å·"> |
| | | <a-input placeholder="" v-model="queryParam2.username"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-col :md="9" :sm="24"> |
| | | <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | |
| | | </a-col> |
| | | </span> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator" :md="24" :sm="24"> |
| | | <a-button @click="handleAddUserGroup" type="primary" icon="plus" style="margin-top: 16px">æ·»å çç»äººå</a-button> |
| | | |
| | | <a-dropdown v-if="selectedRowKeys2.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel2"> |
| | | <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">{{ |
| | | selectedRowKeys2.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected2">æ¸
空</a> |
| | | </div> |
| | | <a-table |
| | | style="height:500px" |
| | | ref="table2" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :columns="columns2" |
| | | :dataSource="dataSource2" |
| | | :pagination="ipagination2" |
| | | :loading="loading2" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}" |
| | | @change="handleTableChange2"> |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a-popconfirm title="ç¡®å®åæ¶å
³èå?" @confirm="() => handleDelete2(record.id)"> |
| | | <a>åæ¶å
³è</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | <!-- 表ååºå --> |
| | | <group-modal ref="modalForm" @ok="modalFormOk"></group-modal> |
| | | <Select-User-Modal ref="selectUserModal" @selectFinished="selectOK"></Select-User-Modal> |
| | | </a-card> |
| | | </a-col> |
| | | </a-row> |
| | | </template> |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { deleteAction, postAction, getAction } from '@/api/manage' |
| | | import SelectUserModal from './modules/group/SelectUserModal' |
| | | import GroupModal from './modules/group/GroupModal' |
| | | import { filterObj } from '@/utils/util' |
| | | import moment from 'moment' |
| | | |
| | | export default { |
| | | name: 'ShiftGroupManager', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | SelectUserModal, |
| | | GroupModal, |
| | | moment |
| | | }, |
| | | data() { |
| | | return { |
| | | model1: {}, |
| | | model2: {}, |
| | | currentGroupId: '', |
| | | queryParam1: {}, |
| | | queryParam2: {}, |
| | | dataSource1: [], |
| | | dataSource2: [], |
| | | ipagination1: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | ipagination2: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | isorter1: { |
| | | column: 'createTime', |
| | | order: 'desc' |
| | | }, |
| | | isorter2: { |
| | | column: 'createTime', |
| | | order: 'desc' |
| | | }, |
| | | filters1: {}, |
| | | filters2: {}, |
| | | loading1: false, |
| | | loading2: false, |
| | | selectedRowKeys1: [], |
| | | selectedRowKeys2: [], |
| | | selectionRows1: [], |
| | | selectionRows2: [], |
| | | test:{}, |
| | | rightcolval:0, |
| | | columns: |
| | | [ |
| | | { |
| | | title: 'çç»ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'groupCode' |
| | | }, |
| | | { |
| | | title: 'çç»åç§°', |
| | | align: 'center', |
| | | dataIndex: 'groupName' |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | dataIndex: 'createTime', |
| | | align:"center", |
| | | sorter: true, |
| | | customRender: (text) => { |
| | | return moment(text).format('YYYY-MM-DD') |
| | | } |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | columns2: [{ |
| | | title: 'ç¨æ·è´¦å·', |
| | | align: 'center', |
| | | dataIndex: 'username', |
| | | width: 120 |
| | | }, |
| | | { |
| | | title: 'ç¨æ·åç§°', |
| | | align: 'center', |
| | | width: 100, |
| | | dataIndex: 'realname' |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | | align: 'center', |
| | | width: 80, |
| | | dataIndex: 'status_dictText' |
| | | }, |
| | | |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' }, |
| | | align: 'center', |
| | | width: 120 |
| | | }], |
| | | |
| | | // é«çº§æ¥è¯¢åæ° |
| | | superQueryParams2: '', |
| | | // é«çº§æ¥è¯¢æ¼æ¥æ¡ä»¶ |
| | | superQueryMatchType2: 'and', |
| | | url: { |
| | | list: '/base/shiftGroup/list', |
| | | delete: '/base/shiftGroup/delete', |
| | | list2: '/sys/user/userGroupList', |
| | | addUserGroup: '/sys/user/addBaseUserGroup', |
| | | delete2: '/sys/user/deleteUserGroup', |
| | | deleteBatch2: '/sys/user/deleteUserGroupBatch', |
| | | exportXlsUrl: 'sys/role/exportXls', |
| | | importExcelUrl: 'sys/role/importExcel' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | }, |
| | | leftColMd() { |
| | | return this.selectedRowKeys1.length === 0 ? 24 : 12 |
| | | }, |
| | | rightColMd() { |
| | | return this.selectedRowKeys1.length === 0 ? 0 : 12 |
| | | } |
| | | }, |
| | | methods: { |
| | | onSelectChange2(selectedRowKeys, selectionRows) { |
| | | this.selectedRowKeys2 = selectedRowKeys |
| | | this.selectionRows2 = selectionRows |
| | | }, |
| | | onClearSelected2() { |
| | | this.selectedRowKeys2 = [] |
| | | this.selectionRows2 = [] |
| | | }, |
| | | onClearSelected1() { |
| | | this.selectedRowKeys1 = [] |
| | | this.selectionRows1 = [] |
| | | }, |
| | | onSelectChange1(selectedRowKeys, selectionRows) { |
| | | this.rightcolval = 1 |
| | | this.selectedRowKeys1 = selectedRowKeys |
| | | this.selectionRows1 = selectionRows |
| | | this.model1 = Object.assign({}, selectionRows[0]) |
| | | this.currentGroupId = selectedRowKeys[0] |
| | | this.loadData2() |
| | | this.onClearSelected2() |
| | | }, |
| | | searchQuery() { |
| | | this.loadData(1); |
| | | this.onClearSelected1() |
| | | this.onClearSelected2() |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.loadData(1); |
| | | this.onClearSelected1() |
| | | this.onClearSelected2() |
| | | }, |
| | | modalFormOk() { |
| | | // æ°å¢/ä¿®æ¹ æåæ¶ï¼éè½½å表 |
| | | this.loadData(1); |
| | | this.loadData2(1); |
| | | //æ¸
空å表éä¸ |
| | | this.onClearSelected1() |
| | | this.onClearSelected2() |
| | | }, |
| | | getQueryParams2() { |
| | | //è·åæ¥è¯¢æ¡ä»¶ |
| | | let sqp = {} |
| | | if (this.superQueryParams2) { |
| | | sqp['superQueryParams'] = encodeURI(this.superQueryParams2) |
| | | sqp['superQueryMatchType'] = this.superQueryMatchType2 |
| | | } |
| | | var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2) |
| | | param.field = this.getQueryField2() |
| | | param.pageNo = this.ipagination2.current |
| | | param.pageSize = this.ipagination2.pageSize |
| | | return filterObj(param) |
| | | }, |
| | | getQueryField2() { |
| | | //TODO åæ®µæéæ§å¶ |
| | | var str = 'id,' |
| | | this.columns2.forEach(function(value) { |
| | | str += ',' + value.dataIndex |
| | | }) |
| | | return str |
| | | }, |
| | | loadData2(arg) { |
| | | if (!this.url.list2) { |
| | | this.$message.error('请设置url.list2屿§!') |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination2.current = 1 |
| | | } |
| | | if (this.currentGroupId === '') return |
| | | let params = this.getQueryParams2()//æ¥è¯¢æ¡ä»¶ |
| | | params.groupId = this.currentGroupId |
| | | this.loading2 = true |
| | | getAction(this.url.list2, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource2 = res.result.records |
| | | this.ipagination2.total = res.result.total |
| | | |
| | | } |
| | | this.loading2 = false |
| | | }) |
| | | |
| | | }, |
| | | handleDelete1: function(id) { |
| | | this.handleDelete(id) |
| | | this.dataSource2 = [] |
| | | this.currentGroupId = '' |
| | | this.onClearSelected1() |
| | | this.onClearSelected2() |
| | | }, |
| | | handleDelete2: function(id) { |
| | | if (!this.url.delete2) { |
| | | this.$message.error('请设置url.delete2屿§!') |
| | | return |
| | | } |
| | | var that = this |
| | | deleteAction(that.url.delete2, { groupId: this.currentGroupId, userId: id }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.loadData2() |
| | | this.onClearSelected2() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | batchDel2: function() { |
| | | |
| | | if (!this.url.deleteBatch2) { |
| | | this.$message.error('请设置url.deleteBatch2屿§!') |
| | | return |
| | | } |
| | | if (this.selectedRowKeys2.length <= 0) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡è®°å½ï¼') |
| | | return |
| | | } else { |
| | | var ids = '' |
| | | for (var a = 0; a < this.selectedRowKeys2.length; a++) { |
| | | ids += this.selectedRowKeys2[a] + ',' |
| | | } |
| | | var that = this |
| | | console.log(this.currentDeptId) |
| | | this.$confirm({ |
| | | title: 'ç¡®è®¤åæ¶å
³è', |
| | | content: 'æ¯å¦å é¤é䏿°æ®?', |
| | | onOk: function() { |
| | | deleteAction(that.url.deleteBatch2, { groupId: that.currentGroupId, userIds: ids }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.loadData2() |
| | | that.onClearSelected2() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | selectOK(data) { |
| | | let params = {} |
| | | params.groupId = this.currentGroupId |
| | | params.userIdList = [] |
| | | for (var a = 0; a < data.length; a++) { |
| | | params.userIdList.push(data[a]) |
| | | } |
| | | console.log(params) |
| | | postAction(this.url.addUserGroup, params).then((res) => { |
| | | if (res.success) { |
| | | this.loadData2() |
| | | this.$message.success(res.message) |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleAddUserGroup() { |
| | | if (this.currentGroupId == '') { |
| | | this.$message.error('è¯·éæ©ä¸ä¸ªçç»!') |
| | | } else { |
| | | this.$refs.selectUserModal.visible = true |
| | | } |
| | | }, |
| | | handleOpen(record) { |
| | | this.rightcolval = 1 |
| | | this.selectedRowKeys1 = [record.id] |
| | | this.model1 = Object.assign({}, record) |
| | | this.currentGroupId = record.id |
| | | this.onClearSelected2() |
| | | this.loadData2() |
| | | }, |
| | | searchQuery2() { |
| | | this.loadData2(1) |
| | | this.onClearSelected2() |
| | | }, |
| | | searchReset2() { |
| | | this.queryParam2 = {} |
| | | this.loadData2(1) |
| | | this.onClearSelected2() |
| | | }, |
| | | handleTableChange2(pagination, filters, sorter) { |
| | | //å页ãæåºãçéååæ¶è§¦å |
| | | //TODO çé |
| | | if (Object.keys(sorter).length > 0) { |
| | | this.isorter2.column = sorter.field |
| | | this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc' |
| | | } |
| | | this.ipagination2 = pagination |
| | | this.loadData2() |
| | | }, |
| | | hideUserList(){ |
| | | //this.rightcolval = 0 |
| | | this.selectedRowKeys1 = [] |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | /** Buttonæé®é´è· */ |
| | | .ant-btn { |
| | | margin-left: 8px |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="çæ¬¡ç¼å·"> |
| | | <j-input placeholder="请è¾å
¥ç次ç¼å·" v-model="queryParam.shiftCode"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="çæ¬¡åç§°"> |
| | | <j-input placeholder="请è¾å
¥ç次åç§°" v-model="queryParam.shiftName"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button type="primary" @click="handleAdd" icon="plus">æ°å¢</a-button> |
| | | </div> |
| | | <!-- tableåºå-begin --> |
| | | <div style="width: 100%;flex: 1;overflow: auto"> |
| | | <a-table ref="table" bordered size="middle" rowKey="id" :columns="columns" |
| | | :dataSource="dataSource" :pagination="false" class="j-table-force-nowrap" :loading="loading"> |
| | | <span |
| | | slot="shiftStatus" |
| | | slot-scope="text, record" |
| | | > |
| | | <span v-if="text == 0" style="color:red;">åç¨</span> |
| | | <span v-if="text == 1" style="color:green;">å¯ç¨</span> |
| | | </span> |
| | | <span |
| | | slot="crossDayFlag" |
| | | slot-scope="text, record" |
| | | > |
| | | <span v-if="text == '1'">æ¯</span> |
| | | <span v-if="text == '0'">å¦</span> |
| | | </span> |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a v-if="record.shiftStatus == 1" @click="handleEdit(record)">ç¼è¾</a> |
| | | <a-divider type="vertical" v-if="record.shiftStatus == 1"/> |
| | | <a v-if="record.shiftStatus == 0" @click="handleStatus(record.id,1)">å¯ç¨</a> |
| | | <a v-if="record.shiftStatus == 1" @click="handleStatus(record.id,0)">åç¨</a> |
| | | <a-divider type="vertical" /> |
| | | <a @click="handleDelete(record.id)">å é¤</a> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | |
| | | <shift-model ref="modalForm" @ok="modalFormOk"></shift-model> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | requestPut, putAction, deleteAction |
| | | } from '@/api/manage' |
| | | import { |
| | | JeecgListMixin |
| | | } from '@/mixins/JeecgListMixin' |
| | | import ShiftModel from './modules/shift/ShiftModel' |
| | | |
| | | export default { |
| | | name: 'ShiftManager', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | ShiftModel |
| | | }, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | url: { |
| | | list: '/base/shift/list', |
| | | changeStatus: '/base/shift/updateStatusById', |
| | | deleteBatch: '/base/shift/delete' |
| | | }, |
| | | columns: [ |
| | | { |
| | | title: 'çæ¬¡ç¼å·', |
| | | align: 'center', |
| | | dataIndex: 'shiftCode' |
| | | }, |
| | | { |
| | | title: 'çæ¬¡åç§°', |
| | | align: 'center', |
| | | dataIndex: 'shiftName' |
| | | }, |
| | | { |
| | | title: 'å¼å§æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'startTime' |
| | | }, |
| | | { |
| | | title: 'ç»ææ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'endTime' |
| | | }, |
| | | { |
| | | title: '工使¶é¿', |
| | | align: 'center', |
| | | dataIndex: 'workHours' |
| | | }, |
| | | { |
| | | title: 'æ¯å¦è·¨å¤©', |
| | | align: 'center', |
| | | dataIndex: 'crossDayFlag', |
| | | scopedSlots: { customRender: 'crossDayFlag' } |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'shiftStatus', |
| | | scopedSlots: { customRender: 'shiftStatus' } |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | align: 'center', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | methods: { |
| | | handleAdd() { |
| | | this.$refs.modalForm.add() |
| | | this.$refs.modalForm.title = 'æ°å¢ç次' |
| | | this.$refs.modalForm.disableSubmit = false |
| | | }, |
| | | handleEdit(record) { |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = 'ç¼è¾ç次' |
| | | this.$refs.modalForm.disableSubmit = true |
| | | }, |
| | | handleDelete: function(record){ |
| | | if(!this.url.deleteBatch){ |
| | | this.$message.error("请设置url.delete屿§!") |
| | | return |
| | | } |
| | | var that = this; |
| | | deleteAction(that.url.deleteBatch, {id: record}).then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | that.loadData(); |
| | | } else { |
| | | that.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | handleStatus(id, status) { |
| | | let _this = this |
| | | putAction(this.url.changeStatus, { id: id, status: status }).then((res) => { |
| | | if (res.success) { |
| | | _this.$notification.success({ |
| | | message:'æ¶æ¯', |
| | | description:"æä½æå" |
| | | }); |
| | | _this.loadData() |
| | | } else { |
| | | _this.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:"æä½å¤±è´¥" |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | created() { |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
ÎļþÃû´Ó src/views/system/modules/ProductionManager/ProductionEquipment.vue ÐÞ¸Ä |
| | |
| | | import { getAction,postAction } from '@/api/manage' |
| | | import qs from 'qs' |
| | | export default { |
| | | name: 'ProductionEquipment', |
| | | name: 'FactoryEquipment', |
| | | mixins: [JeecgListMixin], |
| | | data(){ |
| | | return { |
ÎļþÃû´Ó src/views/system/modules/ProductionManager/ProductionModal.vue ÐÞ¸Ä |
| | |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="车é´ç¼ç " |
| | | prop="productionCode" |
| | | prop="factoryCode" |
| | | :hidden="false" |
| | | hasFeedback > |
| | | <a-input id="productionCode" placeholder="请è¾å
¥äº§çº¿/车é´ç¼å·" v-model="model.productionCode"/> |
| | | <a-input id="factoryCode" placeholder="请è¾å
¥äº§çº¿/车é´ç¼å·" v-model="model.factoryCode"/> |
| | | </a-form-model-item> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="车é´åç§°" |
| | | prop="productionName" |
| | | prop="factoryName" |
| | | :hidden="false" |
| | | hasFeedback > |
| | | <a-input id="departName" placeholder="请è¾å
¥äº§çº¿/车é´åç§°" v-model="model.productionName"/> |
| | | <a-input id="factoryName" placeholder="请è¾å
¥äº§çº¿/车é´åç§°" v-model="model.factoryName"/> |
| | | </a-form-model-item> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :hidden="seen" label="ä¸çº§è½¦é´" hasFeedback> |
| | | <a-tree-select |
| | | style="width:100%" |
| | | :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" |
| | | :treeData="departTree" |
| | | :treeData="factoryTree" |
| | | v-model="model.parentId" |
| | | placeholder="è¯·éæ©ä¸çº§è½¦é´" |
| | | :disabled="condition"> |
| | |
| | | :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> |
| | |
| | | import { queryById } from '@/api/api' |
| | | import pick from 'lodash.pick' |
| | | export default { |
| | | name: "ProductionModal", |
| | | name: "FactoryModal", |
| | | components: { }, |
| | | data () { |
| | | return { |
| | | departTree:[], |
| | | orgTypeData:[], |
| | | phoneWarning:'', |
| | | departName:"", |
| | | factoryTree:[], |
| | | title:"æä½", |
| | | seen:false, |
| | | visible: false, |
| | | condition:true, |
| | | disableSubmit:false, |
| | | model: {}, |
| | | menuhidden:false, |
| | | menuusing:true, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | |
| | | |
| | | confirmLoading: false, |
| | | validatorRules:{ |
| | | productionName:[{ required: true, message: '请è¾å
¥äº§çº¿/车é´åç§°!' }], |
| | | factoryName:[{ required: true, message: '请è¾å
¥äº§çº¿/车é´åç§°!' }], |
| | | }, |
| | | url: { |
| | | add: "/mdc/mdcProduction/add", |
| | | add: "/base/factory/add", |
| | | }, |
| | | dictDisabled:true, |
| | | } |
| | |
| | | var that = this; |
| | | queryById().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); |
| | | } |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | add (depart) { |
| | | if(depart){ |
| | | add (factory) { |
| | | if(factory){ |
| | | this.seen = false; |
| | | this.dictDisabled = false; |
| | | }else{ |
| | | this.seen = true; |
| | | this.dictDisabled = true; |
| | | } |
| | | this.edit(depart); |
| | | this.edit(factory); |
| | | }, |
| | | edit (record) { |
| | | this.visible = true; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | wrapClassName="ant-modal-cust-warp" |
| | | style="top:5%;height: 85%;overflow-y: hidden"> |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" v-bind="layout" :model="model" :rules="validatorRules"> |
| | | <a-form-model-item label="çç»ç¼ç " required prop="groupCode"> |
| | | <a-input v-model="model.groupCode" :disabled="roleDisabled" placeholder="请è¾å
¥çç»ç¼ç "/> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="çç»åç§°" required prop="groupName"> |
| | | <a-input v-model="model.groupName" placeholder="请è¾å
¥çç»åç§°"/> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="çç»é¿" prop="groupManager"> |
| | | <j-dict-select-tag |
| | | type="list" |
| | | v-model="model.groupManager" |
| | | :trigger-change="true" |
| | | dictCode="sys_user,realname,id" |
| | | placeholder="è¯·éæ©çç»é¿" |
| | | /> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="产线" prop="factoryId"> |
| | | <j-dict-select-tag |
| | | type="list" |
| | | v-model="model.factoryId" |
| | | :trigger-change="true" |
| | | dictCode="base_factory,factory_name,id" |
| | | placeholder="è¯·éæ©äº§çº¿" |
| | | /> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="çæ¬¡" prop="shiftId"> |
| | | <j-dict-select-tag |
| | | type="list" |
| | | v-model="model.shiftId" |
| | | :trigger-change="true" |
| | | dictCode="base_shift,shift_name,id" |
| | | placeholder="è¯·éæ©çæ¬¡" |
| | | /> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="夿³¨" prop="remark"> |
| | | <a-textarea :rows="5" v-model="model.remark" placeholder="请è¾å
¥å¤æ³¨"/> |
| | | </a-form-model-item> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import {duplicateCheck } from '@/api/api' |
| | | import {postAction,requestPut} from '@/api/manage' |
| | | import JDictSelectTag from '@/components/dict/JDictSelectTag' |
| | | export default { |
| | | name: "GroupModal", |
| | | components: { |
| | | JDictSelectTag, |
| | | }, |
| | | data () { |
| | | return { |
| | | title:"æä½", |
| | | visible: false, |
| | | roleDisabled: false, |
| | | model: {}, |
| | | layout: { |
| | | labelCol: { span: 3 }, |
| | | wrapperCol: { span: 14 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules:{ |
| | | groupName: [ |
| | | { required: true, message: '请è¾å
¥çç»åç§°!' }, |
| | | { min: 2, max: 30, message: 'é¿åº¦å¨ 2 å° 30 个å符', trigger: 'blur' } |
| | | ], |
| | | groupCode: [ |
| | | { required: true, message: '请è¾å
¥çç»åç§°!'}, |
| | | { min: 0, max: 64, message: 'é¿åº¦ä¸è¶
è¿ 64 个å符', trigger: 'blur' }, |
| | | { validator: this.validategroupCode} |
| | | ], |
| | | remark: [ |
| | | { min: 0, max: 126, message: 'é¿åº¦ä¸è¶
è¿ 126 个å符', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: "/base/shiftGroup/add", |
| | | edit: "/base/shiftGroup/edit", |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | }, |
| | | close () { |
| | | this.$refs.form.clearValidate(); |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk () { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true; |
| | | let obj; |
| | | if(!this.model.id){ |
| | | obj=postAction(this.url.add, this.model) |
| | | }else{ |
| | | obj=requestPut(this.url.edit, this.model, { |
| | | id: this.model.id |
| | | }) |
| | | } |
| | | obj.then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | }else{ |
| | | return false; |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | validategroupCode(rule, value, callback){ |
| | | if(/[\u4E00-\u9FA5]/g.test(value)){ |
| | | callback("çç»ç¼ç ä¸å¯è¾å
¥æ±å!"); |
| | | }else{ |
| | | let params = { |
| | | tableName: "base_shift_group", |
| | | fieldName: "group_code", |
| | | fieldVal: value, |
| | | dataId: this.model.id, |
| | | }; |
| | | duplicateCheck(params).then((res)=>{ |
| | | if(res.success){ |
| | | callback(); |
| | | }else{ |
| | | callback(res.message); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <a-modal |
| | | centered |
| | | :title="title" |
| | | :width="1000" |
| | | :visible="visible" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | |
| | | |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | |
| | | <a-col :span="10"> |
| | | <a-form-item label="ç¨æ·è´¦å·"> |
| | | <a-input placeholder="请è¾å
¥ç¨æ·è´¦å·" v-model="queryParam.username"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <a-table |
| | | size="small" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns1" |
| | | :dataSource="dataSource1" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :scroll="{ y: 240 }" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys,onSelectAll:onSelectAll,onSelect:onSelect,onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | |
| | | </a-table> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | |
| | | |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import {filterObj} from '@/utils/util' |
| | | import {getAction} from '@/api/manage' |
| | | |
| | | export default { |
| | | name: "SelectUserModal", |
| | | data() { |
| | | return { |
| | | title: "æ·»å çç»äººå", |
| | | names: [], |
| | | visible: false, |
| | | placement: 'right', |
| | | description: '', |
| | | // æ¥è¯¢æ¡ä»¶ |
| | | queryParam: {}, |
| | | // 表头 |
| | | columns1: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: "center", |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | { |
| | | title: 'ç¨æ·è´¦å·', |
| | | align: "center", |
| | | width: 100, |
| | | dataIndex: 'username' |
| | | }, |
| | | { |
| | | title: 'ç¨æ·åç§°', |
| | | align: "center", |
| | | width: 100, |
| | | dataIndex: 'realname' |
| | | }, |
| | | { |
| | | title: 'æ§å«', |
| | | align: "center", |
| | | width: 100, |
| | | dataIndex: 'sex_dictText' |
| | | }, |
| | | { |
| | | title: 'çµè¯', |
| | | align: "center", |
| | | width: 100, |
| | | dataIndex: 'phone' |
| | | }, |
| | | { |
| | | title: 'é¨é¨', |
| | | align: "center", |
| | | width: 150, |
| | | dataIndex: 'orgCode' |
| | | } |
| | | ], |
| | | columns2: [ |
| | | { |
| | | title: 'ç¨æ·è´¦å·', |
| | | align: "center", |
| | | dataIndex: 'username', |
| | | |
| | | }, |
| | | { |
| | | title: 'ç¨æ·åç§°', |
| | | align: "center", |
| | | dataIndex: 'realname', |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: "center", |
| | | width: 100, |
| | | scopedSlots: {customRender: 'action'}, |
| | | } |
| | | ], |
| | | //æ°æ®é |
| | | dataSource1: [], |
| | | dataSource2: [], |
| | | // å页忰 |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " å
±" + total + "æ¡" |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | isorter: { |
| | | column: 'createTime', |
| | | order: 'desc', |
| | | }, |
| | | loading: false, |
| | | selectedRowKeys: [], |
| | | selectedRows: [], |
| | | url: { |
| | | list: "/sys/user/list", |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.loadData(); |
| | | }, |
| | | methods: { |
| | | searchQuery() { |
| | | this.loadData(1); |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = {}; |
| | | this.loadData(1); |
| | | }, |
| | | handleCancel() { |
| | | this.visible = false; |
| | | }, |
| | | handleOk() { |
| | | this.dataSource2 = this.selectedRowKeys; |
| | | console.log("data:" + this.dataSource2); |
| | | this.$emit("selectFinished", this.dataSource2); |
| | | this.visible = false; |
| | | }, |
| | | add() { |
| | | this.visible = true; |
| | | }, |
| | | loadData(arg) { |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource1 = res.result.records; |
| | | this.ipagination.total = res.result.total; |
| | | } |
| | | }) |
| | | }, |
| | | getQueryParams() { |
| | | var param = Object.assign({}, this.queryParam, this.isorter); |
| | | param.field = this.getQueryField(); |
| | | param.pageNo = this.ipagination.current; |
| | | param.pageSize = this.ipagination.pageSize; |
| | | return filterObj(param); |
| | | }, |
| | | getQueryField() { |
| | | //TODO åæ®µæéæ§å¶ |
| | | }, |
| | | onSelectAll(selected, selectedRows, changeRows) { |
| | | if (selected === true) { |
| | | for (var a = 0; a < changeRows.length; a++) { |
| | | this.dataSource2.push(changeRows[a]); |
| | | } |
| | | } else { |
| | | for (var b = 0; b < changeRows.length; b++) { |
| | | this.dataSource2.splice(this.dataSource2.indexOf(changeRows[b]), 1); |
| | | } |
| | | } |
| | | // console.log(selected, selectedRows, changeRows); |
| | | }, |
| | | onSelect(record, selected) { |
| | | if (selected === true) { |
| | | this.dataSource2.push(record); |
| | | } else { |
| | | var index = this.dataSource2.indexOf(record); |
| | | //console.log(); |
| | | if (index >= 0) { |
| | | this.dataSource2.splice(this.dataSource2.indexOf(record), 1); |
| | | } |
| | | |
| | | } |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectedRows) { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.selectionRows = selectedRows; |
| | | }, |
| | | onClearSelected() { |
| | | this.selectedRowKeys = []; |
| | | this.selectionRows = []; |
| | | }, |
| | | handleDelete: function (record) { |
| | | this.dataSource2.splice(this.dataSource2.indexOf(record), 1); |
| | | }, |
| | | handleTableChange(pagination, filters, sorter) { |
| | | //å页ãæåºãçéååæ¶è§¦å |
| | | console.log(sorter); |
| | | //TODO çé |
| | | if (Object.keys(sorter).length > 0) { |
| | | this.isorter.column = sorter.field; |
| | | this.isorter.order = "ascend" == sorter.order ? "asc" : "desc" |
| | | } |
| | | this.ipagination = pagination; |
| | | this.loadData(); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="less" scoped> |
| | | .ant-card-body .table-operator { |
| | | margin-bottom: 18px; |
| | | } |
| | | |
| | | .ant-table-tbody .ant-table-row td { |
| | | padding-top: 15px; |
| | | padding-bottom: 15px; |
| | | } |
| | | |
| | | .anty-row-operator button { |
| | | margin: 0 5px |
| | | } |
| | | |
| | | .ant-btn-danger { |
| | | background-color: #ffffff |
| | | } |
| | | |
| | | .ant-modal-cust-warp { |
| | | height: 100% |
| | | } |
| | | |
| | | .ant-modal-cust-warp .ant-modal-body { |
| | | height: calc(100% - 110px) !important; |
| | | overflow-y: auto |
| | | } |
| | | |
| | | .ant-modal-cust-warp .ant-modal-content { |
| | | height: 90% !important; |
| | | overflow-y: hidden |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" |
| | | @ok="handleOk" @cancel="handleCancel" cancelText="å
³é"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item label="çæ¬¡ç¼ç " :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input allow-clear placeholder="请è¾å
¥ç次ç¼ç " |
| | | v-decorator="['shiftCode',validatorRules.shiftCode]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="çæ¬¡åç§°" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input allow-clear placeholder="请è¾å
¥ç次åç§°" v-decorator="['shiftName',validatorRules.shiftName]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item label="å¼å§æ¶é´" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-time-picker v-decorator="['startTime',validatorRules.startTime]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="ç»ææ¶é´" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-time-picker v-decorator="['endTime',validatorRules.endTime]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item label="工使¶é¿" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-number v-decorator="['workHours',validatorRules.workHours]" placeholder="请è¾å
¥å·¥ä½æ¶é¿(å°æ¶)" style="width: 100%" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="æ¯å¦è·¨å¤©" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-switch v-model="crossDayFlag" checked-children="æ¯" un-checked-children="å¦"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | import pick from 'lodash.pick' |
| | | import { |
| | | getAction, |
| | | postAction, |
| | | requestPut |
| | | } from '@/api/manage' |
| | | import { |
| | | duplicateCheck |
| | | } from '@/api/api' |
| | | |
| | | |
| | | export default { |
| | | name: 'ShiftModel', |
| | | components: {}, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | title: '', |
| | | crossDayFlag: false, |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { |
| | | span: 24 |
| | | }, |
| | | sm: { |
| | | span: 6 |
| | | } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { |
| | | span: 24 |
| | | }, |
| | | sm: { |
| | | span: 18 |
| | | } |
| | | }, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | shiftCode: { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥ç次ç¼å·' |
| | | }, |
| | | { validator: this.validateNum } |
| | | ] |
| | | }, |
| | | shiftName: { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥ç次åç§°' |
| | | }, |
| | | { validator: this.validateName } |
| | | ] |
| | | }, |
| | | startDate: { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: 'è¯·éæ©å¼å§æ¶é´' |
| | | } |
| | | ] |
| | | }, |
| | | endDate: { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: 'è¯·éæ©ç»ææ¶é´' |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | url: { |
| | | add: '/base/shift/add', |
| | | edit: '/base/shift/edit', |
| | | list: '/base/shift/list' |
| | | }, |
| | | disableSubmit: true |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | add() { |
| | | let _this = this |
| | | this.visible = true |
| | | this.form.resetFields() |
| | | this.model = {} |
| | | this.$nextTick(() => { |
| | | this.crossDayFlag = false |
| | | }) |
| | | }, |
| | | edit(record) { |
| | | this.form.resetFields() |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'shiftCode', 'shiftName', 'startTime', 'endTime','workHours')) |
| | | this.form.setFieldsValue({ |
| | | startTime: moment(this.model.startTime, 'HH:mm:ss'), |
| | | endTime: moment(this.model.endTime, 'HH:mm:ss') |
| | | }) |
| | | if (record.crossDayFlag == '1') { |
| | | this.crossDayFlag = true |
| | | } else { |
| | | this.crossDayFlag = false |
| | | } |
| | | }) |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | handleOk() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | // debugger |
| | | that.confirmLoading = true |
| | | let formData = Object.assign(this.model, values) |
| | | if(that.crossDayFlag == true){ |
| | | formData.crossDayFlag = '1' |
| | | }else if(that.crossDayFlag == false){ |
| | | formData.crossDayFlag = '0' |
| | | } |
| | | formData.startTime = moment(formData.startTime).format('HH:mm:ss') |
| | | formData.endTime = moment(formData.endTime).format('HH:mm:ss') |
| | | if (formData.crossDayFlag == '0') { |
| | | let startTimeOne = formData.startTime.replace(/:/g, '') |
| | | let endTimeOne = formData.endTime.replace(/:/g, '') |
| | | if (startTimeOne > endTimeOne) { |
| | | // that.$message.warning("éè·¨å¤©çæ¬¡ç»ææ¶é´ä¸è½å°äºçäºå¼å§æ¶é´ï¼") |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'éè·¨å¤©çæ¬¡ç»ææ¶é´ä¸è½å°äºçäºå¼å§æ¶é´ï¼' |
| | | }) |
| | | that.confirmLoading = false |
| | | that.close() |
| | | } else { |
| | | formData.shiftStatus = 1 |
| | | let obj |
| | | if (!this.model.id) { |
| | | obj = postAction(this.url.add, formData) |
| | | } else { |
| | | obj = requestPut(this.url.edit, formData, { |
| | | id: this.model.id |
| | | }) |
| | | } |
| | | obj.then((res) => { |
| | | if (res.success) { |
| | | // that.$message.success("ä¿åæå") |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: 'ä¿åæå' |
| | | }) |
| | | that.$emit('ok', res.result) |
| | | } else { |
| | | // that.$message.warning(res.message) |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | } |
| | | } else { |
| | | formData.shiftStatus = 1 |
| | | let obj |
| | | if (!this.model.id) { |
| | | obj = postAction(this.url.add, formData) |
| | | } else { |
| | | obj = requestPut(this.url.edit, formData, { |
| | | id: this.model.id |
| | | }) |
| | | } |
| | | obj.then((res) => { |
| | | if (res.success) { |
| | | // that.$message.success |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: 'ä¿åæå' |
| | | }) |
| | | that.$emit('ok', res.result) |
| | | } else { |
| | | // that.$message.warning(res.message) |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | } |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | //éªè¯ ç¼ç |
| | | validateNum(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'base_shift', |
| | | fieldName: 'shift_code', |
| | | fieldVal: value, |
| | | dataId: this.model.id, |
| | | //æ°æ®åºä¸åå¨å段del_flag并使ç¨è¯¥å段ä½ä¸ºæªå é¤çç¥ï¼çå é¤ï¼false åå é¤ï¼true |
| | | delFlag: 'true' |
| | | } |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback() |
| | | } else { |
| | | callback('çæ¬¡ç¼å·å·²åå¨!') |
| | | } |
| | | }) |
| | | }, |
| | | //éªè¯ åç§° |
| | | validateName(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'base_shift', |
| | | fieldName: 'shift_name', |
| | | fieldVal: value, |
| | | dataId: this.model.id, |
| | | //æ°æ®åºä¸åå¨å段del_flag并使ç¨è¯¥å段ä½ä¸ºæªå é¤çç¥ï¼çå é¤ï¼false åå é¤ï¼true |
| | | delFlag: 'true', |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback(); |
| | | } else { |
| | | callback("çæ¬¡åç§°å·²åå¨!"); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-btn { |
| | | padding: 0 10px; |
| | | margin-left: 3px; |
| | | } |
| | | |
| | | .ant-form-item-control { |
| | | line-height: 0px; |
| | | } |
| | | |
| | | /** 主表åè¡é´è· */ |
| | | .ant-form .ant-form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | /** Tab页é¢è¡é´è· */ |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | </style> |