From d3441881742c1397cd02f68c4b0de565456f97b1 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期三, 02 七月 2025 14:02:54 +0800 Subject: [PATCH] 1、删除冗余代码 2、设备台账新增弹窗开发完成 --- /dev/null | 492 --------------------- src/views/eam/equipment/modules/EamEquipmentModal.vue | 599 ++++++++++++++------------ src/utils/util.js | 26 + src/views/eam/equipment/EamEquipmentLedger.vue | 248 ++++------ 4 files changed, 459 insertions(+), 906 deletions(-) diff --git a/src/utils/util.js b/src/utils/util.js index fd76ae4..f295d4d 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -367,6 +367,32 @@ } /** + * 閲嶅鍊奸獙璇佸伐鍏锋柟娉� + * + * 浣跨敤绀轰緥锛� + * { validator: (rule, value, callback) => validateDuplicateValue('sys_fill_rule', 'rule_code', value, this.model.id, callback) } + * + * @param tableName 琚獙璇佺殑琛ㄥ悕 + * @param fieldName 琚獙璇佺殑瀛楁鍚� + * @param fieldVal 琚獙璇佺殑鍊� + * @param dataId 鏁版嵁ID锛屽彲绌� + * @param delFlag 鍒犻櫎鏍囪 + * @param callback + */ +export function validateDuplicateValueInDelFlag(tableName, fieldName, fieldVal, dataId, delFlag, callback) { + if (fieldVal) { + let params = { tableName, fieldName, fieldVal, dataId, delFlag } + api.duplicateCheck(params).then(res => { + res['success'] ? callback() : callback(res['message']) + }).catch(err => { + callback(err.message || err) + }) + } else { + callback() + } +} + +/** * 鏍规嵁缂栫爜鏍¢獙瑙勫垯code锛屾牎楠屼紶鍏ョ殑鍊兼槸鍚﹀悎娉� * * 浣跨敤绀轰緥锛� diff --git a/src/views/base/ConstructorList.vue b/src/views/base/ConstructorList.vue deleted file mode 100644 index 642aab5..0000000 --- a/src/views/base/ConstructorList.vue +++ /dev/null @@ -1,230 +0,0 @@ -<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="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="鍒堕�犲晢缂栫爜缂栫爜"> - <a-input placeholder="璇疯緭鍏ュ埗閫犲晢缂栫爜" v-model="queryParam.num"></a-input> - </a-form-item> - </a-col> - <template> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="鍒堕�犲晢鍚嶇О"> - <a-input placeholder="璇疯緭鍏ュ埗閫犲晢鍚嶇О" v-model="queryParam.name"></a-input> - </a-form-item> - </a-col> - </template> - <a-col :xl="6" :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="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> - <!-- <a @click="handleToggleSearch" style="margin-left: 8px">--> - <!-- {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}--> - <!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>--> - <!-- </a>--> - </span> - </a-col> - </a-row> - </a-form> - </div> - <!-- 鏌ヨ鍖哄煙-END --> - - <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <div class="table-operator"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</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-dropdown v-if="selectedRowKeys.length > 0"> - <a-menu slot="overlay"> - <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> - </a-menu> - <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> - </a-dropdown> - </div> - - <!-- table鍖哄煙-begin --> - <div> - <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> - <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� - <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> - </div> - - <a-table - ref="table" - size="middle" - :scroll="{x:true}" - bordered - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - class="j-table-force-nowrap" - @change="handleTableChange"> - - <template slot="htmlSlot" slot-scope="text"> - <div v-html="text"></div> - </template> - <template slot="imgSlot" slot-scope="text,record"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> - <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> - </template> - <template slot="fileSlot" slot-scope="text"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> - <a-button - v-else - :ghost="true" - type="primary" - icon="download" - size="small" - @click="downloadFile(text)"> - 涓嬭浇 - </a-button> - </template> - - <span slot="action" slot-scope="text, record"> - <a @click="handleEdit(record)">缂栬緫</a> - - <a-divider type="vertical" /> - <a-dropdown> - <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> - <a-menu slot="overlay"> - <a-menu-item> - <a @click="handleDetail(record)">璇︽儏</a> - </a-menu-item> - <a-menu-item> - <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> - <a>鍒犻櫎</a> - </a-popconfirm> - </a-menu-item> - </a-menu> - </a-dropdown> - </span> - - </a-table> - </div> - - <ConstructorModal ref="modalForm" @ok="modalFormOk"></ConstructorModal> - </a-card> -</template> - -<script> - -import '@assets/less/TableExpand.less' -import { mixinDevice } from '@/utils/mixin' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import ConstructorModal from '@/views/base/modules/Constructor/ConstructorModal' - -export default { - name: 'ConstructorList', - mixins:[JeecgListMixin, mixinDevice], - components: { - ConstructorModal - }, - data () { - return { - description: '璁惧閲嶈搴︾鐞嗛〉闈�', - // 琛ㄥご - columns: [ - { - title: '#', - dataIndex: '', - key:'rowIndex', - width:60, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; - } - }, - { - title:' 鍒堕�犲晢缂栫爜', - align:"center", - dataIndex: 'num' - }, - { - title:'鍒堕�犲晢鍚嶇О', - align:"center", - dataIndex: 'name' - }, - { - title:'鍒涘缓浜�', - align:"center", - dataIndex: 'createBy' - }, - { - title:'鍒涘缓鏃ユ湡', - align:"center", - dataIndex: 'createTime' - }, - { - title:'鏇存柊浜�', - align:"center", - dataIndex: 'updateBy' - }, - { - title:'鏇存柊鏃ユ湡', - align:"center", - dataIndex: 'updateTime' - }, - { - title:'澶囨敞', - align:"center", - dataIndex: 'remark' - }, - - { - title: '鎿嶄綔', - dataIndex: 'action', - align:"center", - fixed:"right", - width:147, - scopedSlots: { customRender: 'action' } - } - ], - url: { - list: "/base/constructor/list", - delete: "/base/constructor/delete", - deleteBatch: "/base/constructor/deleteBatch", - exportXlsUrl: "/base/constructor/exportXls", - importExcelUrl: "/base/constructor/importExcel", - - }, - dictOptions:{}, - superFieldList:[], - } - }, - created() { - this.getSuperFieldList(); - }, - computed: { - importExcelUrl: function(){ - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; - }, - }, - methods: { - initDictConfig(){ - }, - getSuperFieldList(){ - let fieldList=[]; - fieldList.push({type:'string',value:'num',text:'鍒堕�犲晢缂栫爜',dictCode:''}) - fieldList.push({type:'string',value:'name',text:'鍒堕�犲晢鍚嶇О',dictCode:''}) - fieldList.push({type:'string',value:'remark',text:'澶囨敞',dictCode:''}) - fieldList.push({type:'string',value:'createBy',text:'鍒涘缓浜�',dictCode:''}) - fieldList.push({type:'datetime',value:'createTime',text:'鍒涘缓鏃ユ湡'}) - fieldList.push({type:'string',value:'updateBy',text:'鏇存柊浜�',dictCode:''}) - fieldList.push({type:'datetime',value:'updateTime',text:'鏇存柊鏃ユ湡'}) - this.superFieldList = fieldList - } - } -} -</script> -<style scoped> -@import '~@assets/less/common.less'; -</style> \ No newline at end of file diff --git a/src/views/base/SuppliertList.vue b/src/views/base/SuppliertList.vue deleted file mode 100644 index 45ce96e..0000000 --- a/src/views/base/SuppliertList.vue +++ /dev/null @@ -1,46 +0,0 @@ -<template> - <a-row - type="flex" - :gutter="16" - > - <a-col - :md="4" - :sm="24" - > - <supplier-category-left @clickTreeNode="getSelectNode" /> - </a-col> - <a-col - :md="24-4" - :sm="24" - > - <supplier-model-right :recordSelect="currentNodeSelect" /> - </a-col> - </a-row> -</template> - -<script> -import SupplierCategoryLeft from './modules/supplier/SupplierCategoryLeft' -import SupplierModelRight from './modules/supplier/SupplierModelRight' -export default { - name: 'SuppliertList', - components: { - SupplierCategoryLeft, - SupplierModelRight, - }, - data() { - return { - description: '渚涘簲鍟嗛」鐩�', - currentNodeSelect: '', - } - }, - methods: { - getSelectNode(val) { - this.currentNodeSelect = val; - }, - } -} -</script> - -<style scoped> -@import '~@assets/less/common.less'; -</style> \ No newline at end of file diff --git a/src/views/base/WarehouseListNew.vue b/src/views/base/WarehouseListNew.vue deleted file mode 100644 index 3c2478b..0000000 --- a/src/views/base/WarehouseListNew.vue +++ /dev/null @@ -1,515 +0,0 @@ -<template> - <a-card - :bordered="false" - class="card-area" - > - <template slot="title"> - <i - class="action-jeecg actionsite2" - style="font-size: 18px;" - /> - 浠撳簱淇℃伅 - </template> - <!-- 鏌ヨ鍖哄煙 --> - <div class="table-page-search-wrapper"> - <!-- 鎼滅储鍖哄煙 --> - <a-form - layout="inline" - @keyup.enter.native="searchQuery" - > - <a-row :gutter="24"> - <a-col - :md="8" - :sm="8" - > - <a-form-item label="浠撳簱缂栧彿"> - <j-input - placeholder="璇疯緭鍏ヤ粨搴撶紪鍙锋煡璇�" - v-model="queryParam.code" - ></j-input> - </a-form-item> - </a-col> - <a-col - :md="8" - :sm="8" - > - <a-form-item label="浠撳簱鍚嶇О"> - <j-input - placeholder="璇疯緭鍏ヤ粨搴撳悕绉版煡璇�" - v-model="queryParam.name" - ></j-input> - </a-form-item> - </a-col> - </a-row> - </a-form> - </div> - - <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <div - class="table-operator" - style="margin-top: 5px" - > - <a-button - type="primary" - @click="searchQuery" - icon="search" - >鏌ヨ</a-button> - <a-button - @click="searchReset" - icon="reload" - >閲嶇疆</a-button> - <a-button - @click="handleAdd" - type="primary" - icon="plus" - >鏂板</a-button> - <a-button - type="primary" - icon="download" - hidden - @click="handleExportXls('???')" - >瀵煎嚭</a-button> - <a-dropdown - hidden - v-if="selectedRowKeys.length > 0" - > - <a-button style="margin-left: 8px"> - 鎵归噺鎿嶄綔 - <a-icon type="down" /> - </a-button> - <a-menu slot="overlay"> - <a-menu-item @click="batchDel"> - <a-icon type="delete" />鍒犻櫎 - </a-menu-item> - </a-menu> - </a-dropdown> - </div> - - <a-table - ref="table" - bordered - size="middle" - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - :rowSelection="rowSelection" - @change="handleTableChange" - :scroll="{ x: 'calc(1200px + 50%)', y: 900 }" - :customRow="clickThenSelect" - > - <span - slot="action" - slot-scope="text, record" - > - <a - href="javascript:;" - @click="handleEdit(record)" - >缂栬緫</a> - <a-divider type="vertical" /> - <a-dropdown> - <a class="ant-dropdown-link"> - 鏇村 - <a-icon type="down" /> - </a> - <a-menu slot="overlay"> - <a-menu-item> - <a-popconfirm - title="纭畾鍒犻櫎鍚�?" - @confirm="() => handleDelete(record.id)" - > - <a>鍒犻櫎</a> - </a-popconfirm> - </a-menu-item> - </a-menu> - </a-dropdown> - </span> - </a-table> - - <a-tabs - type="card" - defaultActiveKey="1" - > - <a-tab-pane key="1"> - <span slot="tab"> - <a-badge v-if="showTabsFlag">搴撳尯搴撲綅 </a-badge> - <a-badge - v-if="!showTabsFlag" - :count="5" - show-zero - :number-style="{ backgroundColor: '#52c41a' }" - >搴撳尯搴撲綅 </a-badge> - </span> - <div - class="table-operator" - style="margin: 10px" - > - - <warehouse-area-location-list ref="WarehouseAreaLocationList"></warehouse-area-location-list> - </div> - </a-tab-pane> - - <!-- <a-tab-pane - key="2" - forceRender - > - <span slot="tab"> - <a-badge v-if="showTabsFlag">绠$悊瀵硅薄 </a-badge> - <a-badge - v-if="!showTabsFlag" - :count="5" - show-zero - :number-style="{ backgroundColor: '#52c41a' }" - >绠$悊瀵硅薄 </a-badge> - </span> - <div - class="table-operator" - style="margin: 10px" - > - <manage-object-list ref="ManageObjectList"></manage-object-list> - </div> - </a-tab-pane> - - <a-tab-pane - key="3" - forceRender - > - <span slot="tab"> - <a-badge v-if="showTabsFlag">鏈嶅姟瀵硅薄 </a-badge> - <a-badge - v-if="!showTabsFlag" - :count="5" - show-zero - :number-style="{ backgroundColor: '#52c41a' }" - >鏈嶅姟瀵硅薄 </a-badge> - </span> - <div - class="table-operator" - style="margin: 10px" - > - <service-object-list ref="EquipmentFileList"></service-object-list> - </div> - </a-tab-pane> --> - </a-tabs> - <warehouse-modal - ref="modalForm" - @ok="modalFormOk" - ></warehouse-modal> - </a-card> -</template> - -<script> -import { requestPut, deleteAction, getFileAccessHttpUrl, getAction } from '@/api/manage' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import WarehouseModal from './modules/warehouseNew/WarehouseModal.vue' -import JInput from '@/components/jeecg/JInput' -import JEllipsis from '@/components/jeecg/JEllipsis' -import Tooltip from 'ant-design-vue/es/tooltip' -import Vue from 'vue' - -import WarehouseAreaLocationList from './modules/warehouseNew/WarehouseAreaLocationList' -import ManageObjectList from './modules/warehouseNew/ManageObjectList' -import ServiceObjectList from './modules/warehouseNew/ServiceObjectList.vue' - -export default { - name: 'WarehouseListNew.', - mixins: [JeecgListMixin], - components: { - WarehouseModal, - JInput, - JEllipsis, - WarehouseAreaLocationList, - ManageObjectList, - Tooltip, - ServiceObjectList, - }, - data() { - return { - showTabsFlag: true, - disabled: true, - ipagination: { - current: 1, - pageSize: 5, - pageSizeOptions: ['5', '10', '20'], - showTotal: (total, range) => { - return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" - }, - showQuickJumper: true, - showSizeChanger: true, - total: 0 - }, - selectedRowKeys: [], - selectionRows: [], - //榛樿鎺掑簭 - isorter: { - column: 'code', - order: 'desc', - }, - - columns: [ - { - title: '#', - dataIndex: '', - key: 'rowIndex', - align: 'center', - customRender: function (t, r, index) { - return parseInt(index) + 1 - }, - width: 50, - }, - { - title: '浠撳簱缂栫爜', - align: "center", - dataIndex: 'code', - }, - { - title: '浠撳簱鍚嶇О', - align: "center", - dataIndex: 'name', - }, - { - title: '浠撳簱绫诲瀷', - align: "center", - dataIndex: 'type_dictText', - }, - { - title: '鏄惁搴熷搧搴�', - align: "center", - dataIndex: 'whetherWasteWarehouse_dictText', - }, - { - title: '搴撳尯搴撲綅绠$悊', - align: "center", - dataIndex: 'locationManage_dictText', - }, - { - title: '鏈嶅姟瀵硅薄绫诲瀷', - align: "center", - dataIndex: 'serviceObject_dictText', - }, - { - title: '鑷姩鍖�', - align: "center", - dataIndex: 'whetherAutomationWarehouse_dictText', - }, - { - title: '澶囨敞', - align: "center", - dataIndex: 'remark', - }, - { - title: '鎿嶄綔', - align: "center", - dataIndex: 'action', - scopedSlots: { - customRender: 'action', - }, - width: 200, - fixed: 'right', - }, - ], - url: { - list: "/base/warehouse/find", - delete: "/base/warehouse/deleteWarehouseAreaLocation", - active: "/eam/equipment/active", - exportXlsUrl: '/eam/equipment/exportXls', - importExcelUrl: 'base/site/importExcel', - }, - //鏂板銆佺紪杈戙�佸垹闄ゃ�佹壒閲忓垹闄ゆ搷浣滄敼鍙樻暟鎹悗鍒锋柊鍏宠仈鐨勭粍浠剁殑鐩戝惉灞炴�� - alterFlag: "", - }; - }, - - computed: { - rowSelection() { - return { - type: 'checkbox', - onChange: (selectedRowKeys, selectedRows) => { - this.selectedRowKeys = selectedRowKeys; - this.onSelectChange(selectedRowKeys, selectedRows); - }, - getCheckboxProps(record) { - return ({ - props: { - // disabled: !(record.equipmentCategoryDtlList.length == 0), - } - }) - }, - selectedRowKeys: this.selectedRowKeys, - }; - }, - }, - methods: { - - clickThenSelect(record) { - return { - on: { - click: () => { - this.onSelectChange(record.id.split(","), [record]); - } - } - } - }, - onSelectChange(selectedRowKeys, selectionRows) { - this.selectedRowKeys = selectedRowKeys; - this.selectionRows = selectionRows; - if (selectedRowKeys.length == 1) { - this.$refs.WarehouseAreaLocationList.warehouseId = selectedRowKeys[0] - // this.$refs.EquipmentFileList.warehouseId = selectedRowKeys[0] - // this.$refs.ManageObjectList.warehouseId = selectedRowKeys[0] - } else { - this.$refs.WarehouseAreaLocationList.warehouseId = '-1' - // this.$refs.ManageObjectList.warehouseId = '-1' - // this.$refs.EquipmentFileList.warehouseId = '-1' - } - }, - - //绂佺敤鐘舵�佹牱寮� - tableRowClass(record, index) { - if (record.status != "1") { - return "frozenRowClass"; - } - return ""; - }, - - handleActive(id) { - 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); - } - }); - }, - handleAdd: function () { - this.$refs.modalForm.add(); - this.$refs.modalForm.title = "鏂板"; - this.$refs.modalForm.disableSubmit = false; - }, - handleDelete: function (id) { - if (!this.url.delete) { - this.$message.error("璇疯缃畊rl.delete灞炴��!") - return - } - var that = this; - deleteAction(that.url.delete, { id: id }).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(1) - that.$message.success(res.message); - that.loadData(); - that.alterFlag = new Date(); - that.selectionRows = [] - that.selectedRowKeys = [] - that.$refs.WarehouseAreaLocationList.warehouseId = '-1' - } else { - that.$message.warning(res.message); - } - }); - }, - - batchDel: function () { - if (!this.url.deleteBatch) { - this.$message.error("璇疯缃畊rl.deleteBatch灞炴��!") - return - } - if (this.selectedRowKeys.length <= 0) { - this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); - return; - } else { - var ids = ""; - for (var a = 0; a < this.selectedRowKeys.length; a++) { - ids += this.selectedRowKeys[a] + ","; - } - var that = this; - this.$confirm({ - title: "纭鍒犻櫎", - content: "鏄惁鍒犻櫎閫変腑鏁版嵁?", - onOk: function () { - that.loading = true; - deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(that.selectedRowKeys.length) - that.$message.success(res.message); - that.loadData(); - that.onClearSelected(); - that.alterFlag = new Date(); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - that.loading = false; - }); - } - }); - } - }, - - - searchReset() { - this.queryParam = {}; - this.selectedRowKeys = [] - this.selectionRows = [] - this.$refs.WarehouseAreaLocationList.warehouseId = '-1' - this.loadData(1); - - }, - - searchQuery() { - this.selectedRowKeys = [] - this.selectionRows = [] - this.$refs.WarehouseAreaLocationList.warehouseId = '-1' - // this.$refs.ManageObjectList.warehouseId = '-1' - // this.$refs.EquipmentFileList.warehouseId = '-1' - this.loadData(1); - }, - - modalFormOk() { - // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 - this.loadData() - //娓呯┖鍒楄〃閫変腑 - this.onClearSelected() - - this.$refs.WarehouseAreaLocationList.warehouseId = '-1' - // this.$refs.ManageObjectList.warehouseId = '-1' - // this.$refs.EquipmentFileList.warehouseId = '-1' - }, - }, - watch: { - // alterFlag() { - // this.$bus.$emit('queryTreeData'); - // }, - selectionRows() { - this.$bus.$emit('warehouseSelectionRows', this.selectionRows); - }, - }, - created() { - this.queryParam = {}; - this.selectedRowKeys = [] - this.selectionRows = [] - this.loadData(1); - } - - -} -</script> -<style> -@import '~@assets/less/common.less'; - -.frozenRowClass { - color: #c9c9c9; -} -.success { - color: green; -} -.error { - color: red; -} -.fontweight { - font-weight: bold; -} -</style> \ No newline at end of file diff --git a/src/views/base/modules/Constructor/ConstructorForm.vue b/src/views/base/modules/Constructor/ConstructorForm.vue deleted file mode 100644 index fee66d2..0000000 --- a/src/views/base/modules/Constructor/ConstructorForm.vue +++ /dev/null @@ -1,125 +0,0 @@ -<template> - <a-spin :spinning="confirmLoading"> - <j-form-container :disabled="formDisabled"> - <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> - <a-row> - <a-col :span="24"> - <a-form-model-item label="鍒堕�犲晢缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num"> - <a-input v-model="model.num" placeholder="璇疯緭鍏ュ埗閫犲晢缂栫爜" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鍒堕�犲晢鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name"> - <a-input v-model="model.name" placeholder="璇疯緭鍏ュ埗閫犲晢鍚嶇О" ></a-input> - </a-form-model-item> - </a-col> - - - <a-col :span="24"> - <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> - <a-input v-model="model.remark" placeholder="璇疯緭鍏ュ娉�" ></a-input> - </a-form-model-item> - </a-col> - - </a-row> - </a-form-model> - </j-form-container> - </a-spin> -</template> - -<script> - -import { httpAction, getAction } from '@api/manage' -import { validateDuplicateValue } from '@/utils/util' - -export default { - name: 'ConstructorForm', - components: { - }, - props: { - //琛ㄥ崟绂佺敤 - disabled: { - type: Boolean, - default: false, - required: false - } - }, - data () { - return { - model:{ - }, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 }, - }, - confirmLoading: false, - validatorRules: { - num: [ - { required: true, message: '璇疯緭鍏ュ埗閫犲晢缂栫爜!'}, - { validator: (rule, value, callback) => validateDuplicateValue('mom_base_constructor', 'num', value, this.model.id, callback)}, - ], - name: [ - { required: true, message: '璇疯緭鍏ュ埗閫犲晢鍚嶇О!'}, - { validator: (rule, value, callback) => validateDuplicateValue('mom_base_constructor', 'name', value, this.model.id, callback)}, - ] - }, - url: { - add: "/base/constructor/add", - edit: "/base/constructor/edit", - queryById: "/base/constructor/queryById" - } - } - }, - computed: { - formDisabled(){ - return this.disabled - }, - }, - 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; - }, - submitForm () { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.$refs.form.validate(valid => { - if (valid) { - that.confirmLoading = true; - let httpurl = ''; - let method = ''; - if(!this.model.id){ - httpurl+=this.url.add; - method = 'post'; - }else{ - httpurl+=this.url.edit; - method = 'put'; - } - httpAction(httpurl,this.model,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.$emit('ok'); - }else{ - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - }) - } - - }) - }, - } -} -</script> \ No newline at end of file diff --git a/src/views/base/modules/Constructor/ConstructorModal.vue b/src/views/base/modules/Constructor/ConstructorModal.vue deleted file mode 100644 index 607b6d3..0000000 --- a/src/views/base/modules/Constructor/ConstructorModal.vue +++ /dev/null @@ -1,61 +0,0 @@ -<template> - <j-modal - :title="title" - :width="width" - :visible="visible" - switchFullscreen - @ok="handleOk" - :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" - @cancel="handleCancel" - cancelText="鍏抽棴"> - <constructor-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></constructor-form> - </j-modal> -</template> - -<script> - - -import ConstructorForm from '@views/base/modules/Constructor/ConstructorForm' -export default { - name: 'ConstructorModal', - components: { - ConstructorForm, - }, - data () { - return { - title:'', - width:800, - visible: false, - disableSubmit: false - } - }, - methods: { - add () { - this.visible=true - this.$nextTick(()=>{ - this.$refs.realForm.add(); - }) - }, - edit (record) { - this.visible=true - this.$nextTick(()=>{ - this.$refs.realForm.edit(record); - }) - }, - close () { - this.$emit('close'); - this.visible = false; - }, - handleOk () { - this.$refs.realForm.submitForm(); - }, - submitCallback(){ - this.$emit('ok'); - this.visible = false; - }, - handleCancel () { - this.close() - } - } -} -</script> \ No newline at end of file diff --git a/src/views/base/modules/supplier/SupplierCategoryLeft.vue b/src/views/base/modules/supplier/SupplierCategoryLeft.vue deleted file mode 100644 index 220a072..0000000 --- a/src/views/base/modules/supplier/SupplierCategoryLeft.vue +++ /dev/null @@ -1,434 +0,0 @@ -<template> - <a-card - :loading="cardLoading" - :bordered="false" - title="渚涘簲鍟嗛」鐩垎绫�" - style="height: 100%;" - > - <a-spin :spinning="loading"> - <a-alert - type="info" - :showIcon="true" - style="margin-right: 54px;" - > - <div slot="message"> - - 褰撳墠锛�<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span> - <a - v-if="this.currSelected.title" - style="margin-left: 10px" - @click="onClearSelected" - >鍙栨秷</a> - </div> - </a-alert> - <div class="drawer-bootom-button"> - <a-dropdown - :trigger="['click']" - placement="bottomCenter" - > - <a-menu slot="overlay"> - <a-menu-item - key="1" - @click="expandAll" - >灞曞紑鎵�鏈�</a-menu-item> - <a-menu-item - key="2" - @click="closeAll" - >鍚堝苟鎵�鏈�</a-menu-item> - <a-menu-item - key="3" - @click="refreshTree" - >鍒锋柊</a-menu-item> - </a-menu> - <a-button> - <a-icon type="bars" /> - </a-button> - </a-dropdown> - </div> - <a-input-search - @search="handleSearch" - style="width:100%;margin-top: 10px" - placeholder="妫�绱� 渚涘簲鍟嗛」鐩紪鍙�/鍚嶇О" - allowClear - v-model="searchInput" - @change="handleChange" - /> - <!-- showLine --> - <a-tree - showLine - ref="tree" - :checkStrictly="checkStrictly" - :expandedKeys.sync="expandedKeys" - :selectedKeys="selectedKeys" - :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" - :treeData="treeDataSource" - :autoExpandParent="autoExpandParent" - @select="onSelect" - @expand="onExpand" - slots="{}" - > - <template - slot="title" - slot-scope="{ title, parentId, entity, key}" - > - <span v-if="title.indexOf(searchValue) > -1"> - {{ title.substr(0, title.indexOf(searchValue)) }} - <span class="replaceSearch">{{ searchValue }}</span> - {{ title.substr(title.indexOf(searchValue) + searchValue.length) }} - </span> - <span v-else>{{ title }}</span> - <a-dropdown - v-if="entity" - :trigger="['click']" - placement="bottomCenter" - > - <a-menu slot="overlay"> - <a-menu-item v-if="key!=-1"> - <a - href="javascript:;" - @click="handleEdit(entity)" - >缂栬緫</a> - </a-menu-item> - <a-menu-item> - <a - href="javascript:;" - @click="handleAdd(entity)" - > - 娣诲姞 - <span v-if="key!=-1"> - 瀛� - </span> - 绫诲埆 - </a> - </a-menu-item> - <a-menu-item v-if="key!=-1"> - <a-popconfirm - title="纭畾鍒犻櫎鍚�?" - @confirm="() => handleDelete(entity.id)" - > - <a>鍒犻櫎</a> - </a-popconfirm> - </a-menu-item> - </a-menu> - <span :style="{position: 'absolute',right: 0}"> - <a-icon type="down" /> - </span> - </a-dropdown> - </template> - </a-tree> - </a-spin> - <supplier-category-model - ref="modalForm" - @ok="modalFormOk" - :nodeSelected="currSelected" - ></supplier-category-model> - </a-card> -</template> - -<script> -import { getAction, postAction, deleteAction, requestPut } from '@/api/manage' - -import Tooltip from 'ant-design-vue/es/tooltip' -import SupplierCategoryModel from '@views/base/modules/supplier/SupplierCategoryModel' - -export default { - name: 'SupplierCategoryLeft', - props: ['value'], - components: { - SupplierCategoryModel, - Tooltip, - }, - data() { - return { - searchInput: '', - cardLoading: false, - loading: false, - treeDataSource: [], - selectedKeys: [], - expandedKeys: [], - url: { - loadInspectionProjectCategoryTree: '/eam/supplierCategory/loadTree', - delete: '/eam/supplierCategory/delete', - list: '/eam/supplierCategory/list' - }, - searchValue: '', - dataList: [], - autoExpandParent: true, - checkStrictly: true, - allTreeKeys: [], - currSelected: {}, - hiding: false, - } - }, - created() { - this.queryTreeData(); - this.closeAll(); - }, - methods: { - - getCurrSelectedTitle() { - return !this.currSelected.title ? '' : this.currSelected.title; - }, - - onClearSelected() { - this.hiding = true; - this.currSelected = {}; - this.selectedKeys = []; - }, - - onSelect(selectedKeys, e) { - this.hiding = false; - let record = e.node.dataRef; - this.currSelected = Object.assign({}, record); - this.selectedKeys = [record.key]; - this.$emit('clickTreeNode', this.currSelected); - }, - - onExpand(expandedKeys) { - this.expandedKeys = expandedKeys; - this.autoExpandParent = false; - }, - - queryTreeData() { - this.loading = true; - this.cardLoading = true; - getAction(this.url.loadInspectionProjectCategoryTree).then((res) => { - if (res.success) { - this.dataList = []; - this.allTreeKeys = []; - this.currSelected = {}; - this.treeDataSource = res.result; - this.generateList(res.result); - } else { - this.$message.warn(res.message); - } - }).finally(() => { - this.loading = false; - this.cardLoading = false; - }) - }, - - handleChange() { - let search = this.searchInput; - let expandedKeys = this.dataList - .map(item => { - if (item.title.indexOf(search) > -1) { - return this.getParentKey(item.key, this.treeDataSource); - } - return null; - }) - .filter((item, i, self) => item && self.indexOf(item) === i); - Object.assign(this, { - expandedKeys, - searchValue: search, - autoExpandParent: true, - }); - }, - - handleSearch(value) { - let search = value; - let expandedKeys = this.dataList - .map(item => { - if (item.title.indexOf(search) > -1) { - return this.getParentKey(item.key, this.treeDataSource); - } - return null; - }) - .filter((item, i, self) => item && self.indexOf(item) === i); - Object.assign(this, { - expandedKeys, - searchValue: search, - autoExpandParent: true, - }); - }, - - getParentKey(key, tree) { - let parentKey; - for (let i = 0; i < tree.length; i++) { - const node = tree[i]; - if (node.children) { - if (node.children.some(item => item.key === key)) { - parentKey = node.key; - } else if ( - this.getParentKey(key, node.children)) { - parentKey = this.getParentKey(key, node.children); - } - } - } - return parentKey; - }, - - generateList(data) { - for (let i = 0; i < data.length; i++) { - const node = data[i]; - const key = node.key; - const title = node.title; - this.dataList.push({ key, title: title }); - this.allTreeKeys.push(key); - if (node.children) { - this.generateList(node.children); - } - } - }, - - expandAll() { - this.expandedKeys = this.allTreeKeys; - }, - - closeAll() { - this.expandedKeys = ['-1']; - }, - - refreshTree() { - this.queryTreeData(); - }, - - handleAdd(entity) { - if (entity.id) { - this.$refs.modalForm.add(entity.id); - } else { - this.$refs.modalForm.add('-1'); - } - this.$refs.modalForm.title = "鏂板渚涘簲鍟嗗垎绫�"; - this.$refs.modalForm.disableSubmit = false; - }, - - handleEdit(entity) { - this.$refs.modalForm.edit(entity); - this.$refs.modalForm.title = "缂栬緫渚涘簲鍟嗗垎绫�"; - this.$refs.modalForm.disableSubmit = false; - }, - handleDelete(id) { - let that = this; - getAction(that.url.list, { parentId: id }).then((res) => { - if (res.success) { - - if (res.result.records.length == 0) { - deleteAction(that.url.delete, { id: id }).then((res) => { - if (res.success) { - that.$message.success(res.message); - that.currSelected.title = ''; - that.queryTreeData(); - } else { - that.$message.warning("褰撳墠渚涘簲鍟嗛」鐩垎绫昏" + res.message + "鏉′緵搴斿晢椤圭洰寮曠敤锛屾棤娉曟墽琛屽垹闄ゆ搷浣滐紒"); - } - }); - } else { - that.$message.warning("褰撳墠渚涘簲鍟嗛」鐩垎绫绘湁" + res.result.records.length + "鏉″瓙绫诲埆淇℃伅锛屾棤娉曟墽琛屽垹闄ゆ搷浣滐紒"); - } - } else { - that.$message.warning("绯荤粺閿欒锛�"); - } - }) - }, - - handleActive(id) { - if (!this.url.active) { - this.$message.error('璇疯缃畊rl.active灞炴��!') - return; - } - let that = this; - requestPut(that.url.active, {}, { id: id }).then((res) => { - if (res.success) { - that.$message.success(res.message); - that.queryTreeData(); - } else { - that.$message.warning(res.message); - } - }) - }, - - modalFormOk(val) { - // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 - this.queryTreeData(); - }, - - }, - //鐩戝惉 - watch: { - // currSelected(val) {//鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 - // this.$bus.$emit('getCurrSelected', val) - // }, - }, - mounted() { - } -} -</script> - -<style> -.replaceSearch { - color: #00090f; - font-weight: bold; - background-color: rgb(204, 204, 204); -} -/* .ant-select-disabled { - color: rgba(241, 16, 16, 0.25); -} -.ant-select-disabled .ant-select-selection { - background: #a76b6b; -} */ -/*闅愯棌鏍戠殑榛樿icon*/ -.ant-tree-switcher-noop { - display: none !important; -} -/*闅愯棌鏍戠殑榛樿绔栫嚎*/ -.ant-tree.ant-tree-show-line li:not(:last-child):before { - border-left: 0px; -} - -.ant-card-body .table-operator { - margin: 15px; -} - -.anty-form-btn { - width: 100%; - text-align: center; -} - -.anty-form-btn button { - margin: 0 5px; -} - -.anty-node-layout .ant-layout-header { - padding-right: 0; -} - -.header { - padding: 0 8px; -} - -.header button { - margin: 0 3px; -} - -.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; -} - -/** Button鎸夐挳闂磋窛 */ -.ant-btn { - margin-left: 3px; -} -.ant-alert { - padding: 5px 15px 5px 37px; -} -.drawer-bootom-button { - position: absolute; - top: 1px; - /* padding: 10px 16px; */ - text-align: left; - right: 0; - background: #fff; - border-radius: 0 0 2px 2px; -} -</style> \ No newline at end of file diff --git a/src/views/base/modules/supplier/SupplierCategoryModel.vue b/src/views/base/modules/supplier/SupplierCategoryModel.vue deleted file mode 100644 index 6392f08..0000000 --- a/src/views/base/modules/supplier/SupplierCategoryModel.vue +++ /dev/null @@ -1,306 +0,0 @@ -<template> - <a-modal - :title="title" - :width="950" - :visible="visible" - :maskClosable="false" - :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-tree-select - tree-default-expand-all - :disabled="true" - show-search - allow-clear - :dropdown-style="{ maxHeight: '500px', overflow: 'auto' }" - :tree-data="inspectionProjectCategoryTree" - placeholder="璇烽�夋嫨涓婄骇绫诲埆" - treeNodeFilterProp="title" - v-decorator="[ 'parentId', validatorRules.parentId]" - /> - </a-form-item> - </a-col> - <a-col :span="12"> - </a-col> - </a-row> - - <a-row :gutter="24"> - <a-col :lg="12"> - <a-form-item - label="渚涘簲鍟嗗垎绫荤紪鍙�:" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - > - <a-input - allow-clear - placeholder="璇疯緭鍏ヤ緵搴斿晢鍒嗙被缂栧彿" - v-decorator="['num', validatorRules.num ]" - /> - </a-form-item> - </a-col> - <a-col :span="12"> - <a-form-item - label="渚涘簲鍟嗗垎绫诲悕绉�:" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - > - <a-input - allow-clear - placeholder="璇疯緭鍏ヤ緵搴斿晢鍒嗙被鍚嶇О" - v-decorator="['name', validatorRules.name ]" - /> - </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 - placeholder="璇疯緭鍏ュ娉�" - allow-clear - v-decorator="['remark', validatorRules.remark]" - /> - </a-form-item> - </a-col> - </a-row> - - </a-form> - </a-spin> - - <template slot="footer"> - <a-button - :style="{marginRight: '8px'}" - @click="handleCancel" - > - 鍏抽棴 - </a-button> - <a-button - :disabled="confirmLoading" - :loading="confirmLoading" - @click="handleOk" - type="primary" - >纭畾</a-button> - </template> - - </a-modal> -</template> - -<script> -import pick from 'lodash.pick' -import { getAction, postAction, requestPut } from '@/api/manage' -import { duplicateCheck } from '@/api/api' - -export default { - name: 'SupplierCategoryModel', - props: { - nodeSelected: { - type: Object, - default: {} - } - }, - data() { - return { - title: "鎿嶄綔", - 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: { - parentId: { - rules: [ - { required: true, message: '璇疯緭鍏ヤ笂绾х被鍒�!' }, - ] - }, - num: { - rules: [ - { required: true, message: '璇疯緭鍏ュ垎绫荤紪鍙�!' }, - { min: 0, max: 30, message: '闀垮害涓嶈秴杩� 30 涓瓧绗�', trigger: 'blur' }, - { validator: this.validateNum }, - ] - }, - name: { - rules: [ - { required: true, message: '璇疯緭鍏ュ垎绫诲悕绉�!' }, - { min: 0, max: 30, message: '闀垮害涓嶈秴杩� 30 涓瓧绗�', trigger: 'blur' }, - { validator: this.validateName }, - ] - }, - description: { - rules: [ - { min: 0, max: 100, message: '闀垮害涓嶈秴杩� 100 涓瓧绗�', trigger: 'blur' } - ] - } - }, - url: { - add: "/eam/supplierCategory/add", - edit: "/eam/supplierCategory/edit", - loadInspectionProjectCategoryTree: '/eam/supplierCategory/loadTree', - }, - inspectionProjectCategoryTree: [], - } - }, - created() { - }, - methods: { - - loadInspectionProjectCategoryTree() { - this.loading = true; - this.cardLoading = true; - getAction(this.url.loadInspectionProjectCategoryTree, {}).then((res) => { - if (res.success) { - let array = res.result; - this.inspectionProjectCategoryTree = array; - } else { - this.$message.warn(res.message); - } - }).finally(() => { - this.loading = false; - this.cardLoading = false; - }) - }, - - add(parentId) { - this.edit({ 'parentId': parentId }); - }, - - edit(record) { - console.log("record==", record) - this.loadInspectionProjectCategoryTree(); - this.form.resetFields(); - this.model = Object.assign({}, record); - this.visible = true; - this.$nextTick(() => { - this.form.setFieldsValue(pick(this.model, 'parentId', 'num', 'name', 'remark')); - }); - }, - - handleOk() { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - that.form.validateFields((err, values) => { - if (!err) { - let formData = Object.assign(this.model, values); - if (formData.parentId == formData.id) { - that.$message.warning("璇蜂笉瑕侀�夋嫨褰撳墠鎿嶄綔鏁版嵁涓轰笂绾х被鍒紒"); - } else { - that.confirmLoading = true; - let obj; - if (!that.model.id) { - obj = postAction(that.url.add, formData); - } else { - obj = requestPut(that.url.edit, formData, { id: that.model.id }); - } - obj.then((res) => { - if (res.success) { - that.$message.success(res.message); - that.$emit('ok', new Date()); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - that.close(); - }) - } - } - }) - }, - - handleCancel() { - this.close(); - }, - - close() { - this.$emit('close'); - this.visible = false; - }, - - //楠岃瘉 缂栧彿 - validateNum(rule, value, callback) { - var params = { - tableName: 'mom_base_supplier_category', - fieldName: 'num', - fieldVal: value, - dataId: this.model.id, - //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true - delFlag: '0', - }; - duplicateCheck(params).then((res) => { - if (res.success) { - callback(); - } else { - callback("渚涘簲鍟嗗垎绫荤紪鍙峰凡瀛樺湪!"); - } - }) - }, - - //楠岃瘉 鍚嶇О - validateName(rule, value, callback) { - var params = { - tableName: 'mom_base_supplier_category', - fieldName: 'name', - fieldVal: value, - dataId: this.model.id, - //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true - delFlag: '0', - }; - 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> \ No newline at end of file diff --git a/src/views/base/modules/supplier/SupplierContactDetail.vue b/src/views/base/modules/supplier/SupplierContactDetail.vue deleted file mode 100644 index 04e9959..0000000 --- a/src/views/base/modules/supplier/SupplierContactDetail.vue +++ /dev/null @@ -1,211 +0,0 @@ -<template> - <a-card :bordered="false"> - <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> - - - <!-- table鍖哄煙-begin --> - <div> - <a-table - ref="table" - size="middle" - bordered - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - @change="handleTableChange"> - - - - - - <span slot="action" slot-scope="text, record"> - <a @click="handleEdit(record)">缂栬緫</a> - <a-divider type="vertical" /> - <a-dropdown> - <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> - <a-menu slot="overlay"> - <a-menu-item> - <a @click="handleDetail(record)">璇︽儏</a> - </a-menu-item> - <a-menu-item> - <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> - <a>鍒犻櫎</a> - </a-popconfirm> - </a-menu-item> - </a-menu> - </a-dropdown> - </span> - - </a-table> - </div> - - <supplier-contact-model ref="modalForm" @ok="modalFormOk"></supplier-contact-model> - </a-card> -</template> - -<script> - -import '@/assets/less/TableExpand.less' -import { mixinDevice } from '@/utils/mixin' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import SupplierContactModel from './SupplierContactModel' -import { getAction } from '@api/manage' - -export default { - name: 'SupplierContactDetail', - mixins:[JeecgListMixin, mixinDevice], - components: { - SupplierContactModel - }, - data () { - return { - description: '渚涘簲鍟嗚仈绯讳汉绠$悊椤甸潰', - // 琛ㄥご - columns: [ - { - title: '#', - dataIndex: '', - key: 'rowIndex', - width: 60, - align: "center", - customRender: function (t, r, index) { - return parseInt(index) + 1; - } - }, - - - - { - title:'鑱旂郴浜哄悕绉�', - align:"center", - dataIndex: 'name' - }, - { - title:'鎬у埆', - align:"center", - dataIndex: 'sex_dictText' - }, - { - title:'鑱屼綅', - align:"center", - dataIndex: 'position' - }, - { - title:'鐢佃瘽', - align:"center", - dataIndex: 'phone' - }, - { - title:'閭欢', - align:"center", - dataIndex: 'email' - }, - { - title: '鏄惁涓洪粯璁�', - align: "center", - dataIndex: 'defaultValue_dictText', - scopedSlots: { - customRender: 'defaultValue_dictText' - }, - }, - - { - title:'澶囨敞', - align:"center", - dataIndex: 'remark' - }, - - { - title: '鎿嶄綔', - dataIndex: 'action', - align:"center", - fixed:"right", - width:150, - scopedSlots: { customRender: 'action' } - } - ], - url: { - list: "/eam/supplierContact/list", - delete: "/eam/supplierContact/delete", - deleteBatch: "/eam/supplierContact/deleteBatch", - }, - dictOptions:{}, - superFieldList:[], - supplierContactSelectionRows: [], - supplierId: '', - } - }, - created() { - this.getSuperFieldList(); - }, - watch: { - supplierId() { - this.queryParam = {}; - this.queryParam.supplierId = this.supplierId; - this.loadData(1); - }, - }, - mounted() { - this.$bus.$on('supplierContactSelectionRows', (data) => { - this.supplierContactSelectionRows = data - }) - }, - methods: { - - handleAdd: function () { - this.$refs.modalForm.add(this.supplierId); - debugger - this.$refs.modalForm.title = "渚涘簲鍟嗚仈绯讳汉"; - this.$refs.modalForm.disableSubmit = false; - this.$refs.modalForm.supplierId = this.supplierContactSelectionRows[0].id - console.log('id'+this.$refs.modalForm.supplierId) - }, - - getSuperFieldList(){ - let fieldList=[]; - fieldList.push({type:'string',value:'name',text:'鑱旂郴浜哄悕绉�',dictCode:''}) - fieldList.push({type:'string',value:'sex',text:'鎬у埆',dictCode:''}) - fieldList.push({type:'string',value:'supplierId',text:'渚涘簲鍟唅d',dictCode:'',hidden:true}) - fieldList.push({type:'string',value:'position',text:'鑱屼綅',dictCode:''}) - fieldList.push({type:'string',value:'phone',text:'鐢佃瘽',dictCode:''}) - fieldList.push({type:'string',value:'email',text:'閭欢',dictCode:''}) - fieldList.push({type:'string',value:'defaultValue',text:'鏄惁榛樿',dictCode:''}) - fieldList.push({type:'string',value:'remark',text:'澶囨敞',dictCode:''}) - this.superFieldList = fieldList - } - } -} -</script> -<style lang="less" scoped> -@import '~@assets/less/common.less'; - - -/deep/ .frozenRowClass { - color: #c9c9c9; -} -.success { - color: green; -} -.error { - color: red; -} -.fontweight { - font-weight: bold; -} -.fontweightGreen { - font-weight: bold; - color: green; -} -.ant-card { - margin-left: -30px; - margin-right: -30px; -} -</style> - - - diff --git a/src/views/base/modules/supplier/SupplierContactForm.vue b/src/views/base/modules/supplier/SupplierContactForm.vue deleted file mode 100644 index 6b8f05a..0000000 --- a/src/views/base/modules/supplier/SupplierContactForm.vue +++ /dev/null @@ -1,189 +0,0 @@ -<template> - <a-spin :spinning="confirmLoading"> - <j-form-container :disabled="formDisabled"> - <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> - <a-row> - <a-col :span="24"> - <a-form-model-item label="鑱旂郴浜哄悕绉�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name"> - <a-input v-model="model.name" placeholder="璇疯緭鍏ヨ仈绯讳汉鍚嶇О" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鎬у埆" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sex"> - <j-dict-select-tag type="radio" v-model="model.sex" dictCode="sex" placeholder="璇烽�夋嫨鎬у埆" /> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鑱屼綅" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="position"> - <a-input v-model="model.position" placeholder="璇疯緭鍏ヨ亴浣�" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="鐢佃瘽" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone"> - <a-input v-model="model.phone" placeholder="璇疯緭鍏ョ數璇�" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - <a-form-model-item label="閭欢" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="email"> - <a-input v-model="model.email" placeholder="璇疯緭鍏ラ偖浠�" ></a-input> - </a-form-model-item> - </a-col> - <a-col :span="24"> - - <a-form-model-item label="鏄惁榛樿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="defaultValue"> - <j-dict-select-tag - placeholder="璇烽�夋嫨鏄惁榛樿" - v-model="model.defaultValue" - :triggerChange="true" - dictCode="default_value" - /> - </a-form-model-item> - </a-col> - - <a-col :span="24"> - <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> - <a-input v-model="model.remark" placeholder="璇疯緭鍏ュ娉�" ></a-input> - </a-form-model-item> - </a-col> - - </a-row> - </a-form-model> - </j-form-container> - </a-spin> -</template> - -<script> - - import { httpAction, getAction } from '@/api/manage' - import { validateDuplicateValue } from '@/utils/util' - import { duplicateCheck } from '@api/api' - - export default { - name: 'SupplierContactForm', - components: { - }, - props: { - //琛ㄥ崟绂佺敤 - disabled: { - supplierId: "", - type: Boolean, - default: false, - required: false - } - }, - data () { - return { - model:{ - }, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 }, - }, - confirmLoading: false, - validatorRules: { - - name: [ - { required: true, message: '璇疯緭鍏ヨ仈绯讳汉鍚嶇О!' }, - { min: 2, max: 30, message: '闀垮害鍦� 2 鍒� 30 涓瓧绗�', trigger: 'blur' }, - { validator: this.validateName }, - ], - phone: [ - { required: true, message: '璇疯緭鍏ョ數璇�!'}, - { pattern: /^1[3456789]\d{9}$/, message: '璇疯緭鍏ユ纭殑鎵嬫満鍙风爜!'}, - ], - email: [ - { required: true, message: '璇疯緭鍏ラ偖浠�!'}, - { pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/, message: '璇疯緭鍏ユ纭殑鐢靛瓙閭欢!'}, - ], - }, - url: { - add: "/eam/supplierContact/add", - edit: "/eam/supplierContact/edit", - queryById: "/eam/supplierContact/queryById" - }, - testid:'' - } - }, - computed: { - formDisabled(){ - return this.disabled - }, - }, - 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; - }, - - - - - submitForm (id) { - console.log(id) - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.$refs.form.validate(valid => { - if (valid) { - that.confirmLoading = true; - that.model.supplierId=id - console.log(this.supplierId) - let httpurl = ''; - let method = ''; - - if(!this.model.id){ - httpurl+=this.url.add; - method = 'post'; - }else{ - httpurl+=this.url.edit; - method = 'put'; - } - console.log(that.model) - httpAction(httpurl,that.model,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.$emit('ok'); - }else{ - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - }) - } - - }) - }, - - - //楠岃瘉 鍚嶇О - validateName(rule, value, callback) { - var params = { - tableName: 'mom_base_supplier_contact', - fieldName: 'name', - fieldVal: value, - dataId: this.model.id, - //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true - delFlag: '0', - }; - duplicateCheck(params).then((res) => { - if (res.success) { - callback(); - } else { - callback("鍚嶇О宸插瓨鍦�!"); - } - }) - }, - - } - } -</script> \ No newline at end of file diff --git a/src/views/base/modules/supplier/SupplierContactModel.vue b/src/views/base/modules/supplier/SupplierContactModel.vue deleted file mode 100644 index 209f3d6..0000000 --- a/src/views/base/modules/supplier/SupplierContactModel.vue +++ /dev/null @@ -1,73 +0,0 @@ -<template> - <j-modal - :title='title' - :width='width' - :visible='visible' - switchFullscreen - @ok='handleOk' - :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" - @cancel='handleCancel' - cancelText='鍏抽棴'> - <supplier-contact-form ref='realForm' @ok='submitCallback' :disabled='disableSubmit'></supplier-contact-form> - </j-modal> -</template> - -<script> - -import SupplierContactForm from './SupplierContactForm' -import { postAction } from '@api/manage' - -export default { - name: 'SupplierContactModel', - components: { - SupplierContactForm - }, - data() { - return { - title: '', - width: 800, - visible: false, - disableSubmit: false, - - url: { - add: '/eam/supplierContact/add', - }, - testid:"", - supplierId: "", - } - }, - methods: { - add(supplierId) { - this.supplierId = supplierId - console.log(supplierId) - this.visible = true - this.$nextTick(() => { - this.$refs.realForm.add() - }) - }, - edit(record) { - this.visible = true - this.$nextTick(() => { - this.$refs.realForm.edit(record) - }) - }, - close() { - this.$emit('close') - this.visible = false - }, - - - - handleOk() { - this.$refs.realForm.submitForm(this.supplierId) - }, - submitCallback() { - this.$emit('ok') - this.visible = false - }, - handleCancel() { - this.close() - } - } -} -</script> \ No newline at end of file diff --git a/src/views/base/modules/supplier/SupplierModel.vue b/src/views/base/modules/supplier/SupplierModel.vue deleted file mode 100644 index 117b795..0000000 --- a/src/views/base/modules/supplier/SupplierModel.vue +++ /dev/null @@ -1,391 +0,0 @@ -<template> - <a-modal - :title="title" - :width="1050" - :visible="visible" - :maskClosable="false" - :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="12"> - <a-form-item - label="渚涘簲鍟嗗垎绫�" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - > - <a-input - allow-clear - :disabled="true" - :placeholder="disableSubmit?'':'璇疯緭鍏ヤ笂绾т緵搴斿晢缂栧彿'" - v-decorator="['supplierCategoryNumName', validatorRules.supplierCategoryNumName ]" - /> - </a-form-item> - </a-col> - - <a-col :span="12"> - <a-form-item - label="渚涘簲鍟嗙畝绉�" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - > - <a-input - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇疯緭鍏ヤ緵搴斿晢绠�绉�'" - v-decorator="['abbreviation', validatorRules.abbreviation ]" - /> - </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 - allow-clear - :disabled="codeDisable" - :placeholder="disableSubmit?'':'璇疯緭鍏ヤ緵搴斿晢缂栧彿'" - v-decorator="['num', validatorRules.num ]" - /> - </a-form-item> - </a-col> - <a-col :span="12"> - <a-form-item - label="渚涘簲鍟嗗悕绉�" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - > - <a-input - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇疯緭鍏ヤ緵搴斿晢鍚嶇О'" - v-decorator="['name', validatorRules.name ]" - - /> - </a-form-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="12"> - <a-form-item - label="渚涘簲鍟嗙被鍨�" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - > - <j-dict-select-tag - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇烽�夋嫨渚涘簲鍟嗙被鍨�'" - dictCode="supplier_type" - :triggerChange="true" - v-decorator="['supplierType', validatorRules.supplierType]" - /> - <!-- dictCode="mom_eam_inspection_type,name,id,status!='0' and del_flag!='1'" --> - </a-form-item> - </a-col> - <a-col :span="12"> - <a-form-item - label="渚涘簲鍟嗘墍灞炶涓�" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - > - <a-input - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇疯緭鍏ヤ緵搴斿晢鎵�灞炶涓�'" - v-decorator="['affiliationIndustry', validatorRules.affiliationIndustry ]" - /> - - </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 - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇疯緭鍏ュ湴鍧�'" - v-decorator="['address', validatorRules.address ]" - /> - </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 - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇疯緭鍏ュ娉�'" - v-decorator="['remark', validatorRules.remark]" - /> - </a-form-item> - </a-col> - </a-row> - - </a-form> - </a-spin> - - <template slot="footer"> - <a-button - :style="{marginRight: '8px'}" - @click="handleCancel" - > - 鍏抽棴 - </a-button> -<!-- <a-button - v-if="!this.model.id" - :disabled="disableSubmit || confirmLoading" - :loading="confirmLoading" - @click="handleOkAndAdd" - type="primary" - >淇濆瓨骞剁户缁柊澧�</a-button>--> - <a-button - :disabled="disableSubmit || confirmLoading" - :loading="confirmLoading" - @click="handleOk" - type="primary" - >纭畾</a-button> - <!-- icon="save" --> - </template> - - </a-modal> -</template> - -<script> -import pick from 'lodash.pick' -import { postAction, requestPut } from '@/api/manage' -import { duplicateCheck } from '@/api/api' - -export default { - name: 'SupplierModel', - data() { - return { - title: "鎿嶄綔", - visible: false, - codeDisable: true, - disableSubmit: false, - supplierCategoryId: '', - model: {}, - labelCol: { - xs: { span: 24 }, - sm: { span: 6 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 }, - }, - confirmLoading: false, - form: this.$form.createForm(this), - validatorRules: { - num: { - rules: [ - { required: true, message: '璇疯緭鍏ヤ緵搴斿晢缂栧彿!' }, - { min: 2, max: 30, message: '闀垮害鍦� 2 鍒� 30 涓瓧绗�', trigger: 'blur' }, - { validator: this.validateNum }, - ] - }, - name: { - rules: [ - { required: true, message: '璇疯緭鍏ヤ緵搴斿晢鍚嶇О!' }, - { min: 2, max: 30, message: '闀垮害鍦� 2 鍒� 30 涓瓧绗�', trigger: 'blur' }, - { validator: this.validateName }, - ] - }, - // }, - remark: { - rules: [ - { min: 0, max: 100, message: '闀垮害涓嶈秴杩� 100 涓瓧绗�', trigger: 'blur' }, - ] - } - }, - url: { - add: "/eam/supplier/add", - edit: "/eam/supplier/edit" - }, - //鏂板銆佺紪杈戙�佸垹闄ゃ�佹壒閲忓垹闄ゆ搷浣滄敼鍙樻暟鎹悗鍒锋柊鍏宠仈鐨勭粍浠剁殑鐩戝惉灞炴�� - alterFlag: "" - } - }, - created() { - }, - methods: { - - add(record) { - this.edit(record); - }, - - edit(record) { - this.form.resetFields(); - this.model = Object.assign({}, record); - this.visible = true; - this.disableSubmit = false; - this.$nextTick(() => { - this.form.setFieldsValue(pick(this.model, 'supplierCategoryNumName', 'abbreviation', 'supplierType', 'num', 'name', 'affiliationIndustry', 'address', 'remark')) - }); - if (record.id) { - this.codeDisable = true; - } else { - this.codeDisable = false; - } - }, - - close() { - this.$emit('close'); - this.visible = false; - }, - - //淇濆瓨骞舵柊澧炴寜閽Е鍙� - handleOkAndAdd() { - const that = this - - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - if (!err) { - that.confirmLoading = true; - let formData = Object.assign(this.model, values); - formData.supplierCategoryId = this.supplierCategoryId - console.log(this.supplierCategoryId) - postAction(this.url.add, formData).then((res) => { - if (res.success) { - that.$message.success(res.message); - that.$emit('ok'); - that.alterFlag = new Date(); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - this.confirmLoading = false - this.form.setFieldsValue(pick(this.model, 'supplierCategoryNumName')) - this.form.setFieldsValue({ "abbreviation": null, "supplierType": null, "affiliationIndustry": null, "address": null, "num": null, "name": null, "remark": null }) - }) - } else { - return false - } - }) - }, - - handleOk() { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - if (!err) { - that.confirmLoading = true; - let formData = Object.assign(this.model, values); - let obj; - if (!this.model.id) { - formData.supplierCategoryId = this.supplierCategoryId - - console.log("supplierCategoryId"+this.supplierCategoryId) - 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(res.message); - that.$emit('ok'); - that.alterFlag = new Date(); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - that.close(); - }) - } - }) - }, - - handleCancel() { - this.close() - }, - - //楠岃瘉 缂栧彿 - validateNum(rule, value, callback) { - var params = { - tableName: 'mom_base_supplier', - fieldName: 'num', - fieldVal: value, - dataId: this.model.id, - //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true - delFlag: '0', - }; - duplicateCheck(params).then((res) => { - if (res.success) { - callback(); - } else { - callback("缂栧彿宸插瓨鍦�!"); - } - }) - }, - - //楠岃瘉 鍚嶇О - validateName(rule, value, callback) { - var params = { - tableName: 'mom_base_supplier', - fieldName: 'name', - fieldVal: value, - dataId: this.model.id, - //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true - delFlag: '0', - }; - duplicateCheck(params).then((res) => { - if (res.success) { - callback(); - } else { - callback("鍚嶇О宸插瓨鍦�!"); - } - }) - }, - - }, - watch: { - alterFlag() { - this.$bus.$emit('queryTreeData'); - }, - } -} -</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> \ No newline at end of file diff --git a/src/views/base/modules/supplier/SupplierModelRight.vue b/src/views/base/modules/supplier/SupplierModelRight.vue deleted file mode 100644 index 40ffe98..0000000 --- a/src/views/base/modules/supplier/SupplierModelRight.vue +++ /dev/null @@ -1,482 +0,0 @@ -<template> - <a-card - :bordered='false' - title='渚涘簲鍟�' - > - <!-- 鏌ヨ鍖哄煙 --> - <div class='table-page-search-wrapper'> - <a-form - layout='inline' - @keyup.enter.native='searchQuery' - > - <a-row :gutter="24"> - <a-col - :md="8" - :sm="8" - > - <a-form-item label='渚涘簲鍟嗙紪鐮�'> - <j-input - placeholder='璇疯緭鍏ヤ緵搴斿晢缂栫爜' - v-model='queryParam.num' - ></j-input> - </a-form-item> - </a-col> - <a-col - :md='8' - :sm='8' - > - <a-form-item label='渚涘簲鍟嗗悕绉�'> - <j-input - placeholder='璇疯緭鍏ヤ緵搴斿晢鍚嶇О' - v-model='queryParam.name' - ></j-input> - </a-form-item> - </a-col> - </a-row> - </a-form> - </div> - - <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <div - class='table-operator' - style='margin-top: 5px' - > - <a-button - type='primary' - @click='searchQuery' - icon='search' - >鏌ヨ - </a-button> - <a-button - @click='searchReset' - icon='reload' - >閲嶇疆 - </a-button> - <a-button - @click='handleAdd' - type='primary' - icon='plus' - :hidden='disabled' - >鏂板 - </a-button> - <a-button - type='primary' - icon='download' - @click="handleExportXls('渚涘簲鍟�')" - >瀵煎嚭 - </a-button> - <a-dropdown v-if='selectedRowKeys.length > 0'> - <a-button style='margin-left: 8px'> - 鎵归噺鎿嶄綔 - <a-icon type='down' /> - </a-button> - <a-menu slot='overlay'> - <a-menu-item @click='batchDel'> - <a-icon type='delete' /> - 鍒犻櫎 - </a-menu-item> - </a-menu> - </a-dropdown> - </div> - - <!-- table鍖哄煙-begin --> - - <a-table - ref='table' - bordered - size='middle' - rowKey='id' - :columns='columns' - :rowClassName='tableRowClass' - :dataSource='dataSource' - :pagination='ipagination' - :loading='loading' - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - @change='handleTableChange' - :scroll="{ x: 'calc(1200px + 50%)', y: 900 }" - :customRow="clickThenSelect" - > - - - <!--瀛楃涓茶秴闀挎埅鍙栫渷鐣ュ彿鏄剧ず--> -<!-- <span--> -<!-- slot='num'--> -<!-- slot-scope='text'--> -<!-- style='font-weight: bold'--> -<!-- >--> -<!-- <j-ellipsis--> -<!-- :value='text'--> -<!-- :length='15'--> -<!-- />--> -<!-- </span>--> -<!-- <span--> -<!-- slot='name'--> -<!-- slot-scope='text'--> -<!-- style='font-weight: bold'--> -<!-- >--> -<!-- <j-ellipsis--> -<!-- :value='text'--> -<!-- :length='15'--> -<!-- />--> -<!-- </span>--> -<!-- <span--> -<!-- slot='model'--> -<!-- slot-scope='text'--> -<!-- >--> -<!-- <j-ellipsis--> -<!-- :value='text'--> -<!-- :length='15'--> -<!-- />--> -<!-- </span>--> - <span - slot='action' - slot-scope='text, record' - > - <a @click='handleEdit(record)'>缂栬緫</a> - <a-divider type='vertical' /> - <a-dropdown> - <a class='ant-dropdown-link'> - 鏇村 - <a-icon type='down' /> - </a> - <a-menu slot='overlay'> - <a-menu-item> - <a - href='javascript:;' - @click='handleDetail(record)' - >璇︽儏</a> - </a-menu-item> - - <a-menu-item> - <a-popconfirm - title='纭畾鍒犻櫎鍚�?' - @confirm='() => handleDelete(record.id)' - > - <a>鍒犻櫎</a> - </a-popconfirm> - </a-menu-item> - </a-menu> - </a-dropdown> - </span> - - </a-table> - - <a-tabs defaultActiveKey="1"> - <a-tab-pane key="1"> - <span slot="tab"> - <a-badge v-if="showTabsFlag">渚涘簲鍟嗚仈绯讳汉</a-badge> - <a-badge - v-if="!showTabsFlag" - :count="1" - show-zero - :number-style="{ backgroundColor: '#52c41a' }" - >渚涘簲鍟嗚仈绯讳汉</a-badge> - </span> - <div - class="table-operator" - style="margin-top: 0px" - > - <supplier-contact-detail ref="SupplierContactDetail"></supplier-contact-detail> - </div> - </a-tab-pane> - </a-tabs> - - <!-- table鍖哄煙-end --> - - <supplier-model - ref='modalForm' - @ok='modalFormOk' - :nodeSelected='nodeSelected'></supplier-model> - </a-card> -</template> - -<script> -import SupplierContactDetail from './SupplierContactDetail' -import JDictSelectTag from '@/components/dict/JDictSelectTag' -import { deleteAction, requestPut } from '@/api/manage' -import SupplierModel from './SupplierModel' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import JInput from '@/components/jeecg/JInput' -import JEllipsis from '@/components/jeecg/JEllipsis' -import Tooltip from 'ant-design-vue/es/tooltip' - - -export default { - name: 'SupplierModelRight', - mixins: [JeecgListMixin], - components: { - SupplierContactDetail, - Tooltip, - SupplierModel, - JDictSelectTag, - JInput, - JEllipsis - - }, - props: { - recordSelect: {} - }, - data() { - return { - showTabsFlag: true, - disabled: true, - ipagination: { - current: 1, - pageSize: 5, - pageSizeOptions: ['5', '10', '20'], - showTotal: (total, range) => { - return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" - }, - showQuickJumper: true, - showSizeChanger: true, - total: 0 - }, - nodeSelected: {}, - isorter: { - column: 'num', - order: 'asc', - }, - columns: [ - { - title: '#', - dataIndex: '', - key: 'rowIndex', - align: 'center', - customRender: function(t, r, index) { - return parseInt(index) + 1 - }, - width: 50 - }, - { - title: '渚涘簲鍟嗙紪鐮�', - align: 'center', - dataIndex: 'num', - scopedSlots: { - customRender: 'num' - } - // sorter: true, - }, - { - title: '渚涘簲鍟嗗悕绉�', - align: 'center', - dataIndex: 'name', - scopedSlots: { - customRender: 'name' - } - // sorter: true, - }, - { - title: '渚涘簲鍟嗙被鍨�', - align: 'center', - dataIndex: 'supplierType_dictText' - }, - - { - title: '渚涘簲鍟嗙畝绉�', - align: 'center', - dataIndex: 'abbreviation' - }, - - { - title: '鎵�灞炶涓�', - align: 'center', - dataIndex: 'affiliationIndustry' - }, - { - title: '鍦板潃', - align: 'center', - dataIndex: 'address' - }, - { - title: '鍒涘缓浜�', - align: 'center', - dataIndex: 'createBy' - }, - { - title: '鍒涘缓鏃堕棿', - align: 'center', - dataIndex: 'createTime' - }, - { - title: '淇敼浜�', - align: 'center', - dataIndex: 'updateBy' - }, - { - title: '淇敼鏃堕棿', - align: 'center', - dataIndex: 'updateTime' - }, - { - title: '澶囨敞', - align: "center", - dataIndex: 'remark', - }, - { - - title: '鎿嶄綔', - dataIndex: 'action', - align: 'center', - scopedSlots: { - customRender: 'action' - }, - width: 150, - fixed: 'right' - } - ], - url: { - list: '/eam/supplier/list', - delete: '/eam/supplier/delete', - deleteBatch: '/eam/supplier/deleteBatch', - exportXlsUrl: '/eam/supplier/exportXls', - importExcelUrl: 'eam/supplier/importExcel' - }, - supplierCategoryId: '', - } - }, - - - methods: { - - clickThenSelect(record) { - return { - on: { - click: () => { - this.onSelectChange(record.id.split(","), [record]); - } - } - } - }, - - onSelectChange(selectedRowKeys, selectionRows) { - if (selectedRowKeys.length == 1) { - this.$refs.SupplierContactDetail.supplierId = selectedRowKeys[0] - console.log(this.$refs.SupplierContactDetail.supplierId) - } else { - this.$refs.SupplierContactDetail.supplierId = '-1' - } - this.selectedRowKeys = selectedRowKeys; - this.selectionRows = selectionRows; - }, - - handleAdd: function() { - - this.$refs.modalForm.add({ supplierCategoryNumName: this.supplierCategoryNumName,supplierCategoryId:this.supplierCategoryId }); - this.$refs.modalForm.title = "鏂板"; - this.$refs.modalForm.disableSubmit = false; - this.$refs.modalForm.supplierCategoryId = this.nodeSelected.key; - console.log(this.$refs.modalForm.supplierCategoryId) - }, - - - - batchDel: function () { - if (!this.url.deleteBatch) { - this.$message.error("璇疯缃畊rl.deleteBatch灞炴��!") - return - } - if (this.selectedRowKeys.length <= 0) { - this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); - return; - } else { - var ids = ""; - for (var a = 0; a < this.selectedRowKeys.length; a++) { - ids += this.selectedRowKeys[a] + ","; - } - var that = this; - this.$confirm({ - title: "纭鍒犻櫎", - content: "鏄惁鍒犻櫎閫変腑鏁版嵁?", - onOk: function () { - that.loading = true; - deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(that.selectedRowKeys.length) - that.$message.success(res.message); - that.loadData(); - that.onClearSelected(); - that.alterFlag = new Date(); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - that.loading = false; - }); - } - }); - } - }, - - - //绂佺敤鐘舵�佹牱寮� - tableRowClass(record, index) { - if (record.status != '1') { - return 'frozenRowClass' - } - return '' - }, - searchReset() { - if ('-1' != this.nodeSelected.key) { - this.disabled = false - this.queryParam = [] - this.queryParam.supplierCategoryId = this.nodeSelected.key - } else { - this.disabled = true - this.queryParam = [] - } - this.loadData(1) - } - }, - watch: { - selectionRows() { - this.$bus.$emit('supplierContactSelectionRows', this.selectionRows); - }, - recordSelect(val) { - this.nodeSelected = val - this.supplierCategoryNumName = this.nodeSelected.rfield1 + '/' + this.nodeSelected.rfield2 - if ('-1' != this.nodeSelected.key) { - this.disabled = false - this.queryParam = [] - this.queryParam.supplierCategoryId = this.nodeSelected.key - } else { - this.disabled = true - this.queryParam = [] - } - this.loadData(1) - } - }, - created() { - this.queryParam = {}; - this.queryParam.supplierCategoryId = this.nodeSelected.key; - this.selectedRowKeys = [] - this.selectionRows = [] - this.loadData(1); - } - -} -</script> - -<style lang='less' scoped> -@import '~@assets/less/common.less'; - -.frozenRowClass { - color: #c9c9c9; -} - -.success { - color: green; -} - -.error { - color: red; -} - -.notShow { - display: none; -} - -.fontweight { - font-weight: bold; -} -</style> \ No newline at end of file diff --git a/src/views/base/modules/warehouseNew/ManageObjectList.vue b/src/views/base/modules/warehouseNew/ManageObjectList.vue deleted file mode 100644 index 7601da6..0000000 --- a/src/views/base/modules/warehouseNew/ManageObjectList.vue +++ /dev/null @@ -1,259 +0,0 @@ -<template> - <a-card :bordered="false"> - <a-button - v-if="warehouseSelectionRows.length == 1" - @click="handleAdd" - type="primary" - icon="plus" - >鏂板</a-button> - - <div> - <a-table - ref="table" - size="middle" - bordered - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination=false - :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - @change="handleTableChange" - > - <template - v-for="col in columns" - :slot="col.dataIndex" - slot-scope='text, record, index' - > - <div :key="col.dataIndex"> - - <span v-if="col.dataIndex == 'remark'"> - <j-ellipsis - :value="text" - :length="10" - /> - </span> - - <a-input-number - :value="text" - v-if="col.dataIndex == 'upperLimit'" - @change="(e)=>handleChange(e, record.key, col, index)" - style="width: 100%" - /> - <a-input-number - :value="text" - v-if="col.dataIndex == 'lowerLimit'" - @change="(e)=>handleChange(e, record.key, col, index)" - style="width: 100%" - /> - <a-input-number - :value="text" - v-if="col.dataIndex == 'actualValue'" - @change="(e)=>handleChange(e, record.key, col, index)" - style="width: 100%" - /> - - <span v-if="col.dataIndex == 'action'"> - <a-button - type="primary" - @click="handleEdit(record)" - >鎻愪氦</a-button> - </span> - - </div> - </template> - - </a-table> - </div> - <manage-objcet-modal - ref="modalForm" - @ok="modalFormOk" - ></manage-objcet-modal> - </a-card> -</template> - -<script> -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import { getAction, postAction } from '@/api/manage' -import JInput from '@/components/jeecg/JInput' -import Tooltip from 'ant-design-vue/es/tooltip' -import JEllipsis from "@/components/jeecg/JEllipsis"; -import ManageObjectModal from './ManageObjectModal' - -export default { - name: "ManageObjectList", - mixins: [JeecgListMixin], - components: { - JInput, - Tooltip, - JEllipsis, - ManageObjectModal - }, - data() { - return { - // disabled: true, - description: '璁惧绮惧害', - colorMap: {}, - // 琛ㄥご - columns: [ - { - title: '#', - dataIndex: '', - key: 'rowIndex', - width: 60, - align: "center", - customRender: function (t, r, index) { - return parseInt(index) + 1; - } - }, - { - title: '绠$悊瀵硅薄缂栫爜', - dataIndex: 'precisionParametersNum', - align: "center", - }, - { - title: '绠$悊瀵硅薄鍚嶇О', - dataIndex: 'precisionParametersName', - align: "center", - }, - { - title: '榛樿搴撳尯', - dataIndex: 'precisionParametersUnitName', - align: "center", - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - width: 100, - align: "center", - scopedSlots: { - customRender: 'action' - }, - }, - ], - url: { - list: "/eam/equipmentPrecisionParameters/list", - edit: "/eam/equipmentPrecisionParameters/edit", - }, - warehouseSelectionRows: [], - equipmentId: '', - } - }, - watch: { - equipmentId() { - this.queryParam = {}; - this.queryParam.equipmentId = this.equipmentId; - this.loadData(1); - }, - }, - mounted() { - this.$bus.$on('warehouseSelectionRows', (data) => { - this.warehouseSelectionRows = data - }) - }, - methods: { - modalFormOk() { - this.loadData(); - }, - - handleAdd: function () { - this.$refs.modalForm.add(); - this.$refs.modalForm.title = "璁惧绮惧害鍙傛暟缁戝畾"; - this.$refs.modalForm.disableSubmit = false; - this.$refs.modalForm.equipmentId = this.warehouseSelectionRows[0].id - }, - - handleEdit(record) { - this.loading = true; - if (record.actualValue === "" || record.actualValue === null) { - this.$message.warning("鍙傝�冨�间笉鑳戒负绌猴紒") - this.loading = false; - return - } - postAction(this.url.edit, record).then((res) => { - if (res.success) { - this.$message.success(res.message); - this.loadData() - } else { - this.$message.warning(res.message); - } - }).finally(() => { - this.loading = false; - }); - }, - - modalFormOk() { - this.loadData(1); - }, - - handleChange(value, key, column, index) { - let that = this; - const temp = [...that.dataSource]; - const target = temp.filter(item => key === item.key)[index]; - if (target) { - target[column.dataIndex] = value; - if ('actualValue' == column.dataIndex) { - target['actualValue'] = value; - } - if ('upperLimit' == column.dataIndex) { - target['upperLimit'] = value; - } - if ('lowerLimit' == column.dataIndex) { - target['lowerLimit'] = value; - } - //鏄剧ず甯﹁繃鏉ョ殑鏁版嵁 - that.dataSource = temp; - } - }, - - loadData(arg) { - if (arg === 1) { - this.ipagination.current = 1; - } - // var params = this.getQueryParams();//鏌ヨ鏉′欢 - var params = this.queryParam - params.pageNo = this.ipagination.current - params.pageSize = this.ipagination.pageSize - if (this.equipmentId == '') { - params.equipmentId = '-1'; - } - this.loading = true; - getAction(this.url.list, params).then((res) => { - if (res.success) { - this.dataSource = res.result.records || res.result; - if (res.result.total) { - this.ipagination.total = res.result.total; - } else { - this.ipagination.total = 0; - } - } else { - this.$message.warning(res.message) - } - }).finally(() => { - this.loading = false - }) - }, - }, - -} -</script> - -<style scoped> -@import '~@assets/less/common.less'; -/deep/ .frozenRowClass { - color: #c9c9c9; -} -.success { - color: green; -} -.error { - color: red; -} -.fontweight { - font-weight: bold; -} -.ant-card { - margin-left: -30px; - margin-right: -30px; -} -</style> \ No newline at end of file diff --git a/src/views/base/modules/warehouseNew/ManageObjectModal.vue b/src/views/base/modules/warehouseNew/ManageObjectModal.vue deleted file mode 100644 index 582f200..0000000 --- a/src/views/base/modules/warehouseNew/ManageObjectModal.vue +++ /dev/null @@ -1,286 +0,0 @@ -<template> - <a-modal - :title="title" - :width="1250" - :visible="visible" - :confirmLoading="confirmLoading" - :okButtonProps="{ props: {disabled: disableSubmit} }" - @ok="handleOk" - @cancel="handleCancel" - cancelText="鍏抽棴" - > - <a-spin :spinning="confirmLoading"> - <a-form :form="form"> - <a-table - ref="table" - size="middle" - bordered - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - @change="handleTableChange" - :customRow="clickThenCheck" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}" - > - - </a-table> - - <!-- <a-tabs defaultActiveKey="1"> - <a-tab-pane key="1"> - <span slot="tab"> - <a-badge>绮惧害鍙傛暟 </a-badge> - </span> - <div - class="table-operator" - style="margin:8px" - > - <precision-parameters-detail-list ref="PrecisionParametersDetailList"> </precision-parameters-detail-list> - </div> - </a-tab-pane> - </a-tabs> --> - </a-form> - </a-spin> - - </a-modal> -</template> - -<script> - -import { postAction, getAction } from '@/api/manage' -import JDate from '@/components/jeecg/JDate' -import Tooltip from 'ant-design-vue/es/tooltip' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import JEllipsis from '@/components/jeecg/JEllipsis'//寮曞叆杩囬暱瑁佸壀 -// import PrecisionParametersDetailList from './PrecisionParametersDetailList' -import store from '@/store' - -export default { - name: "ManageObjectModal", - mixins: [JeecgListMixin], - components: { - JDate, - Tooltip, - JEllipsis, - // PrecisionParametersDetailList, - }, - data() { - return { - title: "绮惧害鍙傛暟妯℃澘", - visible: false, - model: {}, - dataSource: [], - precisionParametersDataSource: [], - disableSubmit: false, - equipmentId: "", - type: "radio", - /* 鍒嗛〉鍙傛暟 */ - ipagination: { - current: 1, - pageSize: 5, - pageSizeOptions: ['5', '10', '20', '30'], - showTotal: (total, range) => { - return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" - }, - showQuickJumper: true, - showSizeChanger: true, - total: 0 - }, - labelCol: { - xs: { span: 24 }, - sm: { span: 6 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 }, - }, - confirmLoading: false, - form: this.$form.createForm(this), - columns: [ - { - title: '#', - dataIndex: '', - key: 'rowIndex', - align: 'center', - customRender: function (t, r, index) { - return parseInt(index) + 1 - } - }, - { - title: '宸ヨ壓鍙傛暟妯℃澘缂栫爜', - align: 'center', - dataIndex: 'num', - }, - { - title: '宸ヨ壓鍙傛暟妯℃澘鍚嶇О', - align: 'center', - dataIndex: 'name', - }, - { - title: '鍒涘缓浜�', - align: "center", - dataIndex: 'createBy' - }, - { - title: '鍒涘缓鏃ユ湡', - align: "center", - dataIndex: 'createTime' - }, - { - title: '澶囨敞', - align: 'center', - dataIndex: 'remark', - }, - ], - url: { - add: '/eam/equipmentPrecisionParameters/add', - list: "/eam/precisionParametersTemplate/list", - }, - } - }, - - mounted() { - this.$bus.$on('precisionParametersDataSource', (data) => { - this.precisionParametersDataSource = data - }) - }, - - methods: { - - add() { - let that = this - this.form.resetFields(); - this.disableSubmit = false; - this.visible = true; - this.selectedRowRecord = []; - this.selectedRowKeys = []; - this.loadData(1); - this.$bus.$emit('refreshChildPage', { precisionParametersTemplateId: "-1" }); - }, - - close() { - this.$emit('close'); - this.visible = false; - }, - handleOk() { - const that = this; - if (this.precisionParametersDataSource.length == 0) { - that.$message.warning("璇烽�夋嫨鍙傛暟妯℃澘锛�"); - return - } - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - if (!err) { - that.confirmLoading = true; - - let formData = Object.assign(this.model, values); - formData.equipmentId = this.equipmentId - formData.precisionParametersList = this.precisionParametersDataSource - postAction(this.url.add, formData).then((res) => { - if (res.success) { - that.$message.success(res.message); - that.$emit('ok'); - that.alterFlag = new Date(); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - that.close(); - }) - } - }) - }, - handleCancel() { - this.close() - }, - - clickThenCheck(record) { - return { - on: { - click: (e) => { - this.selectedRowRecord = record; - this.selectedRowKeys = record.id.split(","); - this.$bus.$emit('refreshChildPage', { precisionParametersTemplateId: record.id }); - } - } - }; - }, - }, -} -</script> -<style scoped> -.ant-btn { - padding: 0 10px; - margin-left: 3px; -} - -.ant-form-item-control { - line-height: 0px; -} - -.fontweight { - font-weight: bold; -} - -/** 涓昏〃鍗曡闂磋窛 */ -.ant-form .ant-form-item { - margin-bottom: 10px; -} - -/** Tab椤甸潰琛岄棿璺� */ -.ant-tabs-content .ant-form-item { - margin-bottom: 0px; -} -.ant-table-tbody .ant-table-row td { - padding-top: 10px; - padding-bottom: 10px; -} - -.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; -} - -/deep/ .notshow { - display: none; -} - -.frozenRowClass { - color: #c9c9c9; -} -.hight { - color: #f5222d; -} -.middle { - color: #fa8c16; -} -.low { - color: #52c41a; -} -.dataUnKnow { - color: #1890ff; -} - -/deep/ .frozenRowClass { - color: #c9c9c9; -} -</style> \ No newline at end of file diff --git a/src/views/base/modules/warehouseNew/ServiceObjectList.vue b/src/views/base/modules/warehouseNew/ServiceObjectList.vue deleted file mode 100644 index f37b0a0..0000000 --- a/src/views/base/modules/warehouseNew/ServiceObjectList.vue +++ /dev/null @@ -1,260 +0,0 @@ -<template> - <a-card :bordered="false"> - <a-button - v-if="warehouseSelectionRows.length == 1" - @click="handleAdd" - type="primary" - icon="plus" - >鏂板</a-button> - - <div> - <a-table - ref="table" - size="middle" - bordered - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination=false - :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - @change="handleTableChange" - > - <template - v-for="col in columns" - :slot="col.dataIndex" - slot-scope='text, record, index' - > - <div :key="col.dataIndex"> - - <span v-if="col.dataIndex == 'remark'"> - <j-ellipsis - :value="text" - :length="10" - /> - </span> - - <a-input-number - :value="text" - v-if="col.dataIndex == 'upperLimit'" - @change="(e)=>handleChange(e, record.key, col, index)" - style="width: 100%" - /> - <a-input-number - :value="text" - v-if="col.dataIndex == 'lowerLimit'" - @change="(e)=>handleChange(e, record.key, col, index)" - style="width: 100%" - /> - <a-input-number - :value="text" - v-if="col.dataIndex == 'actualValue'" - @change="(e)=>handleChange(e, record.key, col, index)" - style="width: 100%" - /> - - <span v-if="col.dataIndex == 'action'"> - <a-button - type="primary" - @click="handleEdit(record)" - >鎻愪氦</a-button> - </span> - - </div> - </template> - - </a-table> - </div> - <manage-object-modal - ref="modalForm" - @ok="modalFormOk" - ></manage-object-modal> - </a-card> -</template> - -<script> -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import { getAction, postAction } from '@/api/manage' -import JInput from '@/components/jeecg/JInput' -import Tooltip from 'ant-design-vue/es/tooltip' -import JEllipsis from "@/components/jeecg/JEllipsis"; -import ManageObjectModal from './ManageObjectModal' - -export default { - name: "ServiceObjectList", - mixins: [JeecgListMixin], - components: { - JInput, - Tooltip, - JEllipsis, - ManageObjectModal - }, - data() { - return { - // disabled: true, - description: '璁惧绮惧害', - colorMap: {}, - // 琛ㄥご - columns: [ - { - title: '#', - dataIndex: '', - key: 'rowIndex', - width: 60, - align: "center", - customRender: function (t, r, index) { - return parseInt(index) + 1; - } - }, - { - title: '绠$悊瀵硅薄缂栫爜', - dataIndex: 'precisionParametersNum', - align: "center", - }, - { - title: '绠$悊瀵硅薄鍚嶇О', - dataIndex: 'precisionParametersName', - align: "center", - }, - { - title: '榛樿搴撳尯', - dataIndex: 'precisionParametersUnitName', - align: "center", - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - width: 100, - align: "center", - scopedSlots: { - customRender: 'action' - }, - }, - ], - url: { - list: "/eam/equipmentPrecisionParameters/list", - edit: "/eam/equipmentPrecisionParameters/edit", - }, - warehouseSelectionRows: [], - equipmentId: '', - } - }, - watch: { - equipmentId() { - this.queryParam = {}; - this.queryParam.equipmentId = this.equipmentId; - this.loadData(1); - }, - }, - mounted() { - this.$bus.$on('warehouseSelectionRows', (data) => { - this.warehouseSelectionRows = data - }) - }, - methods: { - modalFormOk() { - this.loadData(); - }, - - handleAdd: function () { - this.$refs.modalForm.add(); - this.$refs.modalForm.title = "璁惧绮惧害鍙傛暟缁戝畾"; - this.$refs.modalForm.disableSubmit = false; - this.$refs.modalForm.equipmentId = this.warehouseSelectionRows[0].id - }, - - handleEdit(record) { - this.loading = true; - if (record.actualValue === "" || record.actualValue === null) { - this.$message.warning("鍙傝�冨�间笉鑳戒负绌猴紒") - this.loading = false; - return - } - postAction(this.url.edit, record).then((res) => { - if (res.success) { - this.$message.success(res.message); - this.loadData() - } else { - this.$message.warning(res.message); - } - }).finally(() => { - this.loading = false; - }); - }, - - modalFormOk() { - this.loadData(1); - }, - - handleChange(value, key, column, index) { - let that = this; - const temp = [...that.dataSource]; - const target = temp.filter(item => key === item.key)[index]; - if (target) { - target[column.dataIndex] = value; - if ('actualValue' == column.dataIndex) { - target['actualValue'] = value; - } - if ('upperLimit' == column.dataIndex) { - target['upperLimit'] = value; - } - if ('lowerLimit' == column.dataIndex) { - target['lowerLimit'] = value; - } - //鏄剧ず甯﹁繃鏉ョ殑鏁版嵁 - that.dataSource = temp; - } - }, - - loadData(arg) { - if (!this.url.list) { - this.$message.error("璇疯缃畊rl.list灞炴��!") - return - } - if (arg === 1) { - this.ipagination.current = 1; - } - var params = this.getQueryParams();//鏌ヨ鏉′欢 - if (this.equipmentId == '') { - params.equipmentId = '-1'; - } - this.loading = true; - getAction(this.url.list, params).then((res) => { - if (res.success) { - this.dataSource = res.result.records || res.result; - if (res.result.total) { - this.ipagination.total = res.result.total; - } else { - this.ipagination.total = 0; - } - } else { - this.$message.warning(res.message) - } - }).finally(() => { - this.loading = false - }) - }, - }, - -} -</script> - -<style scoped> -@import '~@assets/less/common.less'; -/deep/ .frozenRowClass { - color: #c9c9c9; -} -.success { - color: green; -} -.error { - color: red; -} -.fontweight { - font-weight: bold; -} -.ant-card { - margin-left: -30px; - margin-right: -30px; -} -</style> \ No newline at end of file diff --git a/src/views/base/modules/warehouseNew/WarehouseAreaLocationList.vue b/src/views/base/modules/warehouseNew/WarehouseAreaLocationList.vue deleted file mode 100644 index eb648a2..0000000 --- a/src/views/base/modules/warehouseNew/WarehouseAreaLocationList.vue +++ /dev/null @@ -1,442 +0,0 @@ -<template> - <a-card :bordered="false"> - - <a-row - type="flex" - :gutter="16" - > - <a-col - :md="12" - :sm="24" - > - <div> - <a-button - v-if="warehouseSelectionRows.length == 1 " - @click="handleAdd" - type="primary" - icon="plus" - :disabled="disabledArea" - >鏂板搴撳尯</a-button> - <a-table - ref="table" - size="middle" - bordered - rowKey="id" - :columns="columnsArea" - :dataSource="dataSourceArea" - :pagination=false - :loading="loading" - @change="handleTableChange" - :customRow='clickThenSelect' - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" - > - <span - slot='action' - slot-scope='text, record' - > - <a @click='handleEdit(record)'>缂栬緫</a> - - <a-divider type='vertical' /> - <a-popconfirm - title="鍒犻櫎搴撳尯鏃跺悓鏃朵細鍒犻櫎搴撳尯涓嬬殑鎵�鏈夊簱浣嶏紒" - @confirm="() => handleDeleteArea(record.id)" - > - <a>鍒犻櫎</a> - </a-popconfirm> - </span> - - </a-table> - </div> - </a-col> - <a-col - :md="12" - :sm="24" - > - <div> - <a-button - v-if="warehouseSelectionRows.length == 1 " - @click="handleAddLocation" - type="primary" - icon="plus" - :disabled="disabledLocation" - >鏂板搴撲綅</a-button> - <a-table - ref="table" - size="middle" - bordered - rowKey="id" - :columns="columnsLocation" - :dataSource="dataSourceLocation" - :pagination=false - :loading="loading" - @change="handleTableChange" - > - - <span - slot='action' - slot-scope='text, record' - > - <a @click='handleEditLocation(record)'>缂栬緫</a> - - <a-divider type='vertical' /> - <a-popconfirm - title="纭鍒犻櫎搴撲綅鍚楋紵" - @confirm="() => handleDeleteLocation(record.id)" - > - <a>鍒犻櫎</a> - </a-popconfirm> - </span> - - </a-table> - </div> - - </a-col> - </a-row> - - <!-- 琛ㄥ崟鍖哄煙 --> - <warehouse-area-modal - ref="modalForm" - @ok="modalFormOk" - ></warehouse-area-modal> - - <warehouse-location-modal - ref="WarehouseLocationModal" - @ok="modalFormOk" - ></warehouse-location-modal> - - </a-card> -</template> - -<script> -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import { getAction, postAction, deleteAction } from '@/api/manage' -import JInput from '@/components/jeecg/JInput' -import Tooltip from 'ant-design-vue/es/tooltip' -import JEllipsis from "@/components/jeecg/JEllipsis"; - -import WarehouseAreaModal from './WarehouseAreaModal' -import WarehouseLocationModal from './WarehouseLocationModal' - -export default { - name: "WarehouseAreaLocationList", - mixins: [JeecgListMixin], - components: { - JInput, - Tooltip, - JEllipsis, - WarehouseAreaModal, - WarehouseLocationModal - }, - data() { - return { - description: '搴撳尯搴撲綅', - // 琛ㄥご - columnsArea: [ - { - title: '#', - dataIndex: '', - key: 'rowIndex', - width: 60, - align: "center", - customRender: function (t, r, index) { - return parseInt(index) + 1; - } - }, - { - title: '搴撳尯缂栫爜', - align: "center", - dataIndex: 'num', - }, - { - title: '搴撳尯鍚嶇О', - align: "center", - dataIndex: 'name', - }, - { - title: '搴撲綅鏁伴噺', - align: "center", - dataIndex: 'quantity', - }, - { - title: '鎿嶄綔', - align: "center", - dataIndex: 'action', - scopedSlots: { - customRender: 'action' - }, - width: 100, - }, - ], - columnsLocation: [ - { - title: '#', - dataIndex: '', - key: 'rowIndex', - width: 60, - align: "center", - customRender: function (t, r, index) { - return parseInt(index) + 1; - } - }, - { - title: '搴撲綅缂栫爜', - align: "center", - dataIndex: 'num', - }, - { - title: '琛屽彿', - align: "center", - dataIndex: 'xnum', - }, - { - title: '鍒楀彿', - align: "center", - dataIndex: 'ynum', - }, - { - title: '灞傚彿', - align: "center", - dataIndex: 'znum', - }, - { - title: '鎿嶄綔', - align: "center", - dataIndex: 'action', - scopedSlots: { - customRender: 'action' - }, - width: 100, - }, - ], - url: { - list: "/base/warehouseArea/list", - find: "/base/warehouseLocation/list", - delete: "/base/warehouseArea/delete", - deleteLocation: "/base/warehouseLocation/delete", - - }, - warehouseSelectionRows: [], - warehouseId: '', - warehouseAreaId: '', - dataSourceLocation: [], - dataSourceArea: [], - disabledArea: true, - disabledLocation: true, - } - }, - watch: { - warehouseId() { - this.selectedRowKeys = []; - this.selectionRows = []; - this.queryParam = {}; - this.warehouseAreaId = ''; - this.queryParam.warehouseId = this.warehouseId; - this.loadData(1); - this.loadData2(1); - }, - }, - mounted() { - this.$bus.$on('warehouseSelectionRows', (data) => { - this.warehouseSelectionRows = data - if (data.length == 1) { - if (data[0].locationManage == '2' || data[0].locationManage == '4') { - this.disabledArea = false; - } else { - this.disabledArea = true; - } - if (data[0].locationManage == '3' || data[0].locationManage == '4') { - this.disabledLocation = false; - } else { - this.disabledLocation = true; - } - } else { - this.disabledLocation = true; - this.disabledArea = true; - } - }) - }, - methods: { - - handleAdd: function () { - this.$refs.modalForm.add(); - this.$refs.modalForm.title = "缁戝畾搴撳尯"; - this.$refs.modalForm.disableSubmit = false; - this.$refs.modalForm.warehouseId = this.warehouseSelectionRows[0].id - }, - - handleAddLocation: function () { - if (this.warehouseSelectionRows.length == 1) { - if (this.warehouseSelectionRows[0].locationManage == '4') { - if (this.warehouseAreaId === '') { - this.$message.warning("璇烽�夋嫨搴撳尯锛�") - return - } - } - } - this.$refs.WarehouseLocationModal.add(); - this.$refs.WarehouseLocationModal.title = "缁戝畾搴撲綅"; - this.$refs.WarehouseLocationModal.disableSubmit = false; - this.$refs.WarehouseLocationModal.warehouseId = this.warehouseSelectionRows[0].id - this.$refs.WarehouseLocationModal.warehouseAreaId = this.warehouseAreaId - }, - - modalFormOk() { - this.loadData(1); - this.loadData2(1) - }, - - handleEdit: function (record) { - this.$refs.modalForm.edit(record) - this.$refs.modalForm.title = '缂栬緫' - this.$refs.modalForm.disableSubmit = false - }, - handleEditLocation: function (record) { - this.$refs.WarehouseLocationModal.edit(record) - this.$refs.WarehouseLocationModal.title = '缂栬緫' - this.$refs.WarehouseLocationModal.disableSubmit = false - }, - - clickThenSelect(record) { - return { - on: { - click: () => { - this.onSelectChange(record.id.split(','), [record]) - } - } - } - }, - onSelectChange(selectedRowKeys, selectionRows) { - if (selectedRowKeys.length == 1) { - this.warehouseAreaId = selectionRows[0]['id'] - this.loadData2(1) - } else { - // this.warehouseAreaId = '' - } - this.selectedRowKeys = selectedRowKeys - this.selectionRows = selectionRows - }, - - handleDeleteLocation: function (id) { - if (!this.url.deleteLocation) { - this.$message.error('璇疯缃畊rl.delete灞炴��!') - return - } - var that = this - deleteAction(that.url.deleteLocation, { id: id }).then(res => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(1) - that.$message.success(res.message) - that.loadData2(1) - } else { - that.$message.warning(res.message) - } - }) - }, - - handleDeleteArea: function (id) { - if (!this.url.delete) { - this.$message.error('璇疯缃畊rl.delete灞炴��!') - return - } - var that = this - deleteAction(that.url.delete, { id: id }).then(res => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(1) - that.$message.success(res.message) - that.loadData(1) - that.loadData2(1) - } else { - that.$message.warning(res.message) - } - }) - }, - - loadData(arg) { - if (arg === 1) { - this.ipagination.current = 1; - } - // var params = this.getQueryParams();//鏌ヨ鏉′欢 - var params = this.queryParam - params.pageNo = this.ipagination.current - params.pageSize = this.ipagination.pageSize - if (this.warehouseId == '') { - params.warehouseId = '-1'; - } - this.loading = true; - getAction(this.url.list, params).then((res) => { - if (res.success) { - this.dataSourceArea = res.result.records || res.result; - if (res.result.total) { - this.ipagination.total = res.result.total; - } else { - this.ipagination.total = 0; - } - } else { - this.$message.warning(res.message) - } - }).finally(() => { - this.loading = false - }) - }, - - loadData2(arg) { - if (arg === 1) { - this.ipagination.current = 1; - } - // var params = this.getQueryParams();//鏌ヨ鏉′欢 - var params = this.queryParam - params.pageNo = this.ipagination.current - params.pageSize = this.ipagination.pageSize - if (this.warehouseId == '') { - params.warehouseId = '-1'; - } - if (this.warehouseAreaId != '') { - params.warehouseAreaId = this.warehouseAreaId - // params.warehouseAreaId = '-1'; - } - this.loading = true; - getAction(this.url.find, params).then((res) => { - if (res.success) { - this.dataSourceLocation = res.result.records || res.result; - if (res.result.total) { - this.ipagination.total = res.result.total; - } else { - this.ipagination.total = 0; - } - } else { - this.$message.warning(res.message) - } - }).finally(() => { - this.loading = false - }) - }, - - }, -} -</script> - -<style lang="less" scoped> -@import '~@assets/less/common.less'; -/deep/ .frozenRowClass { - color: #c9c9c9; -} -.success { - color: green; -} -.error { - color: red; -} -.fontweight { - font-weight: bold; -} -.fontweightGreen { - font-weight: bold; - color: green; -} -.ant-card { - margin-left: -30px; - margin-right: -30px; -} -</style> \ No newline at end of file diff --git a/src/views/base/modules/warehouseNew/WarehouseAreaModal.vue b/src/views/base/modules/warehouseNew/WarehouseAreaModal.vue deleted file mode 100644 index 29a847f..0000000 --- a/src/views/base/modules/warehouseNew/WarehouseAreaModal.vue +++ /dev/null @@ -1,263 +0,0 @@ -<template> - <a-modal - :title="title" - :width="650" - :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:4}" - :wrapperCol="{span:18}" - label="搴撳尯缂栫爜" - > - <a-input - :disabled="disableSubmit" - placeholder="璇疯緭鍏ュ簱鍖虹紪鐮�" - v-decorator="['num', validatorRules.num ]" - /> - </a-form-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="24"> - <a-form-item - :labelCol="{span:4}" - :wrapperCol="{span:18}" - label="搴撳尯鍚嶇О" - > - <a-input - :disabled="disableSubmit" - placeholder="璇疯緭鍏ュ簱鍖哄悕绉�" - v-decorator="['name', validatorRules.name ]" - /> - </a-form-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="24"> - <a-form-item - :labelCol="{span:4}" - :wrapperCol="{span:18}" - label="搴撲綅鏁伴噺" - > - <a-input-number - :max="20" - style="width: 100%" - :disabled="disableSubmit" - placeholder="璇疯緭鍏ュ簱浣嶆暟閲�" - v-decorator="['quantity', validatorRules.quantity ]" - /> - </a-form-item> - </a-col> - </a-row> - - </a-form> - </a-spin> - - </a-modal> -</template> - -<script> - -import { postAction, getAction, requestPut } from '@/api/manage' -import JDate from '@/components/jeecg/JDate' -import Tooltip from 'ant-design-vue/es/tooltip' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import JEllipsis from '@/components/jeecg/JEllipsis'//寮曞叆杩囬暱瑁佸壀 -import store from '@/store' -import pick from 'lodash.pick' - -export default { - name: "WarehouseAreaModal", - mixins: [JeecgListMixin], - components: { - JDate, - Tooltip, - JEllipsis, - }, - data() { - return { - title: "浠撳簱搴撳尯", - visible: false, - model: {}, - dataSource: [], - disableSubmit: false, - warehouseId: "", - validatorRules: { - num: { - rules: [ - { required: true, message: '璇疯緭鍏ュ簱鍖虹紪鍙凤紒' }, - ] - }, - name: { - rules: [ - { required: true, message: '璇疯緭鍏ュ簱鍖哄悕绉帮紒' }, - ] - }, - quantity: { - rules: [ - { required: true, message: '璇疯緭鍏ュ簱浣嶆暟閲忥紒' }, - ] - }, - }, - labelCol: { - xs: { span: 24 }, - sm: { span: 6 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 }, - }, - confirmLoading: false, - form: this.$form.createForm(this), - url: { - add: '/base/warehouseArea/add', - edit: '/base/warehouseArea/edit', - }, - } - }, - - - methods: { - - add() { - this.edit({}); - }, - - edit(record) { - this.form.resetFields(); - this.model = Object.assign({}, record); - this.visible = true; - this.disableSubmit = false; - this.$nextTick(() => { - this.form.setFieldsValue(pick(this.model, - 'num', - 'name', - 'quantity', - 'remark')); - }); - }, - - close() { - this.$emit('close'); - this.visible = false; - }, - handleOk() { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - if (!err) { - that.confirmLoading = true; - let formData = Object.assign(this.model, values); - let obj; - if (!this.model.id) { - formData.warehouseId = this.warehouseId - 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(res.message); - that.$emit('ok'); - that.alterFlag = new Date(); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - that.close(); - }) - } - }) - }, - handleCancel() { - this.close() - }, - - - }, -} -</script> -<style scoped> -.ant-btn { - padding: 0 10px; - margin-left: 3px; -} - -.ant-form-item-control { - line-height: 0px; -} - -.fontweight { - font-weight: bold; -} - -/** 涓昏〃鍗曡闂磋窛 */ -.ant-form .ant-form-item { - margin-bottom: 10px; -} - -/** Tab椤甸潰琛岄棿璺� */ -.ant-tabs-content .ant-form-item { - margin-bottom: 0px; -} -.ant-table-tbody .ant-table-row td { - padding-top: 10px; - padding-bottom: 10px; -} - -.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; -} - -/deep/ .notshow { - display: none; -} - -.frozenRowClass { - color: #c9c9c9; -} -.hight { - color: #f5222d; -} -.middle { - color: #fa8c16; -} -.low { - color: #52c41a; -} -.dataUnKnow { - color: #1890ff; -} - -/deep/ .frozenRowClass { - color: #c9c9c9; -} -</style> \ No newline at end of file diff --git a/src/views/base/modules/warehouseNew/WarehouseLocationModal.vue b/src/views/base/modules/warehouseNew/WarehouseLocationModal.vue deleted file mode 100644 index cd7c4e4..0000000 --- a/src/views/base/modules/warehouseNew/WarehouseLocationModal.vue +++ /dev/null @@ -1,288 +0,0 @@ -<template> - <a-modal - :title="title" - :width="650" - :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:4}" - :wrapperCol="{span:18}" - label="搴撲綅缂栧彿" - > - <a-input - style="width: 100%" - :disabled="disableSubmit" - placeholder="璇疯緭鍏ュ簱浣嶇紪鍙�" - v-decorator="['num', validatorRules.num ]" - /> - </a-form-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="24"> - <a-form-item - :labelCol="{span:4}" - :wrapperCol="{span:18}" - label="琛屽彿" - > - <a-input-number - style="width: 100%" - :disabled="disableSubmit" - placeholder="璇疯緭鍏ヨ鍙�" - v-decorator="['xnum', validatorRules.xnum ]" - /> - </a-form-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="24"> - <a-form-item - :labelCol="{span:4}" - :wrapperCol="{span:18}" - label="鍒楀彿" - > - <a-input-number - style="width: 100%" - :disabled="disableSubmit" - placeholder="璇疯緭鍏ュ垪鍙�" - v-decorator="['ynum', validatorRules.ynum ]" - /> - </a-form-item> - </a-col> - </a-row> - <a-row :gutter="24"> - <a-col :span="24"> - <a-form-item - :labelCol="{span:4}" - :wrapperCol="{span:18}" - label="灞傚彿" - > - <a-input-number - style="width: 100%" - :disabled="disableSubmit" - placeholder="璇疯緭鍏ュ眰鍙�" - v-decorator="['znum', validatorRules.znum ]" - /> - </a-form-item> - </a-col> - </a-row> - - </a-form> - </a-spin> - - </a-modal> -</template> - -<script> - -import { postAction, getAction, requestPut } from '@/api/manage' -import JDate from '@/components/jeecg/JDate' -import Tooltip from 'ant-design-vue/es/tooltip' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import JEllipsis from '@/components/jeecg/JEllipsis'//寮曞叆杩囬暱瑁佸壀 -import store from '@/store' -import pick from 'lodash.pick' - -export default { - name: "WarehouseLocationModal", - mixins: [JeecgListMixin], - components: { - JDate, - Tooltip, - JEllipsis, - }, - data() { - return { - title: "浠撳簱搴撲綅", - visible: false, - model: {}, - dataSource: [], - disableSubmit: false, - warehouseId: "", - warehouseAreaId: "", - validatorRules: { - num: { - rules: [ - { required: true, message: '璇疯緭鍏ュ簱浣嶇紪鍙凤紒' }, - ] - }, - xnum: { - rules: [ - { required: true, message: '璇疯緭鍏ヨ鍙凤紒' }, - ] - }, - ynum: { - rules: [ - { required: true, message: '璇疯緭鍏ュ垪鍙凤紒' }, - ] - }, - znum: { - rules: [ - { required: true, message: '璇疯緭鍏ュ眰鍙凤紒' }, - ] - }, - }, - labelCol: { - xs: { span: 24 }, - sm: { span: 6 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 }, - }, - confirmLoading: false, - form: this.$form.createForm(this), - url: { - add: '/base/warehouseLocation/add', - edit: '/base/warehouseLocation/edit', - }, - } - }, - - - methods: { - - add() { - this.edit({}); - }, - - edit(record) { - this.form.resetFields(); - this.model = Object.assign({}, record); - this.visible = true; - this.disableSubmit = false; - this.$nextTick(() => { - this.form.setFieldsValue(pick(this.model, - 'num', - 'xnum', - 'ynum', - 'znum', - 'remark')); - }); - }, - - close() { - this.$emit('close'); - this.visible = false; - }, - handleOk() { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - if (!err) { - that.confirmLoading = true; - let formData = Object.assign(this.model, values); - let obj; - if (!this.model.id) { - formData.warehouseId = this.warehouseId - formData.warehouseAreaId = this.warehouseAreaId - 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(res.message); - that.$emit('ok'); - that.alterFlag = new Date(); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - that.close(); - }) - } - }) - }, - handleCancel() { - this.close() - }, - - - }, -} -</script> -<style scoped> -.ant-btn { - padding: 0 10px; - margin-left: 3px; -} - -.ant-form-item-control { - line-height: 0px; -} - -.fontweight { - font-weight: bold; -} - -/** 涓昏〃鍗曡闂磋窛 */ -.ant-form .ant-form-item { - margin-bottom: 10px; -} - -/** Tab椤甸潰琛岄棿璺� */ -.ant-tabs-content .ant-form-item { - margin-bottom: 0px; -} -.ant-table-tbody .ant-table-row td { - padding-top: 10px; - padding-bottom: 10px; -} - -.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; -} - -/deep/ .notshow { - display: none; -} - -.frozenRowClass { - color: #c9c9c9; -} -.hight { - color: #f5222d; -} -.middle { - color: #fa8c16; -} -.low { - color: #52c41a; -} -.dataUnKnow { - color: #1890ff; -} - -/deep/ .frozenRowClass { - color: #c9c9c9; -} -</style> \ No newline at end of file diff --git a/src/views/base/modules/warehouseNew/WarehouseModal.vue b/src/views/base/modules/warehouseNew/WarehouseModal.vue deleted file mode 100644 index 3159509..0000000 --- a/src/views/base/modules/warehouseNew/WarehouseModal.vue +++ /dev/null @@ -1,354 +0,0 @@ -<template> - <a-modal - :title="title" - :width="1000" - :visible="visible" - :maskClosable="false" - :confirmLoading="confirmLoading" - :okButtonProps="{ props: {disabled: disableSubmit} }" - @ok="handleOk" - @cancel="handleCancel" - cancelText="鍏抽棴" - > - <a-spin :spinning="confirmLoading"> - <a-form :form="form"> - <a-row style="width: 100%"> - <a-col :span="24 / 2 "> - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="浠撳簱缂栫爜" - > - <a-input - placeholder="灏嗙敱绯荤粺鐢熸垚" - v-decorator="['code', validatorRules.code]" - /> - </a-form-item> - </a-col> - <a-col :span="24 / 2"> - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="浠撳簱鍚嶇О" - > - <a-input - placeholder="璇疯緭鍏ヤ粨搴撳悕绉�" - v-decorator="['name', validatorRules.name]" - /> - </a-form-item> - </a-col> - </a-row> - <a-row style="width: 100%"> - <a-col :span="24 / 2 "> - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="浠撳簱绫诲瀷" - > - <j-dict-select-tag - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇烽�夋嫨浠撳簱绫诲瀷'" - :triggerChange="true" - dictCode="warehouse_type" - v-decorator="['type', validatorRules.type]" - /> - </a-form-item> - </a-col> - <a-col :span="24 / 2"> - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鏄惁搴熷搧搴�" - > - <j-dict-select-tag - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇烽�夋嫨鏄惁搴熷搧搴�'" - :triggerChange="true" - dictCode="whether_waste_warehouse" - v-decorator="['whetherWasteWarehouse', validatorRules.whetherWasteWarehouse]" - /> - </a-form-item> - </a-col> - </a-row> - <a-row style="width: 100%"> - <a-col :span="24 / 2"> - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="搴撳尯搴撲綅绠$悊" - > - <j-dict-select-tag - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇烽�夊簱鍖哄簱浣嶇鐞�'" - :triggerChange="true" - dictCode="location_manage" - v-decorator="['locationManage', validatorRules.locationManage]" - /> - </a-form-item> - </a-col> - <a-col :span="24 / 2"> - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鏈嶅姟瀵硅薄绫诲瀷" - > - <j-dict-select-tag - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇烽�夋嫨鏈嶅姟瀵硅薄绫诲瀷'" - :triggerChange="true" - dictCode="service_object" - v-decorator="['serviceObject', validatorRules.serviceObject]" - /> - </a-form-item> - </a-col> - </a-row> - <a-row style="width: 100%"> - <a-col :span="24 / 2 "> - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鑷姩鍖�" - > - <j-dict-select-tag - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇烽�夋嫨鏄惁鑷姩鍖�'" - :triggerChange="true" - dictCode="whether_automation_warehouse" - v-decorator="['whetherAutomationWarehouse', validatorRules.whetherAutomationWarehouse]" - /> - </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 - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇疯緭鍏ュ娉�'" - v-decorator="['remark', validatorRules.remark]" - /> - </a-form-item> - </a-col> - </a-row> - - </a-form> - </a-spin> - - <template slot="footer"> - <a-button - :style="{marginRight: '8px'}" - @click="handleCancel" - > - 鍏抽棴 - </a-button> - <!-- <a-button - v-if="!this.model.id" - :disabled="disableSubmit || confirmLoading" - :loading="confirmLoading" - @click="handleOkAndAdd" - type="primary" - >淇濆瓨骞剁户缁柊澧�</a-button> --> - <a-button - :disabled="disableSubmit || confirmLoading" - :loading="confirmLoading" - @click="handleOk" - type="primary" - >纭畾</a-button> - </template> - - </a-modal> -</template> - -<script> -import pick from 'lodash.pick' -import { postAction, requestPut, getAction } from '@/api/manage' -import { duplicateCheck } from '@/api/api' -import moment from 'moment' -import JImageUpload from '@/components/jeecg/JImage2Upload' -import Vue from 'vue' - -export default { - name: 'WarehouseModal', - components: { - JImageUpload - }, - data() { - return { - title: "鎿嶄綔", - visible: false, - codeDisable: true, - disableSubmit: false, - model: {}, - headers: {}, - labelCol: { - xs: { span: 24 }, - sm: { span: 6 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 }, - }, - confirmLoading: false, - form: this.$form.createForm(this), - validatorRules: { - code: { - rules: [ - { required: true, message: '璇疯緭鍏ヤ粨搴撶紪鍙�!' }, - ] - }, - name: { - rules: [ - { required: true, message: '璇疯緭鍏ヤ粨搴撳悕绉�!' }, - ] - }, - type: { - rules: [ - { required: true, message: '璇烽�夋嫨浠撳簱绫诲瀷!' }, - ] - }, - whetherWasteWarehouse: { - rules: [ - { required: true, message: '璇烽�夋嫨鏄惁搴熷搧搴�!' }, - ] - }, - locationManage: { - rules: [ - { required: true, message: '璇烽�夋嫨搴撲綅搴撳尯绠$悊!' }, - ] - }, - whetherAutomationWarehouse: { - rules: [ - { required: true, message: '璇烽�夋嫨鏄惁鑷姩鍖栧簱!' }, - ] - }, - serviceObject: { - rules: [ - { required: true, message: '璇烽�夋嫨鏈嶅姟瀵硅薄!' }, - ] - }, - remark: { - rules: [ - { min: 0, max: 100, message: '闀垮害涓嶈秴杩� 100 涓瓧绗�', trigger: 'blur' }, - ] - } - }, - url: { - add: "/base/warehouse/addWarehouse", - edit: "/base/warehouse/edit", - }, - //鏂板銆佺紪杈戙�佸垹闄ゃ�佹壒閲忓垹闄ゆ搷浣滄敼鍙樻暟鎹悗鍒锋柊鍏宠仈鐨勭粍浠剁殑鐩戝惉灞炴�� - alterFlag: "", - } - }, - created() { - - }, - methods: { - moment, - - add() { - this.edit({}); - }, - - edit(record) { - this.form.resetFields(); - this.model = Object.assign({}, record); - this.visible = true; - this.disableSubmit = false; - this.fileList = []; - this.$nextTick(() => { - this.form.setFieldsValue(pick(this.model, - 'code', - 'name', - 'type', - 'whetherWasteWarehouse', - 'locationManage', - 'whetherAutomationWarehouse', - 'serviceObject', - 'remark')); - }); - if (record.id) { - this.codeDisable = true; - } else { - this.codeDisable = false; - } - }, - - close() { - this.$emit('close'); - this.visible = false; - }, - - handleOk() { - const that = this; - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - if (!err) { - that.confirmLoading = true; - let formData = Object.assign(this.model, values); - - 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(res.message); - that.$emit('ok'); - that.alterFlag = new Date(); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - that.close(); - }) - } - }) - }, - - handleCancel() { - this.close() - }, - - }, - watch: { - // alterFlag() { - // this.$bus.$emit('queryTreeData'); - // }, - } -} -</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> \ No newline at end of file diff --git a/src/views/eam/equipment/EamEquipmentLedger.vue b/src/views/eam/equipment/EamEquipmentLedger.vue index e7af665..589f207 100644 --- a/src/views/eam/equipment/EamEquipmentLedger.vue +++ b/src/views/eam/equipment/EamEquipmentLedger.vue @@ -5,6 +5,12 @@ <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍏抽敭璁惧鏍囪瘑"> + <j-dict-select-tag dict-code="equipment_importance" placeholder="璇烽�夋嫨鍏抽敭璁惧鏍囪瘑" + v-model="queryParam.equipmentImportance"/> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="璁惧缂栧彿"> <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentCode"></a-input> </a-form-item> @@ -14,39 +20,31 @@ <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="queryParam.equipmentName"></a-input> </a-form-item> </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="绠$悊鍒嗙被"> - <j-dict-select-tag dict-code="equipment_abc_flag" placeholder="璇烽�夋嫨绠$悊鍒嗙被" - v-model="queryParam.equipmentImportance"></j-dict-select-tag> - </a-form-item> - </a-col> <template v-if="toggleSearchStatus"> <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="璧勪骇鐘舵��"> - <j-dict-select-tag dict-code="asset_status" placeholder="璇烽�夋嫨璧勪骇鐘舵��" - v-model="queryParam.assetStatus"></j-dict-select-tag> + <a-form-item label="鎵�灞炲垎绫�"> + <j-dict-select-tag dict-code="equipment_category" placeholder="璇烽�夋嫨璁惧鎵�灞炲垎绫�" + v-model="queryParam.equipmentCategory"/> </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="璁惧绫诲埆"> - <j-dict-select-tag dict-code="equipment_category" placeholder="璇烽�夋嫨璁惧绫诲埆" - v-model="queryParam.equipmentCategory"></j-dict-select-tag> - </a-form-item> - </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="浣跨敤杞﹂棿"> - <a-tree-select v-model="queryParam.orgId" - style="width: 100%" - :tree-data="treeDataAlias" - :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" - placeholder="璇烽�夋嫨浣跨敤杞﹂棿" - allow-clear - tree-default-expand-all + <a-form-item label="浣跨敤閮ㄩ棬"> + <a-tree-select v-model="queryParam.orgId" style="width: 100%" :tree-data="treeDataAlias" show-search + treeNodeFilterProp="title" searchPlaceholder="璇疯緭鍏ュ叧閿瓧鎼滅储" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" placeholder="璇烽�夋嫨浣跨敤閮ㄩ棬" + allow-clear tree-default-expand-all > </a-tree-select> </a-form-item> </a-col> - + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="缁翠慨鐝粍"> + <a-tree-select v-model="queryParam.orgId" style="width: 100%" :tree-data="treeDataAlias" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" placeholder="璇烽�夋嫨缁翠慨鐝粍" + allow-clear tree-default-expand-all> + </a-tree-select> + </a-form-item> + </a-col> </template> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> @@ -74,7 +72,7 @@ <a-button type="primary" icon="download" @click="handleTemplateXlsDownload">瀵煎叆妯℃澘涓嬭浇</a-button> <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay"> - <a-menu-item key="2" @click="batchDel" v-if="isShowAuth('eam:equipment:delete')"> + <a-menu-item key="2" @click="batchDel"> <a-icon type="delete"/> 鍒犻櫎 </a-menu-item> @@ -106,12 +104,10 @@ @change="handleTableChange" :customRow="customTableRow" > - <span slot="processParametersFlag" slot-scope="text"> - <lx-switch v-model="text" disabled checked-children="鏈�" un-checked-children="鏃�"/> - </span> - <span slot="precisionParametersFlag" slot-scope="text"> - <lx-switch v-model="text" disabled checked-children="鏈�" un-checked-children="鏃�"/> - </span> + <template slot="equipmentCode" slot-scope="text"> + <a href="#" @click="handleDetail(record)" style="display: inline-block;height: 100%">{{text}}</a> + </template> + <span slot="action" slot-scope="text, record"> <a @click.stop="handleEdit(record)">缂栬緫</a> @@ -125,7 +121,7 @@ <a-menu-item> <a href="javascript:;" @click="handleDetail(record)">璇︽儏</a> </a-menu-item> - <a-menu-item v-if="isShowAuth('eam:equipment:delete')"> + <a-menu-item> <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> <a>鍒犻櫎</a> </a-popconfirm> @@ -138,51 +134,44 @@ </div> <!-- table鍖哄煙-end --> - <a-tabs v-model="activeTabKey" @change="handleTabChange"> - <a-tab-pane tab="璁惧鏂囨。" :key="1"> - <eam-equipment-attachment-list ref="tabPaneTableListRef1"/> - </a-tab-pane> - <a-tab-pane tab="鐐规宸ュ崟" :key="2"> - <eam-inspection-order-list ref="tabPaneTableListRef2" :isDisplayOperation="false"/> - </a-tab-pane> - <a-tab-pane tab="浜屼繚宸ュ崟" :key="3"> - <eam-second-maintenance-order-list ref="tabPaneTableListRef3" :isDisplayOperation="false"/> - </a-tab-pane> - <a-tab-pane tab="涓変繚宸ュ崟" :key="4"> - <eam-third-maintenance-order-list ref="tabPaneTableListRef4" :isDisplayOperation="false"/> - </a-tab-pane> - <a-tab-pane tab="缁翠慨宸ュ崟" :key="5"> - <eam-repair-order-list ref="tabPaneTableListRef5" :isDisplayOperation="false"/> - </a-tab-pane> - <a-tab-pane tab="淇濆吇鏍囧噯" :key="6"> - <eam-maintenance-standard-list ref="tabPaneTableListRef6" :isDisplayOperation="false"/> - </a-tab-pane> - <a-tab-pane tab="宸ヨ壓鍙傛暟" :key="7" v-if="isOpenProcess"> - <eam-equipment-process-list ref="tabPaneTableListRef7" :isDisplayOperation="false"/> - </a-tab-pane> - <a-tab-pane tab="璁惧绮惧害" :key="8" v-if="isOpenPrecision"> - <eam-equipment-precision-list ref="tabPaneTableListRef8" :isDisplayOperation="false"/> - </a-tab-pane> - <a-tab-pane tab="璁惧娌规恫" :key="9"> - <eam-equipment-fluid-list ref="tabPaneTableListRef9" :isDisplayOperation="false"/> - </a-tab-pane> - </a-tabs> + <!--<a-tabs v-model="activeTabKey" @change="handleTabChange">--> + <!--<a-tab-pane tab="璁惧鏂囨。" :key="1">--> + <!--<eam-equipment-attachment-list ref="tabPaneTableListRef1"/>--> + <!--</a-tab-pane>--> + <!--<a-tab-pane tab="鐐规宸ュ崟" :key="2">--> + <!--<eam-inspection-order-list ref="tabPaneTableListRef2" :isDisplayOperation="false"/>--> + <!--</a-tab-pane>--> + <!--<a-tab-pane tab="浜屼繚宸ュ崟" :key="3">--> + <!--<eam-second-maintenance-order-list ref="tabPaneTableListRef3" :isDisplayOperation="false"/>--> + <!--</a-tab-pane>--> + <!--<a-tab-pane tab="涓変繚宸ュ崟" :key="4">--> + <!--<eam-third-maintenance-order-list ref="tabPaneTableListRef4" :isDisplayOperation="false"/>--> + <!--</a-tab-pane>--> + <!--<a-tab-pane tab="缁翠慨宸ュ崟" :key="5">--> + <!--<eam-repair-order-list ref="tabPaneTableListRef5" :isDisplayOperation="false"/>--> + <!--</a-tab-pane>--> + <!--<a-tab-pane tab="淇濆吇鏍囧噯" :key="6">--> + <!--<eam-maintenance-standard-list ref="tabPaneTableListRef6" :isDisplayOperation="false"/>--> + <!--</a-tab-pane>--> + <!--<a-tab-pane tab="宸ヨ壓鍙傛暟" :key="7" v-if="isOpenProcess">--> + <!--<eam-equipment-process-list ref="tabPaneTableListRef7" :isDisplayOperation="false"/>--> + <!--</a-tab-pane>--> + <!--<a-tab-pane tab="璁惧绮惧害" :key="8" v-if="isOpenPrecision">--> + <!--<eam-equipment-precision-list ref="tabPaneTableListRef8" :isDisplayOperation="false"/>--> + <!--</a-tab-pane>--> + <!--</a-tabs>--> <!-- 琛ㄥ崟鍖哄煙 --> - <eamEquipment-modal ref="modalForm" @ok="modalFormOk"></eamEquipment-modal> - <!--閾墝寮圭獥--> - <nameplate-modal ref="nameplateModalRef" :printedRows="printedRows"/> + <eamEquipment-modal ref="modalForm" @ok="modalFormOk" :treeDataAlias="treeDataAlias"/> <!--灞ュ巻寮圭獥--> <resume-drawer ref="resumeDrawerRef" :currentTableRowRecord="currentTableRowRecord"/> </a-card> </template> <script> - import '@/assets/less/TableExpand.less' import EamEquipmentModal from './modules/EamEquipmentModal.vue' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { getAction, templateXlsDownload } from '@api/manage' - import NameplateModal from '@views/eam/equipment/modules/NameplateModal.vue' import { getSystemConfigValue } from '@api/api' import ResumeDrawer from '@views/eam/equipment/modules/ResumeDrawer.vue' import EamMaintenanceStandardList from '@views/eam/base/EamMaintenanceStandardList.vue' @@ -193,7 +182,6 @@ import EamEquipmentPrecisionList from '@views/eam/equipment/modules/EamEquipmentPrecisionList.vue' import EamSecondMaintenanceOrderList from '@views/eam/maintenance/EamSecondMaintenanceOrderList.vue' import EamThirdMaintenanceOrderList from '@views/eam/maintenance/EamThirdMaintenanceOrderList.vue' - import EamEquipmentFluidList from '@views/eam/equipment/modules/EamEquipmentFluidList.vue' export default { name: 'EquipmentLedger', @@ -203,14 +191,12 @@ EamRepairOrderList, EamMaintenanceStandardList, ResumeDrawer, - NameplateModal, EamEquipmentModal, EamEquipmentAttachmentList, EamEquipmentProcessList, EamEquipmentPrecisionList, EamSecondMaintenanceOrderList, - EamThirdMaintenanceOrderList, - EamEquipmentFluidList + EamThirdMaintenanceOrderList }, data() { return { @@ -232,7 +218,7 @@ title: '鍏抽敭璁惧鏍囪瘑', align: 'center', width: 150, - dataIndex: 'equipmentCode', + dataIndex: 'equipmentImportance', fixed: 'left' }, { @@ -240,6 +226,7 @@ align: 'center', width: 100, dataIndex: 'equipmentCode', + scopedSlots: { customRender: 'equipmentCode' }, ellipsis: true, fixed: 'left', sorter: true @@ -247,7 +234,6 @@ { title: '璁惧鍚嶇О', align: 'center', - width: 100, dataIndex: 'equipmentName', ellipsis: true, fixed: 'left' @@ -255,233 +241,220 @@ { title: '浣跨敤閮ㄩ棬', align: 'center', - width: 120, - dataIndex: 'equipmentImportance_dictText' - }, - { - title: '涓績', - align: 'center', - width: 100, - dataIndex: 'technologyStatus_dictText' - }, - { - title: '宸ュ尯', - align: 'center', - width: 100, - dataIndex: 'technologyStatus_dictText' - }, - { - title: '宸ユ', - align: 'center', - width: 100, - dataIndex: 'technologyStatus_dictText' + dataIndex: 'factoryOrgCode' }, { title: '鎵�灞炲垎绫�', align: 'center', width: 100, - dataIndex: 'technologyStatus_dictText' + dataIndex: 'equipmentCategory' }, { - title: '璁惧鐘舵��', + title: '淇濆吇鐘舵��', align: 'center', width: 100, - dataIndex: 'technologyStatus_dictText' + dataIndex: 'maintenanceStatus_dicText' + }, + { + title: '缁翠慨鐘舵��', + align: 'center', + width: 100, + dataIndex: 'repairStatus_dicText' + }, + { + title: '鎶�鏈姸鎬�', + align: 'center', + width: 100, + dataIndex: 'technologyStatus_dicText' }, { title: 'ABC鏍囪瘑', align: 'center', width: 100, - dataIndex: 'technologyStatus_dictText' - }, - { - title: '缁存姢閮ㄩ棬', - align: 'center', - width: 100, - dataIndex: 'technologyStatus_dictText' + dataIndex: 'abcFlag' }, { title: '缁翠慨鐝粍', align: 'center', width: 100, - dataIndex: 'assetStatus_dictText' + dataIndex: 'repairDepartOrgCode' }, { title: '瀹夊叏閰嶇疆', align: 'center', width: 100, - dataIndex: 'repairStatus_dictText' + dataIndex: 'securityConfiguration' }, { title: '鍐峰嵈绯荤粺', align: 'center', width: 100, - dataIndex: 'maintenanceStatus_dictText' + dataIndex: 'coolSystem' }, { title: '鐏伀鍣�', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'fireExtinguisher' }, { title: '鐏伀鍣ㄦ湁鏁堟湡', align: 'center', width: 150, - dataIndex: 'orgId_dictText' + dataIndex: 'fireExtinguisherExpirationDate' }, { title: '鎿嶄綔绯荤粺', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'operationSystem' }, { title: '绯荤粺', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'system' }, { title: '璁惧绔彛', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'equipmentPort' }, { title: '鍧愭爣鏁伴噺', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'coordinateNum' }, { title: '閲嶉噺', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'equipmentWeight' }, { title: '閲嶉噺璁¢噺鍗曚綅', align: 'center', width: 150, - dataIndex: 'orgId_dictText' + dataIndex: 'weightUnit' }, { title: '鍔熻兘浣嶇疆', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'functionalLocation' }, { title: '瀹夎浣嶇疆', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'installationPosition' }, { title: '鍑哄巶鏃ユ湡', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'leaveFactoryDate' }, { title: '绔嬮」鍗″彿', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'cardNumber' }, { title: '璧勯噾鏉ユ簮', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'fundingSource' }, { title: '楠屾敹鏃ユ湡', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'acceptanceCheckDate' }, { title: '鍑哄巶缂栧彿', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'factoryNumber' }, { title: '璧勪骇鍒堕�犲晢', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'manufacturingEnterprise' }, { title: '璧勪骇鏉ユ簮鍥藉', align: 'center', width: 150, - dataIndex: 'orgId_dictText' + dataIndex: 'originCountry' }, { title: '鍨嬪彿', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'equipmentModel' }, { title: '璁惧瑙勬牸', align: 'center', width: 100, - dataIndex: 'orgId_dictText' + dataIndex: 'equipmentSpecification' }, { title: '鎬诲姛鐜�', align: 'center', width: 100, - dataIndex: 'equipmentManager_dictText' + dataIndex: 'equipmentPower' }, { title: '璐ㄤ繚寮�濮嬫棩鏈�', align: 'center', - dataIndex: 'equipmentCategory_dictText' + dataIndex: 'warrantyStartDate' }, { title: '璐ㄤ繚缁撴潫鏃ユ湡', align: 'center', - dataIndex: 'equipmentCategory_dictText' + dataIndex: 'warrantyEndDate' }, { title: '璧勪骇鐘舵��', align: 'center', - dataIndex: 'equipmentCategory_dictText' + dataIndex: 'assetStatus' }, { title: '鏈涓変繚鏃ユ湡', align: 'center', - dataIndex: 'equipmentCategory_dictText' + dataIndex: 'latestThirdMaintenance' }, { title: '涓嬫涓変繚鏃ユ湡', align: 'center', - dataIndex: 'equipmentCategory_dictText' + dataIndex: 'nextThirdMaintenance' }, { title: '涓変繚鍛ㄦ湡', align: 'center', - dataIndex: 'equipmentCategory_dictText' + dataIndex: 'thirdMaintenancePeriod' }, { title: '鏈鎶�鏈壌瀹氭棩鏈�', align: 'center', - dataIndex: 'equipmentCategory_dictText' + dataIndex: 'latestTechnologyCheck' }, { title: '涓嬫鎶�鏈壌瀹氭棩鏈�', align: 'center', - dataIndex: 'equipmentCategory_dictText' + dataIndex: 'nextTechnologyCheck' }, { title: '鎶�鏈壌瀹氬懆鏈�', align: 'center', - dataIndex: 'equipmentType_dictText' + dataIndex: 'technologyCheckPeriod' }, { title: '鎿嶄綔', @@ -498,7 +471,7 @@ deleteBatch: '/eam/equipment/deleteBatch', exportXlsUrl: 'eam/equipment/exportXls', importExcelUrl: 'eam/equipment/importExcel', - loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions', + getProductionTreeList: '/eam/BaseFactory/queryTreeList', templateXlsDownloadUrl: '瀵煎叆妯℃澘/璁惧鍙拌处瀵煎叆妯℃澘_v1.1.xlsx' }, treeData: [], @@ -523,13 +496,12 @@ methods: { loadAllProductionTree() { //鍔犺浇杞﹂棿閫夋嫨鏍� - getAction(this.url.loadProductionOptions).then(res => { + getAction(this.url.getProductionTreeList).then(res => { if (res.success) { this.treeData = [...res.result] this.treeDataAlias = this.deepCopyAndModify(res.result) - console.info('treeDataAlias====', this.treeDataAlias) } else { - that.$message.warning(res.message) + this.$message.warning(res.message) } }) }, diff --git a/src/views/eam/equipment/modules/EamEquipmentFluidList.vue b/src/views/eam/equipment/modules/EamEquipmentFluidList.vue deleted file mode 100644 index 9ec6631..0000000 --- a/src/views/eam/equipment/modules/EamEquipmentFluidList.vue +++ /dev/null @@ -1,285 +0,0 @@ -<template> - <a-spin :spinning="confirmLoading"> - <vxe-toolbar> - <template v-slot:buttons> - <vxe-button status="primary" @click="insertEvent()">鏂板</vxe-button> - <vxe-button status="danger" @click="handleBatchRemove()">鎵归噺鍒犻櫎</vxe-button> - </template> - </vxe-toolbar> - <vxe-table - ref="editableDetailTable" - border - resizable - show-overflow - keep-source - :height="300" - :loading="confirmLoading" - :data="dataSource" - :edit-rules="validRules" - :edit-config="{trigger: 'manual', mode: 'row', showStatus: true}" - style="margin-top: 8px;"> - <vxe-table-column type="checkbox" width="60"></vxe-table-column> - <vxe-table-column type="seq" width="60"></vxe-table-column> - <vxe-table-column title="ID" field="id" :visible="false"></vxe-table-column> - <vxe-table-column title="equipmentId" field="equipmentId" :visible="false"></vxe-table-column> - <vxe-table-column title="娌规恫鍚嶇О" field="fluidId" align="center" - :edit-render="{name : '$select', options: fluidList, optionProps: {label:'fluidName', value:'id'}, props: {clearable:true}, events: {change:handleParamSelectChange}}"></vxe-table-column> - <vxe-table-column title="鍙傛暟缂栫爜" field="fluidCode" align="center"></vxe-table-column> - <vxe-table-column title="鎿嶄綔" width="160"> - <template v-slot="{row}"> - <template v-if="hasEditStatus(row)"> - <vxe-button @click="saveRowEvent(row)">淇濆瓨</vxe-button> - <vxe-button @click="cancelRowEvent(row)">鍙栨秷</vxe-button> - </template> - <template v-else> - <vxe-button @click="editRowEvent(row)">缂栬緫</vxe-button> - <vxe-button @click="handleRemove(row)">鍒犻櫎</vxe-button> - </template> - - </template> - </vxe-table-column> - </vxe-table> - <a-pagination - v-bind="ipagination" - @change="handlePageChange" - @showSizeChange="handleShowSizeChange" - /> - </a-spin> -</template> - -<script> -import { deleteAction, getAction, httpAction } from '@/api/manage' - -export default { - name: 'EamEquipmentFluidList', - data() { - return { - title: '鎿嶄綔', - confirmLoading: false, - url: { - add: '/eam/eamEquipmentFluid/add', - edit: '/eam/eamEquipmentFluid/edit', - list: '/eam/eamEquipmentFluid/list', - delete: '/eam/eamEquipmentFluid/delete', - deleteBatch: '/eam/eamEquipmentFluid/deleteBatch', - fluidList: '/eam/eamFluid/listAll' - }, - /* 鍒嗛〉鍙傛暟 */ - ipagination: { - current: 1, - pageSize: 10, - pageSizeOptions: ['10', '20', '30'], - showTotal: (total, range) => { - return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' - }, - showQuickJumper: true, - showSizeChanger: true, - total: 0, - size: 'small' - }, - dataSource: [], - fluidList: [], - queryParam: { - equipmentId: '-1' - }, - validRules: { - fluidId: [ - { required: true, message: '璇烽�夋嫨娌规恫锛�' } - ] - } - } - }, - created() { - this.loadFluidList() - }, - methods: { - handleParamSelectChange($event, value) { - console.log(value) - let parameter = this.fluidList.find(item => item.id === value.value) - if (parameter) { - $event.row.fluidCode = parameter.fluidCode - } else { - $event.row.fluidCode = undefined - } - }, - loadFluidList() { - getAction(this.url.fluidList).then(res => { - if (res.success) { - this.fluidList = [...res.result] - } - }) - }, - onClearSelected() { - this.dataSource = [] - this.queryParam.equipmentId = '-1' - this.ipagination.current = 1 - this.ipagination.total = 0 - }, - loadData(args) { - if (!this.url.list) { - this.$message.error('璇疯缃畊rl.list灞炴��!') - return - } - if (args === 1) { - this.ipagination.current = 1 - } - // 灏佽鏌ヨ鏉′欢 - let formData = { - pageNo: args, - pageSize: this.ipagination.pageSize, - equipmentId: this.queryParam.equipmentId - } - // 璋冪敤鏌ヨ鏁版嵁鎺ュ彛 - this.confirmLoading = true - getAction(this.url.list, formData).then(res => { - if (res.success) { - // 鍚庡彴鏌ヨ鍥炴潵鐨� total锛屾暟鎹�绘暟閲� - this.dataSource = res.result.records || res.result - if (res.result.total) { - this.ipagination.total = res.result.total - } else { - this.ipagination.total = 0 - } - } else { - this.$message.warning(res.message) - } - }).finally(() => { - // 杩欓噷鏄棤璁烘垚鍔熸垨澶辫触閮戒細鎵ц鐨勬柟娉曪紝鍦ㄨ繖閲屽叧闂璴oading - this.confirmLoading = false - }) - }, - async insertEvent() { - let record = { equipmentId: this.queryParam.equipmentId } - let { row: newRow } = await this.$refs.editableDetailTable.insert(record) - await this.$refs.editableDetailTable.setActiveCell(newRow, 'fluidId') - }, - async saveRowEvent(row) { - let that = this - const errMap = await that.$refs.editableDetailTable.validate().catch(errMap => errMap) - if (errMap) { - that.$message.warning('鏍¢獙涓嶉�氳繃,璇疯ˉ鍏呭繀濉」锛�') - return - } - that.confirmLoading = true - let httpurl = '' - let method = '' - if (!row.id) { - httpurl += that.url.add - method = 'post' - } else { - httpurl += that.url.edit - method = 'put' - } - let res = await httpAction(httpurl, row, method) - if (res.success) { - that.$message.success(res.message) - that.loadData(that.ipagination.current) - await that.$refs.editableDetailTable.clearActived() - } else { - that.$message.warning(res.message) - } - that.confirmLoading = false - }, - handleRemove(row) { - let xTable = this.$refs.editableDetailTable - let that = this - this.$confirm({ - content: `纭瑕佸垹闄ゅ悧锛焋, - onOk: () => { - if (row.id) { - //鍚庣鍒犻櫎 - deleteAction(that.url.delete, { id: row.id }).then((res) => { - if (res.success) { - that.reCalculatePage(1) - that.$message.success(res.message) - that.loadData(that.ipagination.current) - } else { - that.$message.warning(res.message) - } - }) - } else { - //鍓嶇鍒犻櫎 - xTable.remove(row) - } - }, - onCancel: () => { - xTable.setActiveCell(row, 'fluidId') - } - }) - }, - handleBatchRemove(){ - let xTable = this.$refs.editableDetailTable - let that = this - let checkboxRecords = xTable.getCheckboxRecords(); - if(checkboxRecords && checkboxRecords.length > 0) { - let ids = checkboxRecords.map(record => record.id); - this.$confirm({ - title: "纭鍒犻櫎", - content: "鏄惁鍒犻櫎閫変腑鏁版嵁?", - onOk: function () { - that.confirmLoading = true; - deleteAction(that.url.deleteBatch, {ids: ids.join(',')}).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(checkboxRecords.length) - that.$message.success(res.message); - that.loadData(that.ipagination.current); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - }); - } - }); - } else { - that.$message.warning('璇峰厛閫変腑鏁版嵁琛岋紒'); - } - }, - editRowEvent(row) { - this.$refs.editableDetailTable.setActiveRow(row) - }, - cancelRowEvent(row) { - let xTable = this.$refs.editableDetailTable - this.$confirm({ - content: `纭瑕佹斁寮冪紪杈戝悧锛焋, - onOk: () => { - xTable.revertData() - }, - onCancel: () => { - xTable.setActiveCell(row, 'fluidId') - } - }) - }, - hasEditStatus(row) { - const $table = this.$refs.editableDetailTable - if ($table) { - return $table.isActiveByRow(row) - } - return false - }, - reCalculatePage(count) { - //鎬绘暟閲�-count - let total = this.ipagination.total - count - //鑾峰彇鍒犻櫎鍚庣殑鍒嗛〉鏁� - let currentIndex = Math.ceil(total / this.ipagination.pageSize) - //鍒犻櫎鍚庣殑鍒嗛〉鏁�<鎵�鍦ㄥ綋鍓嶉〉 - if (currentIndex < this.ipagination.current) { - this.ipagination.current = currentIndex - } - }, - handlePageChange(current, pageSize){ - this.$set(this.ipagination, 'current', current) - this.$emit('change', {current, pageSize}) - }, - handleShowSizeChange(current, pageSize){ - this.$set(this.ipagination, 'pageSize', pageSize) - this.$emit('change', {current, pageSize}) - }, - } -} -</script> - -<style lang="less" scoped> - -</style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/EamEquipmentModal.vue b/src/views/eam/equipment/modules/EamEquipmentModal.vue index 9014581..3c2df03 100644 --- a/src/views/eam/equipment/modules/EamEquipmentModal.vue +++ b/src/views/eam/equipment/modules/EamEquipmentModal.vue @@ -10,257 +10,295 @@ @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> - <a-spin :spinning="confirmLoading"> - <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-row :gutter="24"> - <a-col :span="customSpan"> - <a-form-model-item label="鍏抽敭璁惧鏍囪瘑"> - <a-input placeholder="璇疯緭鍏ュ叧閿澶囨爣璇�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item prop="equipmentCode" label="缁熶竴缂栫爜"> - <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item prop="equipmentCode" label="璁惧鍚嶇О"> - <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item prop="equipmentCode" label="浣跨敤閮ㄩ棬"> - <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - </a-row> + <a-tabs tab-position="left"> + <a-tab-pane tab="鍩虹淇℃伅" :key="1"> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-row :gutter="24"> + <a-col :span="customSpan"> + <a-form-model-item label="鍏抽敭璁惧鏍囪瘑"> + <j-dict-select-tag dict-code="equipment_importance" placeholder="璇疯緭鍏ュ叧閿澶囨爣璇�" + v-model="model.equipmentImportance" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item prop="equipmentCode" label="缁熶竴缂栫爜"> + <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item prop="equipmentName" label="璁惧鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentName" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item prop="factoryOrgCode" label="浣跨敤閮ㄩ棬"> + <a-tree-select v-model="model.factoryOrgCode" + style="width: 100%" + show-search + :tree-data="treeDataAlias" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" + placeholder="璇烽�夋嫨浣跨敤閮ㄩ棬" + allow-clear + treeNodeFilterProp="title" + searchPlaceholder="璇疯緭鍏ュ叧閿瓧鎼滅储" + tree-default-expand-all/> + </a-form-model-item> + </a-col> + </a-row> - <a-row :gutter="24"> - <a-col :span="customSpan"> - <a-form-model-item prop="equipmentCode" label="涓績"> - <a-input placeholder="璇疯緭鍏ュ叧閿澶囨爣璇�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="宸ュ尯"> - <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="宸ユ"> - <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item prop="equipmentCode" label="璁惧鎵�灞炲垎绫�"> - <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - </a-row> + <a-row :gutter="24"> + <a-col :span="customSpan"> + <a-form-model-item prop="equipmentCategory" label="鎵�灞炲垎绫�"> + <j-dict-select-tag dict-code="equipment_category" placeholder="璇烽�夋嫨鎵�灞炲垎绫�" + v-model="model.equipmentCategory" + :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="璐ㄤ繚寮�濮嬫棩鏈�"> + <a-date-picker v-model="model.warrantyStartDate" value-format="YYYY-MM-DD" style="width:100%"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="璐ㄤ繚缁撴潫鏃ユ湡"> + <a-date-picker v-model="model.warrantyEndDate" value-format="YYYY-MM-DD" style="width:100%"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="ABC鏍囪瘑"> + <j-dict-select-tag dict-code="abc_flag" placeholder="璇烽�夋嫨ABC鏍囪瘑" v-model="model.abcFlag" + :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> - <a-row :gutter="24"> - <a-col :span="customSpan"> - <a-form-model-item prop="equipmentCode" label="璁惧鐘舵��"> - <a-input placeholder="璇疯緭鍏ュ叧閿澶囨爣璇�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="ABC鏍囪瘑"> - <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item prop="equipmentCode" label="缁存姢閮ㄩ棬"> - <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item prop="equipmentCode" label="缁翠慨鐝粍"> - <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - </a-row> + <a-row :gutter="24"> + <a-col :span="customSpan"> + <a-form-model-item prop="repairDepartOrgCode" label="缁翠慨鐝粍"> + <a-input placeholder="璇烽�夋嫨缁翠慨鐝粍" v-model="model.repairDepartOrgCode" + :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="瀹夊叏閰嶇疆"> + <a-input placeholder="璇疯緭鍏ュ畨鍏ㄩ厤缃�" v-model="model.securityConfiguration" + :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> - <a-row :gutter="24"> - <a-col :span="customSpan"> - <a-form-model-item label="瀹夊叏閰嶇疆"> - <a-input placeholder="璇疯緭鍏ュ叧閿澶囨爣璇�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="鍐峰嵈绯荤粺"> - <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="鐏伀鍣�"> - <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="鐏伀鍣ㄦ湁鏁堟湡"> - <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - </a-row> + <a-row :gutter="24"> + <a-col :span="customSpan"> + <a-form-model-item label="鍐峰嵈绯荤粺"> + <j-dict-select-tag dict-code="cooling_system" placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.coolSystem" + :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="鐏伀鍣�"> + <a-input placeholder="璇疯緭鍏ョ伃鐏櫒" v-model="model.fireExtinguisher" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="鐏伀鍣ㄦ湁鏁堟湡"> + <a-date-picker v-model="model.fireExtinguisherExpirationDate" value-format="YYYY-MM-DD" + style="width:100%"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="鎿嶄綔绯荤粺"> + <j-dict-select-tag dict-code="yn " type="radio" v-model="model.operationSystem"/> + </a-form-model-item> + </a-col> + </a-row> - <a-row :gutter="24"> - <a-col :span="customSpan"> - <a-form-model-item label="鎿嶄綔绯荤粺"> - <a-input placeholder="璇疯緭鍏ュ叧閿澶囨爣璇�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="绯荤粺"> - <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="璁惧绔彛"> - <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="鍧愭爣鏁伴噺"> - <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - </a-row> + <a-row :gutter="24"> + <a-col :span="customSpan"> + <a-form-model-item label="绯荤粺"> + <a-input placeholder="璇疯緭鍏ョ郴缁�" v-model="model.system" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="璁惧绔彛"> + <a-input placeholder="璇疯緭鍏ヨ澶囩鍙�" v-model="model.equipmentPort" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="鍧愭爣鏁伴噺"> + <a-input-number placeholder="璇疯緭鍏ュ潗鏍囨暟閲�" v-model="model.coordinateNum" :min="0" style="width: 100%" + :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="閲嶉噺"> + <a-input-number placeholder="璇疯緭鍏ラ噸閲�" v-model="model.equipmentWeight" :min="0" style="width: 100%" + :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> - <a-row :gutter="24"> - <a-col :span="customSpan"> - <a-form-model-item label="閲嶉噺"> - <a-input placeholder="璇疯緭鍏ュ叧閿澶囨爣璇�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="閲嶉噺璁¢噺鍗曚綅"> - <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="鍔熻兘浣嶇疆"> - <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="瀹夎浣嶇疆"> - <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - </a-row> + <a-row :gutter="24"> + <a-col :span="customSpan"> + <a-form-model-item label="閲嶉噺璁¢噺鍗曚綅"> + <a-input placeholder="璇疯緭鍏ラ噸閲忚閲忓崟浣�" v-model="model.weightUnit" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="鍔熻兘浣嶇疆"> + <a-input placeholder="璇疯緭鍏ュ姛鑳戒綅缃�" v-model="model.functionalLocation" + :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="瀹夎浣嶇疆"> + <a-input placeholder="璇疯緭鍏ュ畨瑁呬綅缃�" v-model="model.installationPosition" + :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="鍑哄巶鏃ユ湡"> + <a-date-picker v-model="model.leaveFactoryDate" value-format="YYYY-MM-DD" style="width:100%"/> + </a-form-model-item> + </a-col> + </a-row> - <a-row :gutter="24"> - <a-col :span="customSpan"> - <a-form-model-item label="鍑哄巶鏃ユ湡"> - <a-input placeholder="璇疯緭鍏ュ叧閿澶囨爣璇�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="绔嬮」鍗″彿"> - <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="璧勯噾鏉ユ簮"> - <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="楠屾敹鏃ユ湡"> - <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - </a-row> + <a-row :gutter="24"> + <a-col :span="customSpan"> + <a-form-model-item label="绔嬮」鍗″彿"> + <a-input placeholder="璇疯緭鍏ョ珛椤瑰崱鍙�" v-model="model.cardNumber" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="璧勯噾鏉ユ簮"> + <a-input placeholder="璇疯緭鍏ヨ祫閲戞潵婧�" v-model="model.fundingSource" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="楠屾敹鏃ユ湡"> + <a-date-picker v-model="model.acceptanceCheckDate" value-format="YYYY-MM-DD" style="width:100%"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="鍑哄巶缂栧彿"> + <a-input placeholder="璇疯緭鍏ュ嚭鍘傜紪鍙�" v-model="model.factoryNumber" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> - <a-row :gutter="24"> - <a-col :span="customSpan"> - <a-form-model-item label="鍑哄巶缂栧彿"> - <a-input placeholder="璇疯緭鍏ュ叧閿澶囨爣璇�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="璧勪骇鍒堕�犲晢"> - <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="璧勪骇鏉ユ簮鍥藉"> - <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="鍨嬪彿"> - <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - </a-row> + <a-row :gutter="24"> + <a-col :span="customSpan"> + <a-form-model-item label="璧勪骇鍒堕�犲晢"> + <a-input placeholder="璇疯緭鍏ヨ祫浜у埗閫犲晢" v-model="model.manufacturingEnterprise" + :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="璧勪骇鏉ユ簮鍥藉"> + <a-input placeholder="璇疯緭鍏ヨ祫浜ф潵婧愬浗瀹�" v-model="model.originCountry" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="鍨嬪彿"> + <a-input placeholder="璇疯緭鍏ュ瀷鍙�" v-model="model.equipmentModel" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="璁惧瑙勬牸"> + <a-input placeholder="璇疯緭鍏ヨ澶囪鏍�" v-model="model.equipmentSpecification" + :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> - <a-row :gutter="24"> - <a-col :span="customSpan"> - <a-form-model-item label="璁惧瑙勬牸"> - <a-input placeholder="璇疯緭鍏ュ叧閿澶囨爣璇�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="鎬诲姛鐜�"> - <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="璐ㄤ繚寮�濮嬫棩鏈�"> - <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="璐ㄤ繚缁撴潫鏃ユ湡"> - <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - </a-row> + <a-row :gutter="24"> + <a-col :span="customSpan"> + <a-form-model-item label="鎬诲姛鐜�"> + <a-input placeholder="璇疯緭鍏ユ�诲姛鐜�" v-model="model.equipmentPower" :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="璐ㄤ繚寮�濮嬫棩鏈�"> + <a-date-picker v-model="model.warrantyStartDate" value-format="YYYY-MM-DD" style="width:100%"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="璐ㄤ繚缁撴潫鏃ユ湡"> + <a-date-picker v-model="model.warrantyEndDate" value-format="YYYY-MM-DD" style="width:100%"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="璧勪骇鐘舵��"> + <j-dict-select-tag dict-code="asset_status" placeholder="璇烽�夋嫨璧勪骇鐘舵��" v-model="model.assetStatus" + :disabled="editable || disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> - <a-row :gutter="24"> - <a-col :span="customSpan"> - <a-form-model-item label="璧勪骇鐘舵��"> - <a-input placeholder="璇疯緭鍏ュ叧閿澶囨爣璇�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="鏈涓変繚鏃ユ湡"> - <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="涓嬫涓変繚鏃ユ湡"> - <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="涓変繚鍛ㄦ湡"> - <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - </a-row> + <a-row :gutter="24"> + <a-col :span="customSpan"> + <a-form-model-item label="鏈涓変繚鏃ユ湡"> + <a-date-picker v-model="model.latestThirdMaintenance" value-format="YYYY-MM-DD" style="width:100%"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="涓嬫涓変繚鏃ユ湡"> + <a-date-picker v-model="model.nextThirdMaintenance" value-format="YYYY-MM-DD" style="width:100%"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="涓変繚鍛ㄦ湡"> + <a-date-picker v-model="model.thirdMaintenancePeriod" value-format="YYYY-MM-DD" style="width:100%"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="鏈鎶�鏈壌瀹氭棩鏈�"> + <a-date-picker v-model="model.latestTechnologyCheck" value-format="YYYY-MM-DD" style="width:100%"/> + </a-form-model-item> + </a-col> + </a-row> - <a-row :gutter="24"> - <a-col :span="customSpan"> - <a-form-model-item label="鏈鎶�鏈壌瀹氭棩鏈�"> - <a-input placeholder="璇疯緭鍏ュ叧閿澶囨爣璇�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="涓嬫鎶�鏈壌瀹氭棩鏈�"> - <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - <a-col :span="customSpan"> - <a-form-model-item label="鎶�鏈壌瀹氬懆鏈�"> - <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentCode" :disabled="editable || disableSubmit"/> - </a-form-model-item> - </a-col> - </a-row> - </a-form-model> - </a-spin> + <a-row :gutter="24"> + <a-col :span="customSpan"> + <a-form-model-item label="涓嬫鎶�鏈壌瀹氭棩鏈�"> + <a-date-picker v-model="model.nextTechnologyCheck" value-format="YYYY-MM-DD" style="width:100%"/> + </a-form-model-item> + </a-col> + <a-col :span="customSpan"> + <a-form-model-item label="鎶�鏈壌瀹氬懆鏈�"> + <a-date-picker v-model="model.technologyCheckPeriod" value-format="YYYY-MM-DD" style="width:100%"/> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-tab-pane> + + <template v-if="disableSubmit"> + <a-tab-pane tab="璁惧鏂囨。" :key="2"> + </a-tab-pane> + + <a-tab-pane tab="鐐规宸ュ崟" :key="3"> + </a-tab-pane> + + <a-tab-pane tab="浜屼繚宸ュ崟" :key="4"> + </a-tab-pane> + + <a-tab-pane tab="涓変繚宸ュ崟" :key="5"> + </a-tab-pane> + + <a-tab-pane tab="缁翠慨宸ュ崟" :key="6"> + </a-tab-pane> + + <a-tab-pane tab="淇濆吇鏍囧噯" :key="7"> + </a-tab-pane> + + <a-tab-pane tab="宸ヨ壓鍙傛暟" :key="8"> + </a-tab-pane> + + <a-tab-pane tab="璁惧绮惧害" :key="9"> + + </a-tab-pane> + </template> + </a-tabs> </j-modal> </template> @@ -270,6 +308,11 @@ export default { name: 'EamEquipmentModal', + props: { + treeDataAlias: { + type: Array + } + }, data() { return { title: '鎿嶄綔', @@ -299,37 +342,27 @@ confirmLoading: false, validatorRules: { equipmentCode: [ - { required: true, message: '璇疯緭鍏ヨ澶囩紪鐮�' }, + { required: true, message: '璇疯緭鍏ョ粺涓�缂栫爜', trigger: 'change' }, { validator: (rule, value, callback) => validateDuplicateValueInDelFlag('eam_equipment', 'equipment_code', value, this.model.id, true, callback) } ], equipmentName: [ - { required: true, message: '璇疯緭鍏ヨ澶囧悕绉�' } + { required: true, message: '璇疯緭鍏ヨ澶囧悕绉�', trigger: 'change' } + ], + factoryOrgCode: [ + { required: true, message: '璇烽�夋嫨浣跨敤閮ㄩ棬', trigger: 'change' } ], equipmentCategory: [ - { required: true, message: '璇烽�夋嫨璁惧绫诲埆' } + { required: true, message: '璇烽�夋嫨璁惧鎵�灞炲垎绫�', trigger: 'change' } ], - leaveFactoryDate: [ - { required: true, message: '璇烽�夋嫨鍑哄巶鏃ユ湡' } - ], - acceptanceCheckDate: [ - { required: false, message: '璇烽�夋嫨楠屾敹鏃ユ湡' } - ], - orgId: [ - { required: true, message: '璇烽�夋嫨浣跨敤杞﹂棿' } - ], - equipmentManager: [ - { required: true, message: '璇烽�夋嫨璁惧绠$悊鍛�' } - ], - deviceType: [ - { required: false, message: '璇烽�夋嫨璁惧绫诲瀷' } + repairDepartOrgCode: [ + { required: true, message: '璇烽�夋嫨缁翠慨鐝粍', trigger: 'change' } ] }, url: { add: '/eam/equipment/add', edit: '/eam/equipment/edit', - loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions' - }, - treeData: [] + getProductionTreeList: '/eam/BaseFactory/queryTreeList' + } } }, created() { @@ -342,16 +375,27 @@ this.model = {} this.visible = true }, + edit(record) { this.editable = true this.model = Object.assign({}, record) this.visible = true }, - close() { - this.$emit('close') - this.visible = false - this.$refs.form.clearValidate() + loadAllProductionTree() { + //鍔犺浇杞﹂棿閫夋嫨鏍� + getAction(this.url.getProductionTreeList) + .then(res => { + if (res.success) { + this.productionTreeData = res.result + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) }, + handleOk() { const that = this // 瑙﹀彂琛ㄥ崟楠岃瘉 @@ -369,11 +413,17 @@ } httpAction(httpurl, this.model, method).then((res) => { if (res.success) { - that.$message.success(res.message) + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) that.$emit('ok') that.close() } else { - that.$message.warning(res.message) + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) } }).finally(() => { that.confirmLoading = false @@ -383,18 +433,15 @@ } }) }, + handleCancel() { this.close() }, - loadAllProductionTree() { - //鍔犺浇杞﹂棿閫夋嫨鏍� - getAction(this.url.loadProductionOptions).then(res => { - if (res.success) { - this.treeData = [...res.result] - } else { - that.$message.warning(res.message) - } - }) + + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() } } } diff --git a/src/views/eam/equipment/modules/NameplateModal.vue b/src/views/eam/equipment/modules/NameplateModal.vue deleted file mode 100644 index f36442b..0000000 --- a/src/views/eam/equipment/modules/NameplateModal.vue +++ /dev/null @@ -1,151 +0,0 @@ -<template> - <j-modal - title="閾墝" - :width="750" - :visible="visible" - @cancel="handleCancel" - :maskClosable="false" - > - - <div id="nameplateTable"> - <table border="1" cellpadding="12" cellspacing="0" align="center" width="80%" v-for="item in printedRows" - :key="item.id"> - <thead> - <tr> - <th colspan="3">璁惧绠$悊鐗�</th> - </tr> - </thead> - - <tbody> - <tr> - <td rowspan="3" align="center"> - <div style="height: 80%;width: 50%"> - <QrcodeVue :value="httpUrl+item.id" :size="50"/> - </div> - </td> - <td>璁惧缂栧彿</td> - <td>{{ item.equipmentCode }}</td> - </tr> - - <tr> - <td>璁惧鍚嶇О</td> - <td>{{ item.equipmentName }}</td> - </tr> - - <tr> - <td>璁惧鍨嬪彿</td> - <td>{{ item.equipmentModel }}</td> - </tr> - - <tr> - <td>璁惧绠$悊</td> - <td>浣跨敤杞﹂棿</td> - <td>{{ item.orgId_dictText }}</td> - </tr> - - <tr> - <td rowspan="3" align="center"> - <div style="height: 80%;width: 50%"> - <QrcodeVue :value="item.equipmentCode" :size="50"/> - </div> - </td> - <td>鍑哄巶缂栧彿</td> - <td>{{ item.factoryNumber }}</td> - </tr> - - <tr> - <td>璁惧绠$悊鍛�</td> - <td>{{ item.equipmentManager_dictText }}</td> - </tr> - - <tr> - <td>瀹夎浣嶇疆</td> - <td>{{ item.installationPosition }}</td> - </tr> - - <tr> - <td>MES</td> - <td colspan="2" style="color: #f00;font-weight: bold;letter-spacing: 1px">闈炵鐞嗗憳鍕垮姩姝ら摥鐗�</td> - </tr> - </tbody> - </table> - </div> - - <template slot="footer"> - <a-button @click="handleCancel">鍏抽棴</a-button> - <a-button type="primary" v-print="'#nameplateTable'">鎵撳嵃</a-button> - </template> - </j-modal> -</template> - -<script> - import QrcodeVue from 'qrcode.vue' - - export default { - name: 'NameplateModal', - components: { QrcodeVue }, - props: { - printedRows: { - type: Array - } - }, - data() { - return { - title: '閾墝', - visible: false, - httpUrl: '' - } - }, - methods: { - handleCancel() { - this.visible = false - } - } - } -</script> - -<style lang="less" scoped> - /deep/ .ant-modal { - height: 75%; - overflow: hidden; - - .ant-modal-content { - height: 100%; - display: flex; - flex-direction: column; - overflow: hidden; - - ::-webkit-scrollbar { - width: 8px; - height: 8px; - } - - .ant-modal-body { - flex: 1; - overflow: auto; - } - } - } - - table { - font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "寰蒋闆呴粦", Arial, sans-serif; - color: #000; - text-align: center; - - &:not(:last-child) { - margin-bottom: 10px; - } - - th { - font-size: 24px; - letter-spacing: 3px; - padding: 12px; - } - - td { - font-size: 14px; - width: 33%; - padding: 6px; - } - } -</style> \ No newline at end of file diff --git a/src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue b/src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue deleted file mode 100644 index afdf311..0000000 --- a/src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue +++ /dev/null @@ -1,492 +0,0 @@ -<template> - <a-card :bordered="false"> - - <!-- 鏌ヨ鍖哄煙 --> - <div class="table-page-search-wrapper" v-if="isDisplayOperation"> - <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="宸ュ崟鍙�"> - <a-input placeholder="璇疯緭鍏ュ伐鍗曞彿" v-model="queryParam.orderNum"></a-input> - </a-form-item> - </a-col> - <a-col :xl="4" :lg="7" :md="8" :sm="24"> - <a-form-item label="璁惧缂栧彿"> - <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" - v-model="queryParam.equipmentId"></lx-search-equipment-select> - </a-form-item> - </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="璁″垝淇濆吇鏃ユ湡"> - <a-range-picker v-model="queryParam.maintenanceDateRange" @change="onMaintenanceDateChange" - format="YYYY-MM-DD" value-format="YYYY-MM-DD"/> - </a-form-item> - </a-col> - <a-col :xl="4" :lg="7" :md="8" :sm="24"> - <a-form-item label="淇濆吇鐘舵��"> - <j-dict-select-tag placeholder="璇烽�夋嫨淇濆吇鐘舵��" dict-code="week_maintenance_status" - v-model="queryParam.maintenanceStatus"/> - </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" v-if="isDisplayOperation"> - <a-button @click="handleAdd" type="primary" icon="plus" v-if="isShowAuth('eam:weekMaintenance:add')">鏂板</a-button> - <a-dropdown v-if="selectedRowKeys.length > 0"> - <a-menu slot="overlay"> - <a-menu-item key="1" @click="handlerBatchAbolish" v-if="isShowAuth('eam:weekMaintenance:abolish')"> - <a-icon type="delete"/> - 浣滃簾 - </a-menu-item> - <a-menu-item key="2" @click="handlerBatchCollect" v-if="isShowAuth('eam:weekMaintenance:collect')"> - <a-icon type="form"/> - 棰嗗彇 - </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;" v-if="isDisplayOperation"> - <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a - style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� - <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> - </div> - - <a-table - ref="table" - size="middle" - bordered - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - class="j-table-force-nowrap" - :scroll="{x:'max-content'}" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - @change="handleTableChange"> - - <span slot="action" slot-scope="text, record"> - <template v-if="record.maintenanceStatus === 'WAIT_MAINTENANCE' && isShowAuth('eam:weekMaintenance:edit')"> - <a @click="handleEdit(record)">缂栬緫</a> - - <a-divider type="vertical"/> - - <a-popconfirm title="纭畾棰嗗彇鍚�?" @confirm="() => handlerCollect(record.id)"> - <a>棰嗗彇</a> - </a-popconfirm> - - <a-divider type="vertical"/> - - <a-dropdown> - <a class="ant-dropdown-link">鏇村 <a-icon type="down"/></a> - <a-menu slot="overlay"> - <a-menu-item> - <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handlerAbolish(record.id)"> - <a>浣滃簾</a> - </a-popconfirm> - </a-menu-item> - <a-menu-item> - <a @click="handleDetail(record)">璇︽儏</a> - </a-menu-item> - </a-menu> - </a-dropdown> - </template> - - <template v-else> - <a @click="handleDetail(record)">璇︽儏</a> - </template> - </span> - </a-table> - </div> - <!-- table鍖哄煙-end --> - - <!-- 琛ㄥ崟鍖哄煙 --> - <eamWeekMaintenanceOrder-modal ref="modalForm" @ok="modalFormOk"></eamWeekMaintenanceOrder-modal> - <week-maintenance-approval-modal ref="weekMaintenanceApprovalModal" - :selectShenpiData="selectWeekMaintenanceData"></week-maintenance-approval-modal> - </a-card> -</template> - -<script> - import '@/assets/less/TableExpand.less' - import EamWeekMaintenanceOrderModal from './modules/EamWeekMaintenanceOrderModal' - import { JeecgListMixin } from '@/mixins/JeecgListMixin' - import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' - import { deleteAction, getAction } from '@api/manage' - import WeekMaintenanceApprovalModal from '@views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal' - - export default { - name: 'EamWeekMaintenanceOrderList', - mixins: [JeecgListMixin], - components: { - LxSearchEquipmentSelect, - EamWeekMaintenanceOrderModal, - WeekMaintenanceApprovalModal - }, - props: { - isDisplayOperation: { - type: Boolean, - default: true - } - }, - data() { - return { - description: '鍛ㄤ繚宸ュ崟绠$悊椤甸潰', - disableMixinCreated: true, - selectWeekMaintenanceData: {}, - // 琛ㄥご - columns: [ - { - title: '#', - dataIndex: '', - key: 'rowIndex', - width: 60, - align: 'center', - fixed: 'left', - customRender: function(t, r, index) { - return parseInt(index) + 1 - } - }, - { - title: '宸ュ崟鍙�', - align: 'center', - dataIndex: 'orderNum', - fixed: 'left', - width: 60 - }, - { - title: '璁惧缂栧彿', - align: 'center', - dataIndex: 'equipmentCode', - fixed: 'left', - width: 60 - }, - { - title: '璁惧鍚嶇О', - align: 'center', - dataIndex: 'equipmentName', - fixed: 'left', - width: 60 - }, - { - title: '鏍囧噯鍚嶇О', - align: 'center', - dataIndex: 'standardId_dictText', - width: 100 - }, - { - title: '璁″垝淇濆吇鏃ユ湡', - align: 'center', - dataIndex: 'maintenanceDate', - width: 60 - }, - { - title: '瀹為檯寮�濮嬫椂闂�', - align: 'center', - dataIndex: 'actualStartTime', - width: 60 - }, - { - title: '瀹為檯缁撴潫鏃堕棿', - align: 'center', - dataIndex: 'actualEndTime', - width: 60 - }, - { - title: '淇濆吇浜�', - align: 'center', - dataIndex: 'operator_dictText', - width: 60 - }, - { - title: '淇濆吇鐘舵��', - align: 'center', - dataIndex: 'maintenanceStatus_dictText', - width: 60 - }, - { - title: '鍒涘缓鏂瑰紡', - align: 'center', - dataIndex: 'creationMethod_dictText', - width: 60 - }, - { - title: '纭浜�', - align: 'center', - dataIndex: 'confirmUser_dictText', - width: 60 - }, - { - title: '纭鏃堕棿', - align: 'center', - dataIndex: 'confirmTime', - width: 60 - }, - { - title: '纭鎰忚', - align: 'center', - dataIndex: 'confirmComment', - width: 60 - }, - { - title: '鍒濋獙鏀朵汉', - align: 'center', - dataIndex: 'initialAcceptanceUser_dictText', - width: 60 - }, - { - title: '鍒濋獙鏀舵椂闂�', - align: 'center', - dataIndex: 'initialAcceptanceTime', - width: 60 - }, - { - title: '鍒濋獙鏀舵剰瑙�', - align: 'center', - dataIndex: 'initialAcceptanceComment', - width: 60 - }, - { - title: '缁堥獙鏀朵汉', - align: 'center', - dataIndex: 'finalAcceptanceUser_dictText', - width: 60 - }, - { - title: '缁堥獙鏀舵椂闂�', - align: 'center', - dataIndex: 'finalAcceptanceTime', - width: 60 - }, - { - title: '缁堥獙鏀舵剰瑙�', - align: 'center', - dataIndex: 'finalAcceptanceComment', - width: 60 - }, - { - title: '澶囨敞', - align: 'center', - dataIndex: 'remark', - width: 60 - } - // { - // title: '鎿嶄綔', - // dataIndex: 'action', - // align: 'center', - // fixed: 'right', - // width: 100, - // scopedSlots: { customRender: 'action' } - // } - ], - url: { - list: '/eam/weekMaintenanceOrder/list', - abolish: '/eam/weekMaintenanceOrder/abolish', - abolishBatch: '/eam/weekMaintenanceOrder/abolishBatch', - collect: '/eam/weekMaintenanceOrder/collect', - collectBatch: '/eam/weekMaintenanceOrder/collectBatch' - } - } - }, - created() { - if (!this.isDisplayOperation) { - return - } - const operationColumn = { - title: '鎿嶄綔', - dataIndex: 'action', - align: 'center', - fixed: 'right', - width: 200, - scopedSlots: { customRender: 'action' } - } - this.columns = [...this.columns, operationColumn] - this.loadData(1) - }, - computed: {}, - methods: { - onMaintenanceDateChange: function(value, dateString) { - if(dateString && dateString.length === 2) { - this.queryParam.maintenanceDateBegin = dateString[0] - this.queryParam.maintenanceDateEnd = dateString[1] - }else { - this.queryParam.maintenanceDateBegin = undefined - this.queryParam.maintenanceDateEnd = undefined - } - }, - handlerAbolish(id) { - if (!this.url.abolish) { - this.$message.error('璇疯缃畊rl.abolish灞炴��!') - return - } - var that = this - deleteAction(that.url.abolish, { id: id }).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(1) - // that.$message.success(res.message); - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - that.loadData() - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }) - }, - handlerBatchAbolish() { - if (!this.url.abolishBatch) { - this.$message.error('璇疯缃畊rl.abolishBatch灞炴��!') - return - } - if (this.selectedRowKeys.length <= 0) { - // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); - this.$notification.warning({ - message: '娑堟伅', - description: '璇烽�夋嫨涓�鏉¤褰�' - }) - return - } else { - var ids = '' - for (var a = 0; a < this.selectedRowKeys.length; a++) { - ids += this.selectedRowKeys[a] + ',' - } - var that = this - this.$confirm({ - title: '纭浣滃簾', - content: '鏄惁浣滃簾閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲浣滃簾鎴愬姛?', - onOk: function() { - that.loading = true - deleteAction(that.url.abolishBatch, { ids: ids }).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(that.selectedRowKeys.length) - // that.$message.success(res.message); - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - that.loadData() - that.onClearSelected() - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }).finally(() => { - that.loading = false - }) - } - }) - } - }, - //鍗曚釜棰嗗彇 - handlerCollect(id) { - if (!this.url.collect) { - this.$message.error('璇疯缃畊rl.collect灞炴��!') - return - } - let that = this - getAction(that.url.collect, { id: id }).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(1) - // that.$message.success(res.message); - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - that.loadData() - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }) - }, - //鎵归噺棰嗗彇 - handlerBatchCollect() { - if (!this.url.collectBatch) { - this.$message.error('璇疯缃畊rl.abolishBatch灞炴��!') - return - } - if (this.selectedRowKeys.length <= 0) { - // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); - this.$notification.warning({ - message: '娑堟伅', - description: '璇烽�夋嫨涓�鏉¤褰�' - }) - return - } else { - var ids = '' - for (var a = 0; a < this.selectedRowKeys.length; a++) { - ids += this.selectedRowKeys[a] + ',' - } - var that = this - this.$confirm({ - title: '纭棰嗗彇', - content: '鏄惁棰嗗彇閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲棰嗗彇鎴愬姛?', - onOk: function() { - that.loading = true - deleteAction(that.url.collectBatch, { ids: ids }).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(that.selectedRowKeys.length) - // that.$message.success(res.message); - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - that.loadData() - that.onClearSelected() - } else { - // that.$message.warning(res.message); - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }).finally(() => { - that.loading = false - }) - } - }) - } - }, - handleDetail(record) { - this.selectWeekMaintenanceData = Object.assign({}, record) - this.$refs.weekMaintenanceApprovalModal.recordDetail(record) - this.$refs.weekMaintenanceApprovalModal.title = '璇︽儏' - this.$refs.weekMaintenanceApprovalModal.disableSubmit = true - } - } - } -</script> -<style scoped> - @import '~@assets/less/common.less'; -</style> \ No newline at end of file -- Gitblit v1.9.3