¶Ô±ÈÐÂÎļþ |
| | |
| | | <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 |
| | | :md="5" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="ä»åºç¼å·"> |
| | | <a-select |
| | | show-search |
| | | :filter-option="filterOption" |
| | | placeholder="请è¾å
¥ä»åºç¼å·" |
| | | v-model="queryParam.warehouseId" |
| | | :options="warehouseOptions" |
| | | @change="warehouseChange" |
| | | ></a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="5" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="è´§æ¶ç¼å·"> |
| | | <a-select |
| | | show-search |
| | | :filter-option="filterOption" |
| | | placeholder="请è¾å
¥è´§æ¶ç¼å·" |
| | | v-model="queryParam.goodsShelves" |
| | | :options="goodsShelvesOptions" |
| | | @change="goodsShelvesChange" |
| | | ></a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="5" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="屿°"> |
| | | <a-select |
| | | show-search |
| | | :filter-option="filterOption" |
| | | placeholder="请è¾å
¥å±æ°" |
| | | v-model="queryParam.storey" |
| | | :options="storeyOptions" |
| | | ></a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-space> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload">éç½®</a-button> |
| | | </a-space> |
| | | </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('tms_goods_shelves_mark')">导åº</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>--> |
| | | <!-- é«çº§æ¥è¯¢åºå --> |
| | | <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> |
| | | <!-- <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="null" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <goods-shelves-mark-modal ref="modalForm" @ok="modalFormOk"></goods-shelves-mark-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import GoodsShelvesMarkModal from './modules/GoodsShelvesMarkModal' |
| | | import { getAction } from '../../api/manage' |
| | | |
| | | export default { |
| | | name: 'GoodsShelvesMarkList', |
| | | mixins:[JeecgListMixin, mixinDevice], |
| | | components: { |
| | | GoodsShelvesMarkModal |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'tms_goods_shelves_mark', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title:'ä»åºç¼å·', |
| | | align:"center", |
| | | dataIndex: 'warehouseId', |
| | | customRender:function (text,r) { |
| | | return r.warehouseNum + '/' + r.warehouseName |
| | | } |
| | | }, |
| | | { |
| | | title:'è´§æ¶ç¼å·', |
| | | align:"center", |
| | | dataIndex: 'goodsShelves', |
| | | customRender:function (text,r) { |
| | | return r.goodsShelves + '/' + r.shelfName |
| | | } |
| | | }, |
| | | { |
| | | title:'屿°', |
| | | align:"center", |
| | | dataIndex: 'storey' |
| | | }, |
| | | { |
| | | title:'åç§(åæ¾åå
·åç§ä¿¡æ¯)', |
| | | align:"center", |
| | | dataIndex: 'variety' |
| | | }, |
| | | { |
| | | title:'å建人', |
| | | align:"center", |
| | | dataIndex: 'createBy' |
| | | }, |
| | | { |
| | | title:'å建æ¶é´', |
| | | align:"center", |
| | | dataIndex: 'createTime' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/tms/goodsShelvesMark/list", |
| | | queryWarehouseDictList: '/tms/warehouse/queryWarehouseDictList', |
| | | queryGoodsShelvesDictList: '/tms/goodsShelves/queryGoodsShelvesDictList', |
| | | queryGoodsShelvesStoreyDictList: '/tms/goodsShelves/queryGoodsShelvesStoreyDictList', |
| | | delete: "/tms/goodsShelvesMark/delete", |
| | | deleteBatch: "/tms/goodsShelvesMark/deleteBatch", |
| | | exportXlsUrl: "/tms/goodsShelvesMark/exportXls", |
| | | importExcelUrl: "tms/goodsShelvesMark/importExcel", |
| | | |
| | | }, |
| | | warehouseId: '', |
| | | warehouseOptions: [], |
| | | goodsShelvesOptions: [], |
| | | storeyOptions: [], |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | getAction(this.url.queryWarehouseDictList, null).then((res)=>{ |
| | | if(res.success){ |
| | | this.warehouseOptions = res.result |
| | | } |
| | | }) |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.warehouseId = '' |
| | | this.goodsShelvesOptions = [] |
| | | this.storeyOptions = [] |
| | | this.loadData(1); |
| | | }, |
| | | warehouseChange(warehouseId) { |
| | | this.goodsShelvesOptions = [] |
| | | this.storeyOptions = [] |
| | | this.warehouseId = warehouseId |
| | | getAction(this.url.queryGoodsShelvesDictList, {warehouseId: warehouseId}).then(res => { |
| | | if (res.success) { |
| | | this.goodsShelvesOptions = res.result |
| | | } |
| | | }) |
| | | }, |
| | | goodsShelvesChange(shelfNumber) { |
| | | this.storeyOptions = [] |
| | | getAction(this.url.queryGoodsShelvesStoreyDictList, { |
| | | warehouseId: this.warehouseId, |
| | | shelfNumber: shelfNumber |
| | | }).then(res => { |
| | | if (res.success) { |
| | | this.storeyOptions = res.result |
| | | } |
| | | }) |
| | | }, |
| | | filterOption(input, option) { |
| | | return ( |
| | | option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 |
| | | ); |
| | | }, |
| | | initDictConfig(){ |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'string',value:'warehouseId',text:'ä»åºç¼å·',dictCode:''}) |
| | | fieldList.push({type:'string',value:'goodsShelves',text:'è´§æ¶ç¼å·',dictCode:''}) |
| | | fieldList.push({type:'string',value:'storey',text:'屿°ä¿¡æ¯',dictCode:''}) |
| | | fieldList.push({type:'string',value:'variety',text:'åç§-æ æ³¨åæ¾åå
·åç§ä¿¡æ¯',dictCode:''}) |
| | | fieldList.push({type:'string',value:'createBy',text:'å建人',dictCode:''}) |
| | | fieldList.push({type:'date',value:'createTime',text:'å建æ¶é´'}) |
| | | this.superFieldList = fieldList |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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="warehouseId"> |
| | | <a-select :disabled="editDisabled" show-search :filterOption="filterOption" :options="warehouseOptions" @change="warehouseChange" v-model="model.warehouseId" placeholder="请è¾å
¥ä»åºç¼å·" ></a-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="è´§æ¶ç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsShelves"> |
| | | <a-select :disabled="editDisabled" show-search :filterOption="filterOption" :options="goodsShelvesOptions" @change="goodsShelvesChange" v-model="model.goodsShelves" placeholder="请è¾å
¥è´§æ¶ç¼å·" ></a-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="屿°ä¿¡æ¯" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="storey"> |
| | | <a-select :disabled="editDisabled" show-search :filterOption="filterOption" :options="storeyOptions" v-model="model.storey" placeholder="请è¾å
¥å±æ°ä¿¡æ¯" ></a-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="åç§(åæ¾åå
·åç§ä¿¡æ¯)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="variety"> |
| | | <a-input v-model="model.variety" 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: 'GoodsShelvesMarkForm', |
| | | components: { |
| | | }, |
| | | props: { |
| | | //表åç¦ç¨ |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: '', |
| | | required: false |
| | | }, |
| | | }, |
| | | data () { |
| | | return { |
| | | model:{ |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | warehouseId: [ |
| | | { required: true, message: 'è¯·éæ©ä»åº!'}, |
| | | ], |
| | | goodsShelves: [ |
| | | { required: true, message: 'è¯·éæ©è´§æ¶!'}, |
| | | ], |
| | | storey: [ |
| | | { required: true, message: 'è¯·éæ©å±!'}, |
| | | { validator: this.validateDuplicate } |
| | | ], |
| | | variety: [ |
| | | { required: true, message: '请è¾å
¥åç§ä¿¡æ¯!'} |
| | | ] |
| | | }, |
| | | url: { |
| | | add: "/tms/goodsShelvesMark/add", |
| | | queryWarehouseDictList: '/tms/warehouse/queryWarehouseDictList', |
| | | queryGoodsShelvesDictList: '/tms/goodsShelves/queryGoodsShelvesDictList', |
| | | queryGoodsShelvesStoreyDictList: '/tms/goodsShelves/queryGoodsShelvesStoreyDictList', |
| | | edit: "/tms/goodsShelvesMark/edit", |
| | | queryById: "/tms/goodsShelvesMark/queryById", |
| | | duplicateCheckSelect: '/tms/goodsShelvesMark/duplicateCheckSelect' |
| | | }, |
| | | editDisabled: false, |
| | | warehouseOptions: [], |
| | | goodsShelvesOptions: [], |
| | | storeyOptions: [] |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled(){ |
| | | return this.disabled |
| | | }, |
| | | }, |
| | | created () { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | validateDuplicate(rule, value, callback) { |
| | | getAction(this.url.duplicateCheckSelect, { |
| | | warehouseId: this.model.warehouseId, |
| | | goodsShelves: this.model.goodsShelves, |
| | | storey: this.model.storey, |
| | | }).then(res => { |
| | | if (res.success) { |
| | | if (this.title === 'æ°å¢' && res.result.length > 0) { |
| | | callback(new Error('è¯¥è´§æ¶æå¨å±æ ç¾ä¿¡æ¯å·²åå¨!')) |
| | | } |
| | | if (this.title === 'ç¼è¾' && res.result.length > 0) { |
| | | const result = res.result.filter(item => item.id !== this.model.id) |
| | | if (result.length > 0) { |
| | | callback(new Error('è¯¥è´§æ¶æå¨å±æ ç¾ä¿¡æ¯å·²åå¨!')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | callback() |
| | | } else { |
| | | callback(new Error(res.message)) |
| | | } |
| | | }) |
| | | }, |
| | | warehouseChange(warehouseId) { |
| | | this.goodsShelvesOptions = [] |
| | | this.storeyOptions = [] |
| | | this.warehouseId = warehouseId |
| | | getAction(this.url.queryGoodsShelvesDictList, {warehouseId: warehouseId}).then(res => { |
| | | if (res.success) { |
| | | this.goodsShelvesOptions = res.result |
| | | } |
| | | }) |
| | | }, |
| | | goodsShelvesChange(shelfNumber) { |
| | | this.storeyOptions = [] |
| | | getAction(this.url.queryGoodsShelvesStoreyDictList, { |
| | | warehouseId: this.warehouseId, |
| | | shelfNumber: shelfNumber |
| | | }).then(res => { |
| | | if (res.success) { |
| | | this.storeyOptions = res.result |
| | | } |
| | | }) |
| | | }, |
| | | filterOption(input, option) { |
| | | return ( |
| | | option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 |
| | | ); |
| | | }, |
| | | add () { |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | edit (record) { |
| | | getAction(this.url.queryWarehouseDictList, null).then((res)=>{ |
| | | if(res.success){ |
| | | this.warehouseOptions = res.result |
| | | } |
| | | }) |
| | | getAction(this.url.queryGoodsShelvesDictList, { warehouseId: record.warehouseId }).then(res => { |
| | | if (res.success) { |
| | | this.goodsShelvesOptions = res.result |
| | | } |
| | | }) |
| | | getAction(this.url.queryGoodsShelvesStoreyDictList, { warehouseId: record.warehouseId, shelfNumber: record.goodsShelves }).then(res => { |
| | | if (res.success) { |
| | | this.storeyOptions = res.result |
| | | } |
| | | }) |
| | | if (this.title === 'æ°å¢' || this.title === '详æ
') { |
| | | this.editDisabled = false |
| | | } |
| | | if (this.title === 'ç¼è¾') { |
| | | this.editDisabled = true |
| | | } |
| | | 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <goods-shelves-mark-form ref="realForm" @ok="submitCallback" :title="title" :disabled="disableSubmit"></goods-shelves-mark-form> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import GoodsShelvesMarkForm from './GoodsShelvesMarkForm' |
| | | export default { |
| | | name: 'GoodsShelvesMarkModal', |
| | | components: { |
| | | GoodsShelvesMarkForm |
| | | }, |
| | | data () { |
| | | return { |
| | | title:'', |
| | | width:896, |
| | | 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> |