| | |
| | | <a-row style="margin-left: 14px"> |
| | | <a-button @click="handleAdd(1)" type="primary">æ·»å 车é´</a-button> |
| | | <a-button @click="handleAdd(2)" type="primary">æ·»å ä¸çº§</a-button> |
| | | <a-button type="primary" icon="download" @click="handleExportXls('车é´ä¿¡æ¯')">导åº</a-button> |
| | | <!-- <a-button type="primary" icon="download" @click="handleExportXls('车é´ä¿¡æ¯')">导åº</a-button> |
| | | <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-upload> --> |
| | | <a-button @click="handleDelete" v-if="selectedKeys.length>0">å é¤</a-button> |
| | | <a-button title="å é¤å¤æ¡æ°æ®" @click="batchDel" v-if="checkedKeys.length>0">æ¹éå é¤</a-button> |
| | | <!--<a-button @click="refresh" type="default" icon="reload" :loading="loading">å·æ°</a-button>--> |
| | |
| | | <a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="请è¾å
¥è½¦é´åç§°"/> |
| | | <!-- æ --> |
| | | <a-col :md="10" :sm="24"> |
| | | <!--<template>--> |
| | | <!--<a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus">--> |
| | | <!--<span style="user-select: none">--> |
| | | <!--<a-tree--> |
| | | <!--checkable--> |
| | | <!--multiple--> |
| | | <!--@select="onSelect"--> |
| | | <!--@check="onCheck"--> |
| | | <!--@rightClick="rightHandle"--> |
| | | <!--:selectedKeys="selectedKeys"--> |
| | | <!--:checkedKeys="checkedKeys"--> |
| | | <!--:treeData="factoryTree"--> |
| | | <!--:checkStrictly="checkStrictly"--> |
| | | <!--:expandedKeys="iExpandedKeys"--> |
| | | <!--:autoExpandParent="autoExpandParent"--> |
| | | <!--@expand="onExpand"/>--> |
| | | <!--</span>--> |
| | | <!--<!–æ°å¢å³é®ç¹å»äºä»¶,åå¢å æ·»å åå é¤åè½–>--> |
| | | |
| | | <!--<a-menu slot="overlay">--> |
| | | <!--<a-menu-item @click="handleAdd(3)" key="1">æ·»å </a-menu-item>--> |
| | | <!--<a-menu-item @click="handleDelete" key="2">å é¤</a-menu-item>--> |
| | | <!--<a-menu-item @click="closeDrop" key="3">åæ¶</a-menu-item>--> |
| | | <!--</a-menu>--> |
| | | <!--</a-dropdown>--> |
| | | <!--</template>--> |
| | | <a-tree |
| | | checkable |
| | | multiple |
| | | @select="onSelect" |
| | | @check="onCheck" |
| | | @rightClick="rightHandle" |
| | | :selectedKeys="selectedKeys" |
| | | :checkedKeys="checkedKeys" |
| | | :treeData="factoryTree" |
| | |
| | | </a-card> |
| | | </a-tab-pane> |
| | | |
| | | <!-- <a-tab-pane tab="设å¤å表" key="2" forceRender> |
| | | <factory-equipment ref="departAuth"></factory-equipment> |
| | | </a-tab-pane> --> |
| | | <a-tab-pane tab="人åå表" key="2" forceRender> |
| | | <user-factory ref="userFactory"></user-factory> |
| | | <!-- <a-card v-if="factoryCategory == '3'"> |
| | | <user-factory ref="userFactory"></user-factory> |
| | | </a-card> |
| | | <a-card v-else> |
| | | <a-empty> |
| | | <span slot="description"> 请å
éæ©ä¸ä¸ªäº§çº¿! </span> |
| | | </a-empty> |
| | | </a-card> --> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | |
| | | </a-col> |
| | |
| | | </a-row> |
| | | </template> |
| | | <script> |
| | | import FactoryEquipment from './modules/FactoryManager/FactoryEquipment' |
| | | import UserFactory from './modules/FactoryManager/UserFactory' |
| | | import { queryFactoryTreeList, searchByKeywords, deleteByFactory } from '@/api/api' |
| | | import { httpAction, deleteAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | |
| | | name: 'FactoryManager', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | FactoryEquipment, |
| | | UserFactory, |
| | | FactoryModal |
| | | }, |
| | | data() { |
| | |
| | | treeData: [], |
| | | visible: false, |
| | | factoryTree: [], |
| | | rightClickSelectedKey: '', |
| | | rightClickSelectedOrgCode: '', |
| | | hiding: true, |
| | | model: {}, |
| | | dropTrigger: '', |
| | | depart: {}, |
| | | disableSubmit: false, |
| | | checkedKeys: [], |
| | | selectedKeys: [], |
| | | autoIncr: 1, |
| | | currSelected: {}, |
| | | allTreeKeys: [], |
| | | checkStrictly: true, |
| | |
| | | importExcelUrl: '/base/factory/importExcel' |
| | | }, |
| | | orgCategoryDisabled: false, |
| | | isIncludesNotLeaf: false |
| | | isIncludesNotLeaf: false, |
| | | factoryCategory:'' |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | 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.factoryTree.push(temp) |
| | | that.setThisExpandedKeys(temp) |
| | | that.getAllKeys(temp) |
| | | // console.log(temp.id) |
| | | } |
| | | this.loading = false |
| | | } |
| | |
| | | this.loading = true |
| | | this.loadTree() |
| | | }, |
| | | // å³é®æä½æ¹æ³ |
| | | rightHandle({ event, node }) { |
| | | this.dropTrigger = 'contextmenu' |
| | | const record = node.dataRef |
| | | this.rightClickSelectedKey = record.id |
| | | this.rightClickSelected = record |
| | | this.rightClickSelectedOrgCode = record.orgCode |
| | | }, |
| | | onExpand(expandedKeys) { |
| | | console.log('onExpand', expandedKeys) |
| | | this.iExpandedKeys = expandedKeys |
| | | this.autoExpandParent = false |
| | | }, |
| | | backFlowList() { |
| | | this.$router.back(-1) |
| | | }, |
| | | // å³é®ç¹å»ä¸ææ¡æ¹åäºä»¶ |
| | | dropStatus(visible) { |
| | | if (visible == false) { |
| | | this.dropTrigger = '' |
| | | } |
| | | }, |
| | | // å³é®ä¸æå
³éä¸ææ¡ |
| | | closeDrop() { |
| | | this.dropTrigger = '' |
| | | }, |
| | | addRootNode() { |
| | | this.$refs.nodeModal.add(this.currFlowId, '') |
| | | }, |
| | | |
| | | batchDel: function() { |
| | | console.log(this.checkedKeys) |
| | | this.isIncludesNotLeaf = false |
| | | this.includesNotLeaf(this.factoryTree) |
| | | console.log('isIncludesNotLeaf', this.isIncludesNotLeaf) |
| | | |
| | | // 为trueå表示éä¸é¡¹å
å«éå¶åç»ç¹ falseå表示éä¸é¡¹å为å¶åç»ç¹ |
| | | if (!this.isIncludesNotLeaf) { |
| | |
| | | } |
| | | |
| | | }, |
| | | nodeModalOk() { |
| | | this.loadTree() |
| | | }, |
| | | nodeModalClose() { |
| | | }, |
| | | hide() { |
| | | console.log(111) |
| | | this.visible = false |
| | | }, |
| | | onCheck(checkedKeys, info) { |
| | | console.log('onCheck', checkedKeys, info) |
| | | this.hiding = false |
| | | //---- author:os_chengtgen -- date:20190827 -- for:忢ç¶åå¾éæ¨¡å¼ =======------ |
| | | if (this.checkStrictly) { |
| | |
| | | //---- author:os_chengtgen -- date:20190827 -- for:忢ç¶åå¾éæ¨¡å¼ =======------ |
| | | }, |
| | | onSelect(selectedKeys, e) { |
| | | console.log('selected', selectedKeys, e) |
| | | this.hiding = false |
| | | this.deleteTrigger = 'leftClick' |
| | | let record = e.node.dataRef |
| | | console.log('onSelect-record', record) |
| | | this.factoryCategory = record.factoryCategory |
| | | this.currSelected = Object.assign({}, record) |
| | | this.model = this.currSelected |
| | | this.selectedKeys = [record.key] |
| | | this.model.parentId = record.parentId |
| | | this.setValuesToForm(record) |
| | | this.$refs.departAuth.show(record.id) |
| | | if(record.factoryCategory == '3'){ |
| | | this.$refs.userFactory.show(record.id) |
| | | }else{ |
| | | this.$refs.userFactory.factoryId = '' |
| | | } |
| | | }, |
| | | // 触åonSelectäºä»¶æ¶,为é¨é¨æ å³ä¾§çform表åèµå¼ |
| | | setValuesToForm(record) { |
| | |
| | | this.checkedKeys = [] |
| | | this.currSelected = {} |
| | | this.selectedKeys = [] |
| | | this.$refs.departAuth.departId = '' |
| | | }, |
| | | handleNodeTypeChange(val) { |
| | | this.currSelected.nodeType = val |
| | | }, |
| | | notifyTriggerTypeChange(value) { |
| | | this.currSelected.notifyTriggerType = value |
| | | }, |
| | | receiptTriggerTypeChange(value) { |
| | | this.currSelected.receiptTriggerType = value |
| | | this.$refs.userFactory.departId = '' |
| | | }, |
| | | submitCurrForm() { |
| | | this.$refs.form.validate(valid => { |
| | |
| | | this.$refs.form.resetFields() |
| | | this.model = {} |
| | | }, |
| | | nodeSettingFormSubmit() { |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | console.log('Received values of form: ', this.model) |
| | | } |
| | | }) |
| | | }, |
| | | openSelect() { |
| | | this.$refs.sysDirectiveModal.show() |
| | | }, |
| | | handleAdd(num) { |
| | | if (num == 1) { |
| | | this.$refs.departModal.add() |
| | | this.$refs.departModal.title = 'æ°å¢' |
| | | } else if (num == 2) { |
| | | console.log(this.currSelected) |
| | | let key = this.currSelected.key |
| | | if (!key) { |
| | | // this.$message.warning('请å
ç¹å»éä¸ä¸çº§è½¦é´ï¼') |
| | |
| | | if (this.currSelected.leaf) { |
| | | this.$confirm({ |
| | | title: '确认å é¤', |
| | | content: `ç¡®å®è¦å é¤ ${that.currSelected.productionName} å?`, |
| | | content: `ç¡®å®è¦å é¤ ${that.currSelected.factoryName} å?`, |
| | | onOk: function() { |
| | | deleteByFactory({ id: that.currSelected.id }).then((resp) => { |
| | | if (resp.success) { |
| | |
| | | description: 'å 餿å' |
| | | }) |
| | | that.loadTree() |
| | | //å é¤å忥æ¸
空å³ä¾§åºæ¬ä¿¡æ¯å
容 |
| | | // let orgCode=that.model.orgCode; |
| | | // if(orgCode && orgCode === that.rightClickSelectedOrgCode){ |
| | | that.onClearSelected() |
| | | // } |
| | | } else { |
| | | // that.$message.warning('å é¤å¤±è´¥!') |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'å é¤å¤±è´¥' |
| | |
| | | message: 'æ¶æ¯', |
| | | description: 'æ¤è½¦é´å·²æè½½åèç¹' |
| | | }) |
| | | } |
| | | console.log('deletedRecord', deletedRecord) |
| | | }, |
| | | selectDirectiveOk(record) { |
| | | console.log('éä¸æä»¤æ°æ®', record) |
| | | this.nodeSettingForm.setFieldsValue({ directiveCode: record.directiveCode }) |
| | | this.currSelected.sysCode = record.sysCode |
| | | }, |
| | | getFlowGraphData(node) { |
| | | this.graphDatasource.nodes.push({ |
| | | id: node.id, |
| | | text: node.flowNodeName |
| | | }) |
| | | if (node.children.length > 0) { |
| | | for (let a = 0; a < node.children.length; a++) { |
| | | let temp = node.children[a] |
| | | this.graphDatasource.edges.push({ |
| | | source: node.id, |
| | | target: temp.id |
| | | }) |
| | | this.getFlowGraphData(temp) |
| | | } |
| | | } |
| | | }, |
| | | //---- author:os_chengtgen -- date:20190827 -- for:忢ç¶åå¾éæ¨¡å¼ =======------ |
| | |
| | | } |
| | | }, |
| | | getAllKeys(node) { |
| | | // console.log('node',node); |
| | | this.allTreeKeys.push(node.key) |
| | | if (node.children && node.children.length > 0) { |
| | | for (let a = 0; a < node.children.length; a++) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | :bordered="false" |
| | | title="ä¾åºå" |
| | | > |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="30"> |
| | | |
| | | <a-col |
| | | :md="6" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="ä¾åºåç¼å·"> |
| | | <j-input |
| | | placeholder="请è¾å
¥ä¾åºåç¼å·æ£ç´¢" |
| | | v-model="queryParam.supplierCode" |
| | | ></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col |
| | | :md="6" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="ä¾åºååç§°"> |
| | | <j-input |
| | | placeholder="请è¾å
¥ä¾åºååç§°æ£ç´¢" |
| | | v-model="queryParam.supplierName" |
| | | ></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button |
| | | type="primary" |
| | | @click="searchQuery" |
| | | icon="search" |
| | | >æ¥è¯¢</a-button> |
| | | <a-button |
| | | type="primary" |
| | | @click="searchReset" |
| | | icon="reload" |
| | | >éç½®</a-button> |
| | | <a-button |
| | | @click="handleAdd" |
| | | type="primary" |
| | | icon="plus" |
| | | >æ°å¢</a-button> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | filterMultiple="filterMultiple" |
| | | :columns="columns" |
| | | :rowClassName="tableRowClass" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}" |
| | | @change="handleTableChange" |
| | | :customRow="clickThenCheck" |
| | | > |
| | | <span |
| | | slot="partCount" |
| | | slot-scope="text,record" |
| | | class="fontweight" |
| | | > |
| | | {{record.partCount}} |
| | | </span> |
| | | <!--ç¶ææ 个æ§å±ç¤º--> |
| | | <span |
| | | slot="status" |
| | | slot-scope="text,record" |
| | | > |
| | | <a-badge |
| | | v-if="record.supplierStatus==1" |
| | | status="success" |
| | | /> |
| | | <span |
| | | v-if="record.supplierStatus==1" |
| | | class="success" |
| | | >å¯ç¨</span> |
| | | <a-badge |
| | | v-if="record.supplierStatus==0" |
| | | status="error" |
| | | /> |
| | | <span |
| | | v-if="record.supplierStatus==0" |
| | | class="error" |
| | | >ç¦ç¨</span> |
| | | </span> |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a |
| | | href="javascript:;" |
| | | @click="handleDetail(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="() => handleDelete(record.id)" |
| | | > |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.supplierStatus == 0"> |
| | | <a-popconfirm |
| | | title="ç¡®å®å¯ç¨å?" |
| | | @confirm="() => handleActive(record.id)" |
| | | > |
| | | <a>å¯ç¨</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.supplierStatus == 1"> |
| | | <a-popconfirm |
| | | title="ç¡®å®ç¦ç¨å?" |
| | | @confirm="() => handleActive(record.id)" |
| | | > |
| | | <a>ç¦ç¨</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | |
| | | <!-- 表ååºå --> |
| | | <supplier-model |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></supplier-model> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | //æéå¼å
¥ ç»ä»¶ |
| | | import SupplierModel from './modules/supplier/SupplierModel' |
| | | |
| | | import { deleteAction, requestPut, getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import JEllipsis from '@/components/jeecg/JEllipsis' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | |
| | | export default { |
| | | name: 'SupplierList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | SupplierModel, |
| | | JEllipsis, |
| | | JInput, |
| | | }, |
| | | data() { |
| | | return { |
| | | selectedRowRecord: {}, |
| | | dataSource: [], |
| | | partCount: "", |
| | | /* å页忰 */ |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '20'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " å
±" + total + "æ¡" |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: "center", |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | { |
| | | title: 'ä¾åºåç¼å·', |
| | | align: "center", |
| | | dataIndex: 'supplierCode' |
| | | }, |
| | | { |
| | | title: 'ä¾åºååç§°', |
| | | align: "center", |
| | | dataIndex: 'supplierName' |
| | | }, |
| | | { |
| | | title: 'å½å®¶', |
| | | align: 'center', |
| | | dataIndex: 'country' |
| | | }, |
| | | { |
| | | title: 'ç份', |
| | | align: 'center', |
| | | dataIndex: 'province' |
| | | }, |
| | | { |
| | | title: 'åå¸', |
| | | align: 'center', |
| | | dataIndex: 'city' |
| | | }, |
| | | { |
| | | title: '详ç»å°å', |
| | | align: 'center', |
| | | dataIndex: 'address' |
| | | }, |
| | | { |
| | | title: 'è系人', |
| | | align: 'center', |
| | | dataIndex: 'contact' |
| | | }, |
| | | { |
| | | title: 'çµè¯', |
| | | align: 'center', |
| | | dataIndex: 'phone' |
| | | }, |
| | | { |
| | | width: 100, |
| | | title: 'ç¶æ', |
| | | align: 'center', |
| | | scopedSlots: { |
| | | customRender: 'status', |
| | | }, |
| | | dataIndex: 'supplierStatus' |
| | | }, |
| | | { |
| | | width: 150, |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | ], |
| | | type: "radio", |
| | | url: { |
| | | list: '/base/supplier/list', |
| | | delete: '/base/supplier/delete', |
| | | active: '/base/supplier/active', |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('refreshParentPage', (data) => { |
| | | this.loadData(); |
| | | }) |
| | | }, |
| | | methods: { |
| | | loadData(arg) { |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records; |
| | | this.ipagination.total = res.result.total; |
| | | } |
| | | if (res.code === 510) { |
| | | this.$message.warning(res.message) |
| | | } |
| | | this.loading = false; |
| | | }) |
| | | }, |
| | | //ç¦ç¨ç¶ææ ·å¼ |
| | | tableRowClass(record, index) { |
| | | if (record.supplierStatus != "1") { |
| | | return "frozenRowClass"; |
| | | } |
| | | return ""; |
| | | }, |
| | | //å¯ç¨ç¦ç¨ |
| | | handleActive(id) { |
| | | if (!this.url.active) { |
| | | this.$message.error("请设置url.active!") |
| | | return |
| | | } |
| | | let that = this; |
| | | requestPut(that.url.active, {}, { id: id }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }); |
| | | }, |
| | | clickThenCheck(record) { |
| | | return { |
| | | on: { |
| | | click: (e) => { |
| | | this.selectedRowRecord = record; |
| | | this.onSelectChange(record.id.split(","), [record]); |
| | | } |
| | | } |
| | | }; |
| | | }, |
| | | onSelectChange(selectedRowKeys) { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | }, |
| | | }, |
| | | |
| | | } |
| | | </script> |
| | | <style lang="less" scoped> |
| | | @import '~@assets/less/common.less'; |
| | | .frozenRowClass { |
| | | color: #c9c9c9; |
| | | } |
| | | .success { |
| | | color: green; |
| | | } |
| | | .error { |
| | | color: red; |
| | | } |
| | | .fontweight { |
| | | font-weight: bold; |
| | | } |
| | | .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; |
| | | } |
| | | |
| | | /deep/.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-card |
| | | :bordered="false" |
| | | title="ä¾åºå" |
| | | > |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="30"> |
| | | |
| | | <a-col |
| | | :md="6" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="ä»åºç¼å·"> |
| | | <j-input |
| | | placeholder="请è¾å
¥ä»åºç¼å·æ£ç´¢" |
| | | v-model="queryParam.warehouseCode" |
| | | ></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col |
| | | :md="6" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="ä»åºåç§°"> |
| | | <j-input |
| | | placeholder="请è¾å
¥ä»åºåç§°æ£ç´¢" |
| | | v-model="queryParam.warehouseName" |
| | | ></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button |
| | | type="primary" |
| | | @click="searchQuery" |
| | | icon="search" |
| | | >æ¥è¯¢</a-button> |
| | | <a-button |
| | | type="primary" |
| | | @click="searchReset" |
| | | icon="reload" |
| | | >éç½®</a-button> |
| | | <a-button |
| | | @click="handleAdd" |
| | | type="primary" |
| | | icon="plus" |
| | | >æ°å¢</a-button> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | filterMultiple="filterMultiple" |
| | | :columns="columns" |
| | | :rowClassName="tableRowClass" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}" |
| | | @change="handleTableChange" |
| | | :customRow="clickThenCheck" |
| | | > |
| | | <span |
| | | slot="partCount" |
| | | slot-scope="text,record" |
| | | class="fontweight" |
| | | > |
| | | {{record.partCount}} |
| | | </span> |
| | | <!--ç¶ææ 个æ§å±ç¤º--> |
| | | <span |
| | | slot="status" |
| | | slot-scope="text,record" |
| | | > |
| | | <a-badge |
| | | v-if="record.warehouseStatus==1" |
| | | status="success" |
| | | /> |
| | | <span |
| | | v-if="record.warehouseStatus==1" |
| | | class="success" |
| | | >å¯ç¨</span> |
| | | <a-badge |
| | | v-if="record.warehouseStatus==0" |
| | | status="error" |
| | | /> |
| | | <span |
| | | v-if="record.warehouseStatus==0" |
| | | class="error" |
| | | >ç¦ç¨</span> |
| | | </span> |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a |
| | | href="javascript:;" |
| | | @click="handleDetail(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="() => handleDelete(record.id)" |
| | | > |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.warehouseStatus == 0"> |
| | | <a-popconfirm |
| | | title="ç¡®å®å¯ç¨å?" |
| | | @confirm="() => handleActive(record.id)" |
| | | > |
| | | <a>å¯ç¨</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.warehouseStatus == 1"> |
| | | <a-popconfirm |
| | | title="ç¡®å®ç¦ç¨å?" |
| | | @confirm="() => handleActive(record.id)" |
| | | > |
| | | <a>ç¦ç¨</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | |
| | | <!-- 表ååºå --> |
| | | <warehouse-model |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></warehouse-model> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | //æéå¼å
¥ ç»ä»¶ |
| | | import WarehouseModel from './modules/warehouse/WarehouseModel' |
| | | |
| | | import { deleteAction, requestPut, getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import JEllipsis from '@/components/jeecg/JEllipsis' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | |
| | | export default { |
| | | name: 'WarehouseList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | WarehouseModel, |
| | | JEllipsis, |
| | | JInput, |
| | | }, |
| | | data() { |
| | | return { |
| | | selectedRowRecord: {}, |
| | | dataSource: [], |
| | | partCount: "", |
| | | /* å页忰 */ |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '20'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " å
±" + total + "æ¡" |
| | | }, |
| | | total: 0 |
| | | }, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: "center", |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | { |
| | | title: '线边åºç¼å·', |
| | | align: "center", |
| | | dataIndex: 'warehouseCode' |
| | | }, |
| | | { |
| | | title: '线边åºåç§°', |
| | | align: "center", |
| | | dataIndex: 'warehouseName' |
| | | }, |
| | | { |
| | | title: '产线', |
| | | align: 'center', |
| | | dataIndex: 'factoryId_dictText' |
| | | }, |
| | | { |
| | | width: 100, |
| | | title: 'ç¶æ', |
| | | align: 'center', |
| | | scopedSlots: { |
| | | customRender: 'status', |
| | | }, |
| | | dataIndex: 'warehouseStatus' |
| | | }, |
| | | { |
| | | width: 150, |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | ], |
| | | type: "radio", |
| | | url: { |
| | | list: '/base/lineSideWarehouse/list', |
| | | delete: '/base/lineSideWarehouse/delete', |
| | | active: '/base/lineSideWarehouse/active', |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('refreshParentPage', (data) => { |
| | | this.loadData(); |
| | | }) |
| | | }, |
| | | methods: { |
| | | loadData(arg) { |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records; |
| | | this.ipagination.total = res.result.total; |
| | | } |
| | | if (res.code === 510) { |
| | | this.$message.warning(res.message) |
| | | } |
| | | this.loading = false; |
| | | }) |
| | | }, |
| | | //ç¦ç¨ç¶ææ ·å¼ |
| | | tableRowClass(record, index) { |
| | | if (record.warehouseStatus != "1") { |
| | | return "frozenRowClass"; |
| | | } |
| | | return ""; |
| | | }, |
| | | //å¯ç¨ç¦ç¨ |
| | | handleActive(id) { |
| | | if (!this.url.active) { |
| | | this.$message.error("请设置url.active!") |
| | | return |
| | | } |
| | | let that = this; |
| | | requestPut(that.url.active, {}, { id: id }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }); |
| | | }, |
| | | clickThenCheck(record) { |
| | | return { |
| | | on: { |
| | | click: (e) => { |
| | | this.selectedRowRecord = record; |
| | | this.onSelectChange(record.id.split(","), [record]); |
| | | } |
| | | } |
| | | }; |
| | | }, |
| | | onSelectChange(selectedRowKeys) { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | }, |
| | | }, |
| | | |
| | | } |
| | | </script> |
| | | <style lang="less" scoped> |
| | | @import '~@assets/less/common.less'; |
| | | .frozenRowClass { |
| | | color: #c9c9c9; |
| | | } |
| | | .success { |
| | | color: green; |
| | | } |
| | | .error { |
| | | color: red; |
| | | } |
| | | .fontweight { |
| | | font-weight: bold; |
| | | } |
| | | .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; |
| | | } |
| | | |
| | | /deep/.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> |
| | | <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> |
ÎļþÃû´Ó src/views/base/modules/FactoryManager/FactoryEquipment.vue ÐÞ¸Ä |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <template v-if="this.productionId"> |
| | | <template v-if="this.factoryId"> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | |
| | | <a-col :md="6" :sm="12"> |
| | | <a-form-item label="设å¤ç¼å·"> |
| | | <a-input placeholder="请è¾å
¥è®¾å¤ç¼å·" v-model="queryParam.equipmentId"></a-input> |
| | | <a-col :md="12" :sm="12"> |
| | | <a-form-item label="人åç¼å·"> |
| | | <a-input placeholder="请è¾å
¥äººåç¼å·" v-model="queryParam.username"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="6" :sm="8"> |
| | | <a-col :md="12" :sm="12"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | </a-col> |
| | |
| | | </a-form> |
| | | </div> |
| | | <div class="table-operator" style="border-top: 5px"> |
| | | <a-button @click="handleAddUserFactory" type="primary" icon="plus" style="margin-top: 16px">æ·»å 产线人å</a-button> |
| | | |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay" @click="handleMenuClick"> |
| | | <a-menu-item key="1"> |
| | |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | |
| | | <!--<template slot="avatarslot" slot-scope="text, record, index">--> |
| | | <!--<div class="anty-img-wrap">--> |
| | | <!--<a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/>--> |
| | | <!--</div>--> |
| | | <!--</template>--> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a-popconfirm title="ç¡®å®ç§»é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>ç§»é¤</a> |
| | |
| | | </template> |
| | | <a-card v-else :bordered="false" style="height:200px"> |
| | | <a-empty> |
| | | <span slot="description"> 请å
éæ©ä¸ä¸ªé¨é¨! </span> |
| | | <span slot="description"> 请å
éæ©ä¸ä¸ªäº§çº¿! </span> |
| | | </a-empty> |
| | | </a-card> |
| | | <Select-User-Modal ref="selectUserModal" @selectFinished="selectOK"></Select-User-Modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { filterObj } from '@/utils/util'; |
| | | import {queryTreeListForRole,queryDepartPermission,saveDepartPermission} from '@/api/api' |
| | | import {JeecgListMixin} from '@/mixins/JeecgListMixin' |
| | | import { getAction,postAction } from '@/api/manage' |
| | | import qs from 'qs' |
| | | import { getAction,postAction,deleteAction } from '@/api/manage' |
| | | import SelectUserModal from './SelectUserModal' |
| | | export default { |
| | | name: 'FactoryEquipment', |
| | | name: 'UserFactory', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | SelectUserModal |
| | | }, |
| | | data(){ |
| | | return { |
| | | queryParam:{}, |
| | |
| | | } |
| | | }, |
| | | { |
| | | title: '设å¤ç¼å·', |
| | | title: '人åç¼å·', |
| | | align: "center", |
| | | dataIndex: 'equipmentId', |
| | | dataIndex: 'username', |
| | | width: 120, |
| | | // sorter: true |
| | | }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | title: '人ååç§°', |
| | | align: "center", |
| | | width: 150, |
| | | dataIndex: 'equipmentName', |
| | | dataIndex: 'realname', |
| | | }, |
| | | { |
| | | title: '设å¤ç±»å', |
| | | align: "center", |
| | | width: 120, |
| | | dataIndex: 'equipmentType', |
| | | // scopedSlots: {customRender: "avatarslot"} |
| | | }, |
| | | |
| | | { |
| | | title: '驱å¨ç±»å', |
| | | align: "center", |
| | | width: 80, |
| | | dataIndex: 'driveType', |
| | | // sorter: true |
| | | }, |
| | | |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | |
| | | |
| | | ], |
| | | disableMixinCreated:true, |
| | | productionId:"", |
| | | title:"é¨é¨æéé
ç½®", |
| | | factoryId:"", |
| | | title:"产线人åé
ç½®", |
| | | visible: false, |
| | | loading: false, |
| | | url:{ |
| | | list:'/mdc/mdcEquipment/equipmentListByProduction', |
| | | removeEquipmentForDepart:'/mdc/mdcEquipment/removeEquipmentForProduction', |
| | | list:'/sys/user/userFactoryList', |
| | | deleteUserFactory:'/sys/user/deleteUserFactory', |
| | | serachEquipment:'/mdc/mdcEquipment/equipmentListByProduction', |
| | | removeEquipmentsForProduction:"/mdc/mdcEquipment/removeEquipmentsForProduction" |
| | | deleteBatch:"/sys/user/deleteUserFactoryBatch", |
| | | addUserFactory:'/sys/user/addBaseUserFactory' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | show(productionId){ |
| | | this.productionId=productionId |
| | | show(factoryId){ |
| | | this.factoryId=factoryId |
| | | this.loadData(); |
| | | }, |
| | | close () { |
| | |
| | | this.loadData(); |
| | | }, |
| | | searchQuery() { |
| | | var id = this.queryParam.equipmentId |
| | | this.loading = true; |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | |
| | | params.pageNo = this.ipagination.current; |
| | | params.pageSize = this.ipagination.pageSize; |
| | | getAction(this.url.serachEquipment,{equipmentId:this.queryParam.equipmentId,productionId:this.productionId,pageNo:params.pageNo,pageSize:params.pageSize}).then((res)=>{ |
| | | if (res.success) { |
| | | // console.log(res) |
| | | //update-begin---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | this.dataSource = res.result.records||res.result; |
| | | if(res.result.total) |
| | | { |
| | | this.ipagination.total = res.result.total; |
| | | }else{ |
| | | this.ipagination.total = 0; |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | }else{ |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | this.loadData(); |
| | | }, |
| | | handleTableChange(pagination, filters, sorter) { |
| | | //å页ãæåºãçéååæ¶è§¦å |
| | | //TODO çé |
| | | // console.log(pagination) |
| | | if (Object.keys(sorter).length > 0) { |
| | | this.isorter.column = sorter.field; |
| | | this.isorter.order = "ascend" == sorter.order ? "asc" : "desc" |
| | |
| | | this.loadData(); |
| | | }, |
| | | loadData(){ |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | // if (arg === 1) { |
| | | // this.ipagination.current = 1; |
| | | // } |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | |
| | | params.pageNo = this.ipagination.current; |
| | | params.pageSize = this.ipagination.pageSize; |
| | | this.loading = true; |
| | | getAction(this.url.list,params).then((res)=>{ |
| | | if (res.success) { |
| | | // console.log(res) |
| | | //update-begin---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | this.dataSource = res.result.records||res.result; |
| | | if(res.result.total) |
| | | { |
| | |
| | | }else{ |
| | | this.ipagination.total = 0; |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | }else{ |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | |
| | | param.field = this.getQueryField(); |
| | | param.pageNo = this.ipagination.current; |
| | | param.pageSize = this.ipagination.pageSize; |
| | | param.productionId = this.productionId; |
| | | param.factoryId = this.factoryId; |
| | | //è·åç¨æ·å®å¶ç忰屿§ |
| | | if (this.getCustomQueryParams) { |
| | | param = this.getCustomQueryParams(param); |
| | |
| | | |
| | | return filterObj(param); |
| | | }, |
| | | handleDelete(equipmentId){ |
| | | handleDelete(id){ |
| | | |
| | | postAction(this.url.removeEquipmentForDepart,qs.stringify({productionId:this.productionId,equipmentId:equipmentId})).then((res)=>{ |
| | | deleteAction(this.url.deleteUserFactory,{factoryId:this.factoryId,userId:id}).then((res)=>{ |
| | | if (res.success) { |
| | | this.$notification.success({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | this.loadData(this.productionId); |
| | | this.loadData(this.factoryId); |
| | | }else{ |
| | | this.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | |
| | | } |
| | | }, |
| | | batchDel: function () { |
| | | if(!this.url.removeEquipmentsForProduction){ |
| | | this.$message.error("请设置url.removeEquipmentsForProduction屿§!") |
| | | if(!this.url.deleteBatch){ |
| | | this.$message.error("请设置url.deleteBatch屿§!") |
| | | return |
| | | } |
| | | if (this.selectedRowKeys.length <= 0) { |
| | |
| | | content: "æ¯å¦å é¤é䏿°æ®?", |
| | | onOk: function () { |
| | | that.loading = true; |
| | | postAction(that.url.removeEquipmentsForProduction,qs.stringify({productionId:that.productionId,equipmentIds:ids})).then((res) => { |
| | | deleteAction(that.url.deleteBatch,{factoryId:that.factoryId,userIds:ids}).then((res) => { |
| | | if (res.success) { |
| | | //éæ°è®¡ç®å页é®é¢ |
| | | that.reCalculatePage(that.selectedRowKeys.length) |
| | | // that.$message.success(res.message); |
| | | this.$notification.success({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | that.loadData(that.productionId); |
| | | that.loadData(that.factoryId); |
| | | that.onClearSelected(); |
| | | } else { |
| | | // that.$message.warning(res.message); |
| | | this.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | |
| | | }); |
| | | } |
| | | }, |
| | | handleAddUserFactory() { |
| | | if (this.factoryId == '') { |
| | | this.$message.error('è¯·éæ©ä¸ä¸ªäº§çº¿!') |
| | | } else { |
| | | this.$refs.selectUserModal.visible = true |
| | | } |
| | | }, |
| | | selectOK(data) { |
| | | let params = {} |
| | | params.factoryId = this.factoryId |
| | | params.userIdList = [] |
| | | for (var a = 0; a < data.length; a++) { |
| | | params.userIdList.push(data[a]) |
| | | } |
| | | console.log(params) |
| | | postAction(this.url.addUserFactory, params).then((res) => { |
| | | if (res.success) { |
| | | this.loadData() |
| | | this.$message.success(res.message) |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:3}" |
| | | :wrapperCol="{span:21}" |
| | | label="ä¾åºåç¼å·" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥ä¾åºåç¼å·" |
| | | v-decorator="['supplierCode', validatorRules.supplierCode ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:3}" |
| | | :wrapperCol="{span:21}" |
| | | label="ä¾åºååç§°" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥ä¾åºååç§°" |
| | | v-decorator="['supplierName', validatorRules.supplierName ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="å½å®¶" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥å½å®¶" |
| | | v-decorator="['country', validatorRules.country ]" |
| | | /> |
| | | <!-- <j-dict-select-tag |
| | | :disabled="disableSubmit" |
| | | placeholder="è¯·éæ©å½å®¶" |
| | | :triggerChange="true" |
| | | dictCode="country_list" |
| | | v-decorator="['country', validatorRules.country]" |
| | | /> --> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="ç份" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥ç份" |
| | | v-decorator="['province', validatorRules.province ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="åå¸" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥åå¸" |
| | | v-decorator="['city', validatorRules.city ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="è系人" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥è系人" |
| | | v-decorator="['contact', validatorRules.contact]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:3}" |
| | | :wrapperCol="{span:21}" |
| | | label="详ç»å°å" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥è¯¦ç»å°å" |
| | | v-decorator="['address', validatorRules.address]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="é®ç®±" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥é®ç®±" |
| | | v-decorator="['email', validatorRules.email]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="é®ç¼" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥é®ç¼" |
| | | v-decorator="['postcode', validatorRules.postcode]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="ä¼ ç" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥ä¼ ç" |
| | | v-decorator="['fax', validatorRules.fax]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="ææºå·ç " |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥ææºå·ç " |
| | | v-decorator="['phone', validatorRules.phone]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="å
¬å¸çµè¯" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥å
¬å¸çµè¯" |
| | | v-decorator="['companyTelephone', validatorRules.companyTelephone]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="宿¹ç½ç«" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥å®æ¹ç½ç«" |
| | | v-decorator="['officialWebsite', validatorRules.officialWebsite]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:3}" |
| | | :wrapperCol="{span:21}" |
| | | label="夿³¨" |
| | | > |
| | | <a-textarea |
| | | :readOnly="disableSubmit" |
| | | placeholder="请è¾å
¥å¤æ³¨" |
| | | allow-clear |
| | | v-decorator="['remark', validatorRules.remark]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import JDate from '@/components/jeecg/JDate' |
| | | import pick from 'lodash.pick' |
| | | import moment from 'moment' |
| | | import { duplicateCheck } from '@/api/api'//é夿 ¡éª |
| | | import JTreeDict from '@/components/jeecg/JTreeDict'//åç±»åå
¸æ 形䏿ç»ä»¶ |
| | | |
| | | export default { |
| | | name: "SpplierModal", |
| | | components: { |
| | | JDate, |
| | | JTreeDict, |
| | | }, |
| | | data() { |
| | | return { |
| | | editorValue: '', |
| | | title: "æä½", |
| | | visible: false, |
| | | disableSubmit: false, |
| | | model: {}, |
| | | treeData: [], |
| | | supplierId: "", //ä¿åä¾åºåid |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | supplierCode: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥ç¼å·' }, |
| | | { min: 2, max: 30, message: 'é¿åº¦å¨ 2 å° 30 个å符', trigger: 'blur' }, |
| | | { validator: this.validateNum }, |
| | | ] |
| | | }, |
| | | supplierName: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥åç§°' }, |
| | | { min: 0, max: 64, message: 'é¿åº¦ä¸è¶
è¿ 64 个å符', trigger: 'blur' }, |
| | | { validator: this.validateName }, |
| | | ] |
| | | }, |
| | | country: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©å½å®¶' }, |
| | | ] |
| | | }, |
| | | address: { |
| | | rules: [ |
| | | { min: 0, max: 100, message: 'æé¿ 100 个å符', trigger: 'blur' }, |
| | | ] |
| | | }, |
| | | postcode: { |
| | | rules: [ |
| | | { pattern: /^[0-9]{6}$/, message: '请è¾å
¥æ£ç¡®é®ç¼' }, |
| | | ] |
| | | }, |
| | | email: { |
| | | rules: [ |
| | | { validator: this.validateEmail }, |
| | | ] |
| | | }, |
| | | contact: { |
| | | rules: [ |
| | | { min: 0, max: 30, message: 'æé¿ 30 个å符', trigger: 'blur' }, |
| | | ] |
| | | }, |
| | | fax: { |
| | | rules: [ |
| | | { min: 0, max: 30, message: 'æé¿ 30 个å符', trigger: 'blur' }, |
| | | // { pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请è¾å
¥æ£ç¡®ä¼ ç' }, |
| | | ] |
| | | }, |
| | | phone: { |
| | | rules: [ |
| | | { validator: this.validatePhone }, |
| | | ] |
| | | }, |
| | | companyTelephone: { |
| | | rules: [ |
| | | { min: 0, max: 30, message: 'æé¿ 30 个å符', trigger: 'blur' }, |
| | | // { pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请è¾å
¥æ£ç¡®åº§æºå·ç ' }, |
| | | ] |
| | | }, |
| | | officialWebsite: { |
| | | rules: [ |
| | | { pattern: /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/|www\.)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/, message: '请è¾å
¥æ£ç¡®ç½ç»å°å' }, |
| | | ] |
| | | }, |
| | | remark: { |
| | | rules: [ |
| | | { min: 0, max: 100, message: 'æé¿ 100 个å符', trigger: 'blur' }, |
| | | ] |
| | | }, |
| | | }, |
| | | url: { |
| | | add: "/base/supplier/add", |
| | | edit: "/base/supplier/edit", |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit({}); |
| | | }, |
| | | edit(record) { |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.supplierId = record.id; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue( |
| | | pick(this.model, 'supplierCode', 'supplierName', 'country','province','city', 'address', 'contact', 'postcode', 'fax', 'email', 'phone', 'companyTelephone', 'officialWebsite', 'remark') |
| | | ) |
| | | //æ¶é´æ ¼å¼å |
| | | }); |
| | | }, |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk() { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if (!this.model.id) { |
| | | httpurl += this.url.add; |
| | | method = 'post'; |
| | | } else { |
| | | httpurl += this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | let formData = Object.assign(this.model, values); |
| | | httpAction(httpurl, formData, method).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(); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | //éªè¯ ç¼å· |
| | | validateNum(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'base_supplier', |
| | | fieldName: 'supplier_code', |
| | | fieldVal: value, |
| | | dataId: this.supplierId, |
| | | //æ°æ®åºä¸åå¨å段del_flag并使ç¨è¯¥å段ä½ä¸ºæªå é¤çç¥ï¼çå é¤ï¼false åå é¤ï¼true |
| | | delFlag: 'true', |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback(); |
| | | } else { |
| | | callback("ä¾åºåç¼å·å·²åå¨!"); |
| | | } |
| | | }) |
| | | }, |
| | | //éªè¯ åç§° |
| | | validateName(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'base_supplier', |
| | | fieldName: 'supplier_name', |
| | | fieldVal: value, |
| | | dataId: this.supplierId, |
| | | //æ°æ®åºä¸åå¨å段del_flag并使ç¨è¯¥å段ä½ä¸ºæªå é¤çç¥ï¼çå é¤ï¼false åå é¤ï¼true |
| | | delFlag: 'true', |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback(); |
| | | } else { |
| | | callback("ä¾åºååç§°å·²åå¨!"); |
| | | } |
| | | }) |
| | | }, |
| | | //éªè¯ ææºå· |
| | | validatePhone(rule, value, callback) { |
| | | if (!value) { |
| | | callback() |
| | | } else { |
| | | //[05] ææºå·ä¸æ¯æ199å·ç 段-------------------- |
| | | if (new RegExp(/^1[3|4|5|7|8|9][0-9]\d{8}$/).test(value)) { |
| | | var params = { |
| | | tableName: 'base_supplier', |
| | | fieldName: 'phone', |
| | | fieldVal: value, |
| | | dataId: this.supplierId |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback() |
| | | } else { |
| | | callback("ææºå·å·²åå¨!") |
| | | } |
| | | }) |
| | | } else { |
| | | callback("请è¾å
¥æ£ç¡®æ ¼å¼çææºå·ç !"); |
| | | } |
| | | } |
| | | }, |
| | | //éªè¯ Email |
| | | validateEmail(rule, value, callback) { |
| | | if (!value) { |
| | | callback() |
| | | } else { |
| | | if (new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)) { |
| | | var params = { |
| | | tableName: 'base_supplier', |
| | | fieldName: 'email', |
| | | fieldVal: value, |
| | | dataId: this.supplierId |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | console.log(res) |
| | | if (res.success) { |
| | | callback() |
| | | } else { |
| | | 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:3}" |
| | | :wrapperCol="{span:21}" |
| | | label="线边åºç¼å·" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥çº¿è¾¹åºç¼å·" |
| | | v-decorator="['warehouseCode', validatorRules.warehouseCode ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{span:3}" |
| | | :wrapperCol="{span:21}" |
| | | label="线边åºåç§°" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥çº¿è¾¹åºåç§°" |
| | | v-decorator="['warehouseName', validatorRules.warehouseName ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="产线" |
| | | > |
| | | <j-dict-select-tag |
| | | type="list" |
| | | v-model="model.factoryId" |
| | | :trigger-change="true" |
| | | dictCode="base_factory,factory_name,id" |
| | | placeholder="è¯·éæ©äº§çº¿" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import JDate from '@/components/jeecg/JDate' |
| | | import pick from 'lodash.pick' |
| | | import moment from 'moment' |
| | | import { duplicateCheck } from '@/api/api'//é夿 ¡éª |
| | | import JTreeDict from '@/components/jeecg/JTreeDict'//åç±»åå
¸æ 形䏿ç»ä»¶ |
| | | |
| | | export default { |
| | | name: "WarehouseModal", |
| | | components: { |
| | | JDate, |
| | | JTreeDict, |
| | | }, |
| | | data() { |
| | | return { |
| | | title: "æä½", |
| | | visible: false, |
| | | disableSubmit: false, |
| | | model: {}, |
| | | treeData: [], |
| | | warehouseId: "", //ä¿å线边åºid |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | warehouseCode: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥çº¿è¾¹åºç¼å·' }, |
| | | { min: 2, max: 30, message: 'é¿åº¦å¨ 2 å° 30 个å符', trigger: 'blur' }, |
| | | { validator: this.validateNum }, |
| | | ] |
| | | }, |
| | | warehouseName: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥çº¿è¾¹åºåç§°' }, |
| | | { min: 0, max: 64, message: 'é¿åº¦ä¸è¶
è¿ 64 个å符', trigger: 'blur' }, |
| | | { validator: this.validateName }, |
| | | ] |
| | | }, |
| | | }, |
| | | url: { |
| | | add: "/base/lineSideWarehouse/add", |
| | | edit: "/base/lineSideWarehouse/edit", |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit({}); |
| | | }, |
| | | edit(record) { |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.warehouseId = record.id; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue( |
| | | pick(this.model, 'warehouseCode', 'warehouseName', 'factoryId') |
| | | ) |
| | | }); |
| | | }, |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk() { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if (!this.model.id) { |
| | | httpurl += this.url.add; |
| | | method = 'post'; |
| | | } else { |
| | | httpurl += this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | let formData = Object.assign(this.model, values); |
| | | httpAction(httpurl, formData, method).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(); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | //éªè¯ ç¼å· |
| | | validateNum(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'base_line_side_warehouse', |
| | | fieldName: 'warehouse_code', |
| | | fieldVal: value, |
| | | dataId: this.warehouseId, |
| | | //æ°æ®åºä¸åå¨å段del_flag并使ç¨è¯¥å段ä½ä¸ºæªå é¤çç¥ï¼çå é¤ï¼false åå é¤ï¼true |
| | | delFlag: 'true', |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback(); |
| | | } else { |
| | | callback("线边åºç¼å·å·²åå¨!"); |
| | | } |
| | | }) |
| | | }, |
| | | //éªè¯ åç§° |
| | | validateName(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'base_line_side_warehouse', |
| | | fieldName: 'warehouse_name', |
| | | fieldVal: value, |
| | | dataId: this.warehouseId, |
| | | //æ°æ®åºä¸åå¨å段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> |