| | |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <div v-if="confirmDisable"> |
| | | <div v-if="approvalDisable"> |
| | | <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 管çåå®¡æ¹ |
| | | </a-divider> |
| | | <a-row :gutter="24"> |
| | |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalComment" label="确认æè§"> |
| | | <a-textarea placeholder="请è¾å
¥ç¡®è®¤æè§" v-model="model.confirmComment" |
| | | <a-textarea placeholder="请è¾å
¥ç¡®è®¤æè§" v-model="model.approvalComment" |
| | | :disabled="disableSubmit || returnDisable" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | |
| | | <!-- </a-col>--> |
| | | <!-- </a-row>--> |
| | | <!-- </div>--> |
| | | <div v-if="confirmDisable"> |
| | | <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 管çå确认 |
| | | </a-divider> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment" |
| | | label="确认æè§"> |
| | | <a-textarea placeholder="请è¾å
¥æè§" v-model="model.confirmComment" |
| | | :disabled="disableSubmit || completionDisable" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </div> |
| | | |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | @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-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <toolCombinationDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></toolCombinationDetail-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import ToolCombinationDetailModal from './modules/ToolCombinationDetailModal' |
| | | |
| | | export default { |
| | | name: "ToolCombinationDetailList", |
| | | mixins:[JeecgListMixin], |
| | | components: { ToolCombinationDetailModal }, |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | default:'', |
| | | required:false |
| | | } |
| | | }, |
| | | watch:{ |
| | | mainId:{ |
| | | immediate: true, |
| | | handler(val) { |
| | | if(!this.mainId){ |
| | | this.clearList() |
| | | }else{ |
| | | this.queryParam['combinationId'] = val |
| | | this.loadData(1); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'ç»ååè®°å½ä¸»è¡¨ç®¡ç页é¢', |
| | | disableMixinCreated:true, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title:'åæå·', |
| | | align:"center", |
| | | dataIndex: 'hiltCode' |
| | | }, |
| | | { |
| | | title: 'å·¥å
፱Ȍ', |
| | | align: 'center', |
| | | dataIndex: 'applicationType_dictText' |
| | | }, |
| | | // { |
| | | // title: 'å·¥å
·ç¼å·', |
| | | // align: 'center', |
| | | // dataIndex: 'toolId' |
| | | // }, |
| | | { |
| | | title: '䏿åç§°', |
| | | align: 'center', |
| | | dataIndex: 'chineseName' |
| | | }, |
| | | { |
| | | title: 'å·¥å
·åæ°æ è¯', |
| | | align: 'center', |
| | | dataIndex: 'paramaTableName_dictText' |
| | | }, |
| | | { |
| | | title: 'åå·/å¾å·', |
| | | align: 'center', |
| | | dataIndex: 'toolModel' |
| | | }, |
| | | { |
| | | title: 'åç±»åç§°', |
| | | align: 'center', |
| | | dataIndex: 'typeName' |
| | | }, |
| | | // { |
| | | // title: 'æä½', |
| | | // dataIndex: 'action', |
| | | // align:"center", |
| | | // fixed:"right", |
| | | // width:147, |
| | | // scopedSlots: { customRender: 'action' }, |
| | | // } |
| | | ], |
| | | url: { |
| | | list: "/tms/toolCombination/listToolCombinationDetailByMainId", |
| | | delete: "/tms/toolCombination/deleteToolCombinationDetail", |
| | | deleteBatch: "/tms/toolCombination/deleteBatchToolCombinationDetail", |
| | | exportXlsUrl: "/tms/toolCombination/exportToolCombinationDetail", |
| | | importUrl: "/tms/toolCombination/importToolCombinationDetail", |
| | | }, |
| | | dictOptions:{ |
| | | status:[], |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | importExcelUrl(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; |
| | | } |
| | | }, |
| | | methods: { |
| | | clearList(){ |
| | | this.dataSource=[] |
| | | this.selectedRowKeys=[] |
| | | this.ipagination.current = 1 |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less' |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered='false'> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class='table-page-search-wrapper'> |
| | | <a-form layout='inline' @keyup.enter.native='searchQuery'> |
| | | <a-row :gutter='24'> |
| | | <a-col :lg='7' :md='8' :sm='24' :xl='6'> |
| | | <a-form-item label='åæå·'> |
| | | <a-input v-model='queryParam.hiltCode' placeholder='请è¾å
¥åæå·'></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :lg='7' :md='8' :sm='24' :xl='6'> |
| | | <a-form-item label='ç¶æ'> |
| | | <j-dict-select-tag v-model='queryParam.status' dictCode='combined_knife_state' placeholder='è¯·éæ©ç¶æ' /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :lg='7' :md='8' :sm='24' :xl='6'> |
| | | <span class='table-page-search-submitButtons' style='float: left;overflow: hidden;'> |
| | | <a-button icon='search' type='primary' @click='searchQuery'>æ¥è¯¢</a-button> |
| | | <a-button icon='reload' style='margin-left: 8px' type='primary' @click='searchReset'>éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class='table-operator'> |
| | | <a-button icon='plus' type='primary' @click='handleAdd'>åå
·ç»è£
</a-button> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <a-table |
| | | ref='table' |
| | | :columns='columns' |
| | | :customRow='clickThenSelect' |
| | | :dataSource='dataSource' |
| | | :loading='loading' |
| | | :pagination='ipagination' |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" |
| | | :scroll='{x:true}' |
| | | bordered |
| | | class='j-table-force-nowrap' |
| | | rowKey='id' |
| | | size='middle' |
| | | @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 :preview='record.id' :src='getImgView(text)' alt='' height='25px' |
| | | 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' |
| | | icon='download' |
| | | size='small' |
| | | type='primary' |
| | | @click='downloadFile(text)'> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot='action' slot-scope='text, record'> |
| | | <a-popconfirm title='ç¡®å®æå¸å?' @confirm='() => handleDelete(record.id)'> |
| | | <a>åå
·æå¸</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <a-tabs defaultActiveKey='1'> |
| | | <a-tab-pane key='1' tab='ç»ååè®°å½'> |
| | | <ToolCombinationDetailList :mainId='toolCombinationDetailMainId' /> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | |
| | | <!-- <toolCombination-modal ref='modalForm' @ok='modalFormOk'></toolCombination-modal>--> |
| | | <inbound-order-model ref="modalForm" @ok="modalFormOk"></inbound-order-model> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import InboundOrderModel from './modules/InboundOrderModel' |
| | | // import ToolCombinationModal from './modules/ToolCombinationModal' |
| | | import { getAction } from '@/api/manage' |
| | | import ToolCombinationDetailList from './ToolCombinationDetailList' |
| | | import '@/assets/less/TableExpand.less' |
| | | |
| | | export default { |
| | | name: 'ToolCombinationList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | InboundOrderModel, |
| | | ToolCombinationDetailList, |
| | | // ToolCombinationModal |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'ç»ååè®°å½ä¸»è¡¨ç®¡ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: 'åæå·', |
| | | align: 'center', |
| | | dataIndex: 'hiltCode' |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'status_dictText' |
| | | }, |
| | | { |
| | | title: 'ç»è£
人', |
| | | align: 'center', |
| | | dataIndex: 'bindPerson' |
| | | }, |
| | | { |
| | | title: 'ç»è£
æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'bindDate', |
| | | customRender: function(text) { |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: 'æå¸äºº', |
| | | align: 'center', |
| | | dataIndex: 'disassemblePerson' |
| | | }, |
| | | { |
| | | title: 'æå¸æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'disassembleDate', |
| | | customRender: function(text) { |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/tms/toolCombination/list', |
| | | delete: '/tms/toolCombination/delete', |
| | | deleteBatch: '/tms/toolCombination/deleteBatch', |
| | | exportXlsUrl: '/tms/toolCombination/exportXls', |
| | | importExcelUrl: 'tms/toolCombination/importExcel' |
| | | }, |
| | | dictOptions: { |
| | | status: [] |
| | | }, |
| | | /* å页忰 */ |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '50'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | selectedMainId: '', |
| | | superFieldList: [], |
| | | toolCombinationDetailMainId: '' |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList() |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: { |
| | | initDictConfig() { |
| | | }, |
| | | clickThenSelect(record) { |
| | | return { |
| | | on: { |
| | | click: () => { |
| | | this.onSelectChange(record.id.split(','), [record]) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onClearSelected() { |
| | | this.selectedRowKeys = [] |
| | | this.selectionRows = [] |
| | | this.selectedMainId = '' |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | this.selectedMainId = selectedRowKeys[0] |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.selectionRows = selectionRows |
| | | this.toolCombinationDetailMainId = selectionRows[0]['id'] |
| | | }, |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1 |
| | | } |
| | | this.onClearSelected() |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | this.loading = true |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records |
| | | this.ipagination.total = res.result.total |
| | | // å表信æ¯å±ç¤º |
| | | if (this.dataSource.length !== 0) { |
| | | // å·æ°åè¡¨æ ¼ |
| | | this.selectedMainId = this.dataSource[0].id |
| | | this.selectedRowKeys.push(this.dataSource[0].id); |
| | | this.selectionRows = this.dataSource[0] |
| | | this.toolCombinationDetailMainId = this.dataSource[0].id |
| | | } else { |
| | | // å·æ°åè¡¨æ ¼ |
| | | this.toolCombinationDetailMainId = '' |
| | | } |
| | | } |
| | | if (res.code === 510) { |
| | | this.$message.warning(res.message) |
| | | } |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | getSuperFieldList() { |
| | | let fieldList = [] |
| | | fieldList.push({ type: 'string', value: 'id', text: '主é®', dictCode: '' }) |
| | | fieldList.push({ type: 'string', value: 'hiltCode', text: 'åæå·', dictCode: '' }) |
| | | fieldList.push({ type: 'string', value: 'status', text: 'ç¶æ', dictCode: 'combined_knife_state' }) |
| | | fieldList.push({ type: 'string', value: 'bindPerson', text: 'ç»è£
人', dictCode: '' }) |
| | | fieldList.push({ type: 'date', value: 'bindDate', text: 'ç»è£
æ¶é´' }) |
| | | fieldList.push({ type: 'string', value: 'disassemblePerson', text: 'æå¸äºº', dictCode: '' }) |
| | | fieldList.push({ type: 'date', value: 'disassembleDate', text: 'æå¸æ¶é´' }) |
| | | this.superFieldList = fieldList |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less' |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :visible="visible" |
| | | :fullScreen="true" |
| | | :width="1200" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | > |
| | | <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" >鿩工å
·</a-button> |
| | | <a-table |
| | | ref="table" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | @change="handleTableChange" |
| | | > |
| | | <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index"> |
| | | <div :key="col.dataIndex"> |
| | | <a-input-number |
| | | v-if="col.dataIndex == 'inStorageQuantity'" |
| | | :disabled="record.accuracyClass == '1'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | | /> |
| | | <a-select |
| | | v-if="col.dataIndex == 'goodsShelvesId'" |
| | | :disabled="disableSubmit" |
| | | :triggerChange="true" |
| | | :value="text" |
| | | show-search |
| | | :filter-option="filterOption" |
| | | style="width: 100%" |
| | | :options="locationCodeOptions" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | /> |
| | | </div> |
| | | </template> |
| | | <span slot="action" slot-scope="text, record, index"> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record, index)" :disabled="disableSubmit"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | </a-table> |
| | | <template slot="footer" v-if="disableSubmit == false"> |
| | | <a-button :style="{ marginRight: '8px' }" @click="handleCancel">å
³é</a-button> |
| | | <a-button @click="handleOk" :disabled="isDisabled" type="primary">ç¡®å®</a-button> |
| | | </template> |
| | | |
| | | <template slot="footer" v-if="disableSubmit == true"> |
| | | <a-button :style="{ marginRight: '8px' }" @click="handleCancel">å
³é</a-button> |
| | | </template> |
| | | <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal> |
| | | <!-- <j-select-return-list-modal ref="returnModalForm" @ok="modalFormOk"></j-select-return-list-modal>--> |
| | | <!-- <j-select-sharpen-list-modal ref="sharpenModalForm" @ok="modalFormOk"></j-select-sharpen-list-modal>--> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import pick from 'lodash.pick' |
| | | import JSelectToolingModal from './JSelectToolingModal' |
| | | import { ajaxGetDictItems } from '@/api/api' |
| | | import moment from 'moment' |
| | | import { getAction, postAction, requestPut } from '@/api/manage' |
| | | import JDictSelectTag from '@/components/dict/JDictSelectTag' |
| | | import JSearchSelectTag from '@/components/dict/JSearchSelectTag' |
| | | import JMultiSelectTag from '@/components/dict/JMultiSelectTag' |
| | | import { filterObj } from '@/utils/util' |
| | | // import JSelectReturnListModal from './JSelectReturnListModal' |
| | | // import JSelectSharpenListModal from './JSelectSharpenListModal' |
| | | import store from '@/store' |
| | | |
| | | export default { |
| | | name: 'InboundOrderModel', |
| | | components: { |
| | | JSelectToolingModal, |
| | | JMultiSelectTag, |
| | | JDictSelectTag, |
| | | // JSelectReturnListModal, |
| | | JSearchSelectTag, |
| | | // JSelectSharpenListModal, |
| | | store |
| | | }, |
| | | data() { |
| | | return { |
| | | /* å页忰 */ |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | isDisabled: false, |
| | | selectedRowKeys: {}, |
| | | state: { |
| | | show: false, |
| | | maintenanceValue: 1, |
| | | checkValue: 1, |
| | | maintenanceState: false, |
| | | checkState: false, |
| | | }, |
| | | inboundDate: '', |
| | | applicationDate: '', |
| | | supplierShow: false, |
| | | disableSubmit: false, |
| | | numDisable:false, |
| | | quantityDisable:false, |
| | | onlyCodeDisable:true, |
| | | toolingShow:false, |
| | | addDisable:false, |
| | | toolinngOptions:[], |
| | | title: 'æä½', |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | }, |
| | | confirmLoading: false, |
| | | loading: false, |
| | | form: this.$form.createForm(this), |
| | | dataSource: [], |
| | | toolingTreeData:[], |
| | | warehouseOptions:[], |
| | | locationOptions:[], |
| | | allToolingList:[], |
| | | param: {}, |
| | | barcodeCurrentType: false, |
| | | inboundOrderId:'', |
| | | url: { |
| | | add: '/tms/toolCombination/add/combination', |
| | | edit: '/tms/inboundOrder/edit', |
| | | toolingList:'/tms/baseTools/list', |
| | | querySharpenList:'/tms/toolLedgerDetail/list', |
| | | queryReturnList:'/tms/toolLedgerDetail/list', |
| | | detailList:'/tms/inboundDetail/list', |
| | | }, |
| | | toolingOptions:[], |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | }, |
| | | { |
| | | title: 'å·¥å
·ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'toolId' |
| | | }, |
| | | { |
| | | title: 'å·¥å
፱Ȍ', |
| | | align: 'center', |
| | | dataIndex: 'applicationType_dictText' |
| | | }, |
| | | // { |
| | | // title: 'å·¥å
·ç¼å·', |
| | | // align: 'center', |
| | | // dataIndex: 'toolId' |
| | | // }, |
| | | { |
| | | title: '䏿åç§°', |
| | | align: 'center', |
| | | dataIndex: 'chineseName' |
| | | }, |
| | | { |
| | | title: 'å·¥å
·åæ°æ è¯', |
| | | align: 'center', |
| | | dataIndex: 'paramaTableName_dictText' |
| | | }, |
| | | { |
| | | title: 'åå·/å¾å·', |
| | | align: 'center', |
| | | dataIndex: 'toolModel' |
| | | }, |
| | | { |
| | | title: 'åç±»åç§°', |
| | | align: 'center', |
| | | dataIndex: 'typeName' |
| | | }, |
| | | // { |
| | | // title: 'åºä½å·', |
| | | // align: 'center', |
| | | // dataIndex: 'goodsShelvesId', |
| | | // scopedSlots: { customRender: 'goodsShelvesId' }, |
| | | // }, |
| | | // { |
| | | // title: 'å
¥åºæ°é', |
| | | // align: 'center', |
| | | // dataIndex: 'inStorageQuantity', |
| | | // scopedSlots: { customRender: 'inStorageQuantity' }, |
| | | // }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' }, |
| | | }, |
| | | ], |
| | | locationCodeOptions:[] |
| | | } |
| | | }, |
| | | created() { |
| | | ajaxGetDictItems("tms_goods_shelves,location_code,id", null).then((res) => { |
| | | if (res.success) { |
| | | this.locationCodeOptions = res.result |
| | | } |
| | | }) |
| | | }, |
| | | methods: { |
| | | modalFormOk() { |
| | | }, |
| | | filterOption(input, option) { |
| | | return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 |
| | | }, |
| | | getQueryParams() { |
| | | this.param.pageNo = this.ipagination.current |
| | | this.param.pageSize = this.ipagination.pageSize |
| | | return filterObj(this.param) |
| | | }, |
| | | add() { |
| | | this.hafilterOptionndle = store.getters.userInfo.username |
| | | this.edit({}) |
| | | }, |
| | | edit(record) { |
| | | let that = this |
| | | this.form.resetFields() |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.isDisabled = false |
| | | this.disableSubmit = false |
| | | if (record.id) { |
| | | if(record.inStorehouseType == "1"){ |
| | | this.toolingShow = true |
| | | } |
| | | this.inboundOrderId = record.id |
| | | this.detailList(this.inboundOrderId) |
| | | } |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue( |
| | | pick(this.model, 'inboundNum', 'inStorehouseType', 'inboundTime', 'applicationReason', 'handler','approvalDate','reviewer','approvalOpinion','remark') |
| | | ) |
| | | }) |
| | | }, |
| | | handleChange(value, key, column, index) { |
| | | //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index |
| | | const temp = [...this.dataSource] |
| | | const target = temp.filter(item => key === item.key)[index]; |
| | | if (target) { |
| | | target[column.dataIndex] = value |
| | | if(column.dataIndex === 'inStorageQuantity'){ |
| | | if(target['quantity']<value){ |
| | | this.$message.error('å
¥åºæ°éä¸è½å¤§äºåºåºæ°é!') |
| | | this.isDisabled = true |
| | | }else{ |
| | | this.isDisabled = false |
| | | } |
| | | } |
| | | this.dataSource = temp |
| | | } |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.dataSource = [] |
| | | this.visible = false |
| | | this.supplierShow = false, |
| | | this.disableSubmit = false, |
| | | this.numDisable = false, |
| | | this.quantityDisable = false, |
| | | this.onlyCodeDisable = true, |
| | | this.toolingShow = false, |
| | | this.addDisable = false |
| | | }, |
| | | handleTableChange(pagination, filters, sorter) { |
| | | this.ipagination = pagination |
| | | this.detailList(this.inboundOrderId); |
| | | }, |
| | | handleOk() { |
| | | const that = this |
| | | // æ£æ¥æ°ç»æ¯å¦ä¸ºç©º |
| | | if (!this.dataSource || this.dataSource.length === 0) { |
| | | that.$message.warning('è¯·éæ©å·¥å
·') |
| | | return; |
| | | } |
| | | // éªè¯æ¯å¦æåæ |
| | | if (!this.checkHasSingleHandle()) { |
| | | that.$message.warning('è¯·éæ©ä¸æåæä¿¡æ¯') |
| | | return; |
| | | } |
| | | if (this.dataSource.length < 2) { |
| | | that.$message.warning('è¯·éæ©è³å°ä¸æåå
·') |
| | | return; |
| | | } |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true |
| | | let formData = Object.assign(this.model, values) |
| | | formData.detailData = this.dataSource |
| | | let http = '' |
| | | if(this.model.id){ |
| | | http = this.url.edit |
| | | }else{ |
| | | http = this.url.add |
| | | } |
| | | postAction(http, formData) |
| | | .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() |
| | | }, |
| | | // æ£æ¥æ¯å¦æä¸ä»
æä¸æ¡typeName为"åæ"çæ°æ® |
| | | checkHasSingleHandle() { |
| | | // å
ç¡®ä¿dataSourceæ¯æ°ç»ä¸ä¸ä¸ºç©º |
| | | if (!Array.isArray(this.dataSource) || this.dataSource.length === 0) { |
| | | return false; |
| | | } |
| | | // çéåºtypeName为"åæ"çæ¡ç® |
| | | const handleItems = this.dataSource.filter( |
| | | item => item && item.typeName === 'åæ' |
| | | ); |
| | | // æ£æ¥æ¯å¦å好æä¸æ¡ç¬¦åæ¡ä»¶çæ°æ® |
| | | return handleItems.length === 1; |
| | | }, |
| | | //鿩工å
· |
| | | selectTooling: function () { |
| | | let ids = [] |
| | | for (let i = 0; i < this.dataSource.length; i++) { |
| | | ids.push(this.dataSource[i].id) |
| | | } |
| | | this.$refs.toolingModalForm.showModal(ids) |
| | | this.$refs.toolingModalForm.title = '鿩工å
·' |
| | | this.$refs.toolingModalForm.disableSubmit = false |
| | | }, |
| | | //éæ©å½è¿å·¥å
· |
| | | selectReturnList: function () { |
| | | let ids = [] |
| | | for (let i = 0; i < this.dataSource.length; i++) { |
| | | ids.push(this.dataSource[i].id) |
| | | } |
| | | this.$refs.returnModalForm.showModal(ids) |
| | | this.$refs.returnModalForm.title = 'éæ©å½è¿å·¥å
·' |
| | | this.$refs.returnModalForm.disableSubmit = false |
| | | }, |
| | | //éæ©å磨工å
· |
| | | selectSharpenList: function () { |
| | | let ids = [] |
| | | for (let i = 0; i < this.dataSource.length; i++) { |
| | | ids.push(this.dataSource[i].id) |
| | | } |
| | | this.$refs.sharpenModalForm.showModal(ids) |
| | | this.$refs.sharpenModalForm.title = 'éæ©å磨工å
·' |
| | | this.$refs.sharpenModalForm.disableSubmit = false |
| | | }, |
| | | handleDelete(record, index) { |
| | | this.dataSource.splice(index, 1) |
| | | }, |
| | | onChange() {}, |
| | | //æé人åå¼ |
| | | selectCurrentUserChange(e) { |
| | | console.log('å½åæé', e) |
| | | // this.form.setFieldsValue({ |
| | | // // userName: e, |
| | | // userNameId: e, |
| | | // }) |
| | | }, |
| | | detailList(inboundOrderId) { |
| | | this.param.inboundOrderId = inboundOrderId |
| | | getAction(this.url.detailList, this.getQueryParams()).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records |
| | | this.ipagination.total = res.result.total; |
| | | } |
| | | }) |
| | | }, |
| | | filterOption(input, option) { |
| | | return ( |
| | | option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 |
| | | ); |
| | | }, |
| | | }, |
| | | watch: {}, |
| | | mounted() { |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | //getCurrSelected äºä»¶ æ¥æ¶ç»ä»¶ä¼ éçåæ° |
| | | for (let i = 0; i < data.length; i++) { |
| | | this.dataSource.push({ |
| | | id:data[i].id, |
| | | applicationType_dictText: data[i].applicationType_dictText, |
| | | typeName: data[i].typeName, |
| | | paramaTableName_dictText: data[i].paramaTableName_dictText, |
| | | toolCodeId: data[i].toolCodeId, |
| | | toolId: data[i].toolId, |
| | | chineseName: data[i].chineseName, |
| | | toolModel: data[i].toolModel, |
| | | applicationType: data[i].applicationTypeName, |
| | | onlyCode:data[i].onlyCode, |
| | | quantity:data[i].quantity, |
| | | inStorageQuantity:data[i].storageQuantity || data[i].quantity || 1, |
| | | accuracyClass:data[i].accuracyClass |
| | | }) |
| | | } |
| | | //this.ipaginationm.total = this.dataSource.length |
| | | }) |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | |
| | | <style lang="less" 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; |
| | | } |
| | | |
| | | /deep/ .notshow { |
| | | display: none; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!--æ¯æå
¨å±ç¼©æ¾--> |
| | | <j-modal |
| | | :visible="visible" |
| | | :title="title" |
| | | switchFullscreen |
| | | :width="1200" |
| | | @ok="handleSubmit" |
| | | @cancel="close" |
| | | style="top: 50px" |
| | | cancelText="å
³é" |
| | | > |
| | | <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.toolCode"></a-input> |
| | | </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.chineseName"></a-input> |
| | | </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.toolModel"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <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-row> |
| | | </a-form> |
| | | </div> |
| | | <!--å·¥å
·å表--> |
| | | <a-table |
| | | ref="table" |
| | | :scroll="scrollTrigger" |
| | | size="middle" |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :rowSelection="rowSelection" |
| | | :loading="loading" |
| | | @change="handleTableChange" |
| | | > |
| | | </a-table> |
| | | </a-card> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { filterObj } from '@/utils/util' |
| | | import { getAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'JSelectToolingModal', |
| | | components: {}, |
| | | props: { |
| | | classifyId:{ |
| | | type:String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | queryParam: {}, |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | }, |
| | | { |
| | | title: 'å·¥å
·ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'toolId' |
| | | }, |
| | | { |
| | | title: 'å·¥å
፱Ȍ', |
| | | align: 'center', |
| | | dataIndex: 'applicationType_dictText' |
| | | }, |
| | | // { |
| | | // title: 'å·¥å
·ç¼å·', |
| | | // align: 'center', |
| | | // dataIndex: 'toolId' |
| | | // }, |
| | | { |
| | | title: '䏿åç§°', |
| | | align: 'center', |
| | | dataIndex: 'chineseName' |
| | | }, |
| | | { |
| | | title: 'å·¥å
·åæ°æ è¯', |
| | | align: 'center', |
| | | dataIndex: 'paramaTableName_dictText' |
| | | }, |
| | | { |
| | | title: 'åå·/å¾å·', |
| | | align: 'center', |
| | | dataIndex: 'toolModel' |
| | | }, |
| | | { |
| | | title: 'åå·/å¾å·', |
| | | align: 'center', |
| | | dataIndex: 'toolModel' |
| | | }, |
| | | { |
| | | title: 'åç±»åç§°', |
| | | align: 'center', |
| | | dataIndex: 'typeName' |
| | | }, |
| | | ], |
| | | selectedRowKeys: [], |
| | | oldSlelectRows: [], |
| | | scrollTrigger: {}, |
| | | dataSource: [], |
| | | selectionRows: [], |
| | | title: 'æ ¹æ®æ¥è¯¢ç»æéæ©å·¥å
·', |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['5', '10', '20'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0, |
| | | }, |
| | | isorter: { |
| | | column: 'toolCode', |
| | | order: 'desc', |
| | | }, |
| | | departTree: [], |
| | | visible: false, |
| | | loading: false, |
| | | url: { |
| | | // list: '/base/tooling/list', |
| | | list: '/tms/baseTools/listWithSharpedAndConfig/combination' |
| | | }, |
| | | } |
| | | }, |
| | | computed: { |
| | | rowSelection() { |
| | | return { |
| | | type: 'checkbox', |
| | | onChange: (selectedRowKeys, selectedRows) => { |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.onSelectChange(selectedRows) |
| | | }, |
| | | getCheckboxProps: (record) => ({ |
| | | props: { |
| | | disabled: record.distable, |
| | | }, |
| | | }), |
| | | selectedRowKeys: this.selectedRowKeys, |
| | | } |
| | | }, |
| | | }, |
| | | watch: {}, |
| | | created() {}, |
| | | methods: { |
| | | async loadData(arg) { |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1 |
| | | } |
| | | let that = this |
| | | this.loading = true |
| | | let params = this.getQueryParams() //æ¥è¯¢æ¡ä»¶ |
| | | params.classifyId = this.classifyId |
| | | await getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | for (let i = 0; i < res.result.records.length; i++) { |
| | | if (that.oldSlelectRows.indexOf(res.result.records[i].id) > -1) { |
| | | res.result.records[i].distable = true |
| | | } else { |
| | | res.result.records[i].distable = false |
| | | } |
| | | } |
| | | this.dataSource = res.result.records |
| | | this.ipagination.total = res.result.total |
| | | } |
| | | if (res.code === 510) { |
| | | this.$message.warning(res.message) |
| | | } |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | showModal(oldSlelectRows) { |
| | | this.oldSlelectRows = oldSlelectRows |
| | | this.visible = true |
| | | this.loadData(1) |
| | | }, |
| | | getQueryParams() { |
| | | let param = Object.assign({}, this.queryParam, this.isorter) |
| | | param.field = this.getQueryField() |
| | | param.pageNo = this.ipagination.current |
| | | param.pageSize = this.ipagination.pageSize |
| | | return filterObj(param) |
| | | }, |
| | | //æ¥è¯¢æ¡ä»¶å¤ç |
| | | getQueryField() { |
| | | let str = 'id,' |
| | | for (let a = 0; a < this.columns.length; a++) { |
| | | str += ',' + this.columns[a].dataIndex |
| | | } |
| | | return str |
| | | }, |
| | | searchReset(num) { |
| | | let that = this |
| | | if (num !== 0) { |
| | | that.loadData(1) |
| | | } |
| | | that.selectborrowIds = [] |
| | | }, |
| | | close() { |
| | | this.searchReset(0) |
| | | this.selectedRowKeys = [] |
| | | this.visible = false |
| | | }, |
| | | handleTableChange(pagination, filters, sorter) { |
| | | //TODO çé |
| | | if (Object.keys(sorter).length > 0) { |
| | | this.isorter.column = sorter.field |
| | | this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc' |
| | | } |
| | | this.ipagination = pagination |
| | | this.loadData() |
| | | }, |
| | | handleSubmit() { |
| | | this.$bus.$emit('selectionRows', this.selectionRows) |
| | | this.searchReset(0) |
| | | this.close() |
| | | }, |
| | | onSelectChange(selectionRows) { |
| | | this.selectionRows = selectionRows |
| | | }, |
| | | onSearch() { |
| | | this.loadData(1) |
| | | }, |
| | | searchQuery() { |
| | | this.loadData(1); |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.loadData(1) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-table-tbody .ant-table-row td { |
| | | padding-top: 10px; |
| | | padding-bottom: 10px; |
| | | } |
| | | |
| | | #components-layout-demo-custom-trigger .trigger { |
| | | font-size: 18px; |
| | | line-height: 64px; |
| | | padding: 0 24px; |
| | | cursor: pointer; |
| | | transition: color 0.3s; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :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> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="åæå·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hiltCode"> |
| | | <a-input v-model="model.hiltCode"placeholder="请è¾å
¥åæå·" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ç»ååid" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="combinationId"> |
| | | <a-input v-model="model.combinationId"placeholder="请è¾å
¥ç»ååid" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="åå
·å¯ä¸ç¼ç " :labelCol="labelCol" :wrapperCol="wrapperCol" prop="onlyCode"> |
| | | <a-input v-model="model.onlyCode"placeholder="请è¾å
¥åå
·å¯ä¸ç¼ç " ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | export default { |
| | | name: "ToolCombinationDetailModal", |
| | | components: { |
| | | }, |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | required:false, |
| | | default:'' |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | title:"æä½", |
| | | width:800, |
| | | visible: false, |
| | | model:{ |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | }, |
| | | url: { |
| | | add: "/tms/toolCombination/addToolCombinationDetail", |
| | | edit: "/tms/toolCombination/editToolCombinationDetail", |
| | | } |
| | | |
| | | } |
| | | }, |
| | | created () { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | }, |
| | | close () { |
| | | this.$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'; |
| | | } |
| | | this.model['combinationId'] = this.mainId |
| | | 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> |