| | |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="å¤ä»¶ç¼ç "> |
| | | <j-input placeholder="请è¾å
¥å¤ä»¶ç¼ç " v-model="queryParam.partCode"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="å¤ä»¶åç§°"> |
| | | <j-input placeholder="请è¾å
¥å¤ä»¶åç§°" v-model="queryParam.partName"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-col |
| | | :xl="4" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="å¤ä»¶åç±»"> |
| | | <j-input placeholder="请è¾å
¥å¤ä»¶åç±»" v-model="queryParam.partCategory"></j-input> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="false" |
| | | placeholder="è¯·éæ©å¤ä»¶åç±»" |
| | | :triggerChange="true" |
| | | dictCode="spare_part_category" |
| | | v-model="queryParam.partCategory" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-col |
| | | :xl="4" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="å¤ä»¶ç¼ç "> |
| | | <j-input |
| | | placeholder="请è¾å
¥å¤ä»¶ç¼ç " |
| | | v-model="queryParam.partCode" |
| | | ></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :xl="4" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="å¤ä»¶åç§°"> |
| | | <j-input |
| | | placeholder="请è¾å
¥å¤ä»¶åç§°" |
| | | v-model="queryParam.partName" |
| | | ></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :xl="4" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="å¤ä»¶åå·"> |
| | | <j-input placeholder="请è¾å
¥å¤ä»¶åå·" v-model="queryParam.partModel"></j-input> |
| | | <j-input |
| | | placeholder="请è¾å
¥å¤ä»¶åå·" |
| | | v-model="queryParam.partModel" |
| | | ></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | <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="primary" |
| | | @click="searchReset" |
| | | icon="reload" |
| | | style="margin-left: 8px" |
| | | >éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | |
| | |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <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-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-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> |
| | | </a-dropdown> --> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <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> |
| | | <a |
| | | style="margin-left: 24px" |
| | | @click="onClearSelected" |
| | | >æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' |
| | | :customRow='clickThenSelect' |
| | | @change="handleTableChange" |
| | | > |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | |
| | | <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-popconfirm |
| | | title="ç¡®å®å é¤å?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | |
| | | </span> |
| | | |
| | | </a-table> |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane |
| | | tab='åºåæç»' |
| | | key="1" |
| | | > |
| | | <div |
| | | class="table-operator" |
| | | style="margin:-16px" |
| | | > |
| | | <eamSpare-part-inventory-list :sparePartId='sparePartId' /> |
| | | </div> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | |
| | | <!-- 表ååºå --> |
| | | <eamSpareParts-modal ref="modalForm" @ok="modalFormOk"></eamSpareParts-modal> |
| | | <eamSpareParts-modal |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></eamSpareParts-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import '@assets/less/TableExpand.less' |
| | | import EamSparePartsModal from './modules/EamSparePartsModal.vue' |
| | | import EamSparePartsModal from './modules/EamSpareParts/EamSparePartsModal.vue' |
| | | import EamSparePartInventoryList from './modules/EamSpareParts/EamSparePartInventoryList.vue' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: "EamSparePartsList", |
| | | mixins:[JeecgListMixin], |
| | | components: { |
| | | EamSparePartsModal |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'å¤åå¤ä»¶ç®¡ç管ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: 'å¤ä»¶ç¼ç ', |
| | | align:"center", |
| | | dataIndex: 'partCode' |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶åç§°', |
| | | align:"center", |
| | | dataIndex: 'partName' |
| | | }, |
| | | { |
| | | title: 'åç±»', |
| | | align:"center", |
| | | dataIndex: 'partCategory' |
| | | }, |
| | | { |
| | | title: 'åå·', |
| | | align:"center", |
| | | dataIndex: 'partModel' |
| | | }, |
| | | { |
| | | title: 'è§æ ¼', |
| | | align:"center", |
| | | dataIndex: 'partSpecification' |
| | | }, |
| | | { |
| | | title: 'åæ¾ä»åº', |
| | | align:"center", |
| | | dataIndex: 'storehouse' |
| | | }, |
| | | { |
| | | title: 'å¶é å', |
| | | align:"center", |
| | | dataIndex: 'manufacturingEnterprise' |
| | | }, |
| | | { |
| | | title: 'åä½', |
| | | align:"center", |
| | | dataIndex: 'unit' |
| | | }, |
| | | { |
| | | title: 'æææï¼å¤©ï¼', |
| | | align:"center", |
| | | dataIndex: 'periodOfValidity' |
| | | }, |
| | | { |
| | | title: 'åºåä¸éå¼', |
| | | align:"center", |
| | | dataIndex: 'inventoryMax' |
| | | }, |
| | | { |
| | | title: 'åºåä¸éå¼', |
| | | align:"center", |
| | | dataIndex: 'inventoryMin' |
| | | }, |
| | | { |
| | | title: 'åºåé¢è¦å¼', |
| | | align:"center", |
| | | dataIndex: 'inventoryWarning' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/eam/eamSpareParts/list", |
| | | delete: "/eam/eamSpareParts/delete", |
| | | deleteBatch: "/eam/eamSpareParts/deleteBatch", |
| | | exportXlsUrl: "eam/eamSpareParts/exportXls", |
| | | importExcelUrl: "eam/eamSpareParts/importExcel", |
| | | }, |
| | | export default { |
| | | name: "EamSparePartsList", |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | EamSparePartsModal, |
| | | EamSparePartInventoryList |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'å¤åå¤ä»¶ç®¡ç页é¢', |
| | | sparePartId: '-1', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: 'å¤ä»¶ç¼ç ', |
| | | align: "center", |
| | | dataIndex: 'partCode' |
| | | }, |
| | | { |
| | | title: 'åç±»', |
| | | align: "center", |
| | | dataIndex: 'partCategory_dictText' |
| | | }, |
| | | { |
| | | title: 'å¤ä»¶åç§°', |
| | | align: "center", |
| | | dataIndex: 'partName' |
| | | }, |
| | | { |
| | | title: 'åå·', |
| | | align: "center", |
| | | dataIndex: 'partModel' |
| | | }, |
| | | { |
| | | title: 'è§æ ¼', |
| | | align: "center", |
| | | dataIndex: 'partSpecification' |
| | | }, |
| | | { |
| | | title: 'åæ¾ä»åº', |
| | | align: "center", |
| | | dataIndex: 'storehouse' |
| | | }, |
| | | { |
| | | title: 'å¶é å', |
| | | align: "center", |
| | | dataIndex: 'manufacturingEnterprise' |
| | | }, |
| | | { |
| | | title: 'åä½', |
| | | align: "center", |
| | | dataIndex: 'unit' |
| | | }, |
| | | { |
| | | title: 'æææï¼å¤©ï¼', |
| | | align: "center", |
| | | dataIndex: 'periodOfValidity' |
| | | }, |
| | | { |
| | | title: 'åºåä¸éå¼', |
| | | align: "center", |
| | | dataIndex: 'inventoryMax' |
| | | }, |
| | | { |
| | | title: 'åºåä¸éå¼', |
| | | align: "center", |
| | | dataIndex: 'inventoryMin' |
| | | }, |
| | | { |
| | | title: 'åºåé¢è¦å¼', |
| | | align: "center", |
| | | dataIndex: 'inventoryWarning' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: "center", |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/eam/eamSpareParts/list", |
| | | delete: "/eam/eamSpareParts/delete", |
| | | deleteBatch: "/eam/eamSpareParts/deleteBatch", |
| | | exportXlsUrl: "eam/eamSpareParts/exportXls", |
| | | importExcelUrl: "eam/eamSpareParts/importExcel", |
| | | }, |
| | | } |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | importExcelUrl: function () { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | } |
| | | methods: { |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.onClearSelected() |
| | | this.loadData(1); |
| | | }, |
| | | clickThenSelect(record) { |
| | | return { |
| | | on: { |
| | | click: () => { |
| | | this.onSelectChange(record.id.split(','), [record]) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onClearSelected() { |
| | | this.selectedRowKeys = [] |
| | | this.selectionRows = [] |
| | | this.sparePartId = '-1' |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | if (selectedRowKeys.length == 1) { |
| | | this.sparePartId = selectionRows[0]['id'] |
| | | } else { |
| | | this.sparePartId = '-1' |
| | | } |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.selectionRows = selectionRows |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | :bordered="false" |
| | | :class="'cust-erp-sub-tab'" |
| | | > |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="24"> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <div> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | @change="handleTableChange" |
| | | > |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { getAction } from '@/api/manage' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import { ACCESS_TOKEN } from '@/store/mutation-types' |
| | | import Vue from 'vue' |
| | | import { getFileAccessHttpUrl } from '@/api/manage'; |
| | | |
| | | export default { |
| | | name: "EamSparePartInventoryList", |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | Tooltip, |
| | | }, |
| | | props: { |
| | | sparePartId: { |
| | | type: String, |
| | | default: '-1', |
| | | required: false |
| | | } |
| | | }, |
| | | watch: { |
| | | sparePartId: { |
| | | immediate: true, |
| | | handler(val) { |
| | | if (!this.sparePartId) { |
| | | this.clearList() |
| | | } else { |
| | | this.queryParam['sparePartId'] = val; |
| | | this.loadData(1); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: "center", |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1; |
| | | } |
| | | }, |
| | | // { |
| | | // title: 'å¤åå¤ä»¶ID', |
| | | // align: "center", |
| | | // dataIndex: 'sparePartId' |
| | | // }, |
| | | { |
| | | title: 'æ¹æ¬¡å·', |
| | | align: "center", |
| | | dataIndex: 'batchNum' |
| | | }, |
| | | { |
| | | title: 'åºåæ°é', |
| | | align: "center", |
| | | dataIndex: 'inventory' |
| | | }, |
| | | { |
| | | title: 'åºåæ¥æ(çäº§æ¥æ)', |
| | | align: "center", |
| | | dataIndex: 'manufactureDate' |
| | | }, |
| | | { |
| | | title: 'ä¾åºå', |
| | | align: "center", |
| | | dataIndex: 'supplier' |
| | | }, |
| | | { |
| | | title: 'æªæ¢æææ', |
| | | align: "center", |
| | | dataIndex: 'expirationOfValidity' |
| | | }, |
| | | { |
| | | title: 'åæ¾ä½ç½®', |
| | | align: "center", |
| | | dataIndex: 'location' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: "center", |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/eam/eamSparePartInventory/list", |
| | | delete: "/eam/eamSparePartInventory/delete", |
| | | deleteBatch: "/eam/eamSparePartInventory/deleteBatch", |
| | | exportXlsUrl: "eam/eamSparePartInventory/exportXls", |
| | | importExcelUrl: "eam/eamSparePartInventory/importExcel", |
| | | }, |
| | | /* å页忰 */ |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 20, |
| | | pageSizeOptions: ['5', '10', '20', '50'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | }, |
| | | methods: { |
| | | clearList() { |
| | | this.dataSource = [] |
| | | this.selectedRowKeys = [] |
| | | this.ipagination.current = 1 |
| | | }, |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error("请设置url.list屿§!") |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true; |
| | | // this.originTargetKeys = []; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | // for (let i = 0; i < res.result.records.length; i++) { |
| | | // let r = res.result.records[i].upload; |
| | | // r.src = this.getSrc(res.result.records[i].upload); |
| | | // } |
| | | this.dataSource = res.result.records || res.result; |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total; |
| | | } else { |
| | | this.ipagination.total = 0; |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model |
| | | ref="form" |
| | | :model="model" |
| | | :rules="validatorRules" |
| | | > |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="partCode" |
| | | label="å¤ä»¶ç¼ç " |
| | | > |
| | | <a-input |
| | | placeholder="å¤ä»¶ç¼ç èªå¨çæ" |
| | | v-model="model.partCode" |
| | | :disabled="true" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="partCategory" |
| | | label="å¤ä»¶åç±»" |
| | | > |
| | | <!-- <a-input |
| | | placeholder="请è¾å
¥å¤ä»¶åç±»" |
| | | v-model="model.partCategory" |
| | | /> --> |
| | | <j-dict-select-tag |
| | | allow-clear |
| | | :disabled="false" |
| | | placeholder="è¯·éæ©å¤ä»¶åç±»" |
| | | :triggerChange="true" |
| | | dictCode="spare_part_category" |
| | | v-model="model.partCategory" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="partName" |
| | | label="å¤ä»¶åç§°" |
| | | > |
| | | <a-input |
| | | placeholder="请è¾å
¥å¤ä»¶åç§°" |
| | | v-model="model.partName" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="partModel" |
| | | label="å¤ä»¶åå·" |
| | | > |
| | | <a-input |
| | | placeholder="请è¾å
¥å¤ä»¶åå·" |
| | | v-model="model.partModel" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="partSpecification" |
| | | label="å¤ä»¶è§æ ¼" |
| | | > |
| | | <a-input |
| | | placeholder="请è¾å
¥å¤ä»¶è§æ ¼" |
| | | v-model="model.partSpecification" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="storehouse" |
| | | label="åæ¾ä»åº" |
| | | > |
| | | <a-input |
| | | placeholder="请è¾å
¥åæ¾ä»åº" |
| | | v-model="model.storehouse" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="unit" |
| | | label="计éåä½" |
| | | > |
| | | <a-input |
| | | placeholder="请è¾å
¥è®¡éåä½" |
| | | v-model="model.unit" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="manufacturingEnterprise" |
| | | label="å¶é ä¼ä¸" |
| | | > |
| | | <a-input |
| | | placeholder="请è¾å
¥å¶é ä¼ä¸" |
| | | v-model="model.manufacturingEnterprise" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="periodOfValidity" |
| | | label="æææ(天)" |
| | | > |
| | | <a-input-number |
| | | style="width: 100%" |
| | | :min="0" |
| | | :precision="0" |
| | | v-model="model.periodOfValidity" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="inventoryWarning" |
| | | label="åºåé¢è¦å¼" |
| | | > |
| | | <a-input-number |
| | | style="width: 100%" |
| | | :min="0" |
| | | v-model="model.inventoryWarning" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="inventoryMax" |
| | | label="æå¤§å¤è´§åºå" |
| | | > |
| | | <a-input-number |
| | | style="width: 100%" |
| | | :min="0" |
| | | v-model="model.inventoryMax" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="inventoryMin" |
| | | label="æå°å¤è´§åºå" |
| | | > |
| | | <a-input-number |
| | | style="width: 100%" |
| | | :min="0" |
| | | v-model="model.inventoryMin" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | :labelCol="{xs: { span: 24 }, sm: { span: 3 }}" |
| | | :wrapperCol="{xs: { span: 24 },sm: { span: 21 }}" |
| | | prop="remark" |
| | | label="夿³¨" |
| | | > |
| | | <a-textarea |
| | | placeholder="请è¾å
¥å¤æ³¨" |
| | | v-model="model.remark" |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction, httpAction } from '@api/manage' |
| | | import moment from "moment" |
| | | |
| | | export default { |
| | | name: "EamSparePartsModal", |
| | | data() { |
| | | return { |
| | | title: "æä½", |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 } |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | partName: [ |
| | | { required: true, message: '请è¾å
¥å¤ä»¶åç§°' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: "/eam/eamSpareParts/add", |
| | | edit: "/eam/eamSpareParts/edit", |
| | | generateRequisitionCode: "sys/sysBusinessCodeRule/generateBusinessCodeSeq" |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | add() { |
| | | const that = this |
| | | let params = { |
| | | businessCode: "SparePartCodeRule" |
| | | } |
| | | getAction(that.url.generateRequisitionCode, params).then((res) => { |
| | | if (res.success) { |
| | | this.model = { |
| | | partCode: res.result |
| | | } |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }) |
| | | //åå§åé»è®¤å¼ |
| | | that.edit(this.model); |
| | | }, |
| | | edit(record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | }, |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | this.$refs.form.clearValidate(); |
| | | }, |
| | | handleOk() { |
| | | 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; |
| | | that.close(); |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | </style> |