¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <!-- <div class="table-operator" v-if="mainId">--> |
| | | <!-- <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" |
| | | bordered |
| | | rowKey="id" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="null" |
| | | @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> |
| | | |
| | | <preparationOrderDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></preparationOrderDetail-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import PreparationOrderDetailModal from './modules/preparationOrder/PreparationOrderDetailModal' |
| | | |
| | | export default { |
| | | name: "PreparationOrderDetailList", |
| | | mixins:[JeecgListMixin], |
| | | components: { PreparationOrderDetailModal }, |
| | | props:{ |
| | | mainId:{ |
| | | type:String, |
| | | default:'', |
| | | required:false |
| | | } |
| | | }, |
| | | watch:{ |
| | | mainId:{ |
| | | immediate: true, |
| | | handler(val) { |
| | | if(!this.mainId){ |
| | | this.clearList() |
| | | }else{ |
| | | this.queryParam['preparationOrderId'] = 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:"left", |
| | | dataIndex: 'toolNum' |
| | | }, |
| | | { |
| | | title:'å·¥å
፱Ȍ', |
| | | align:"center", |
| | | dataIndex: 'applicationType_dictText' |
| | | }, |
| | | { |
| | | title:'䏿åç§°', |
| | | align:"center", |
| | | dataIndex: 'chineseName' |
| | | }, |
| | | { |
| | | title:'åå·/å¾å·', |
| | | align:"left", |
| | | dataIndex: 'toolModel' |
| | | }, |
| | | { |
| | | title:'åå
·ææ', |
| | | align:"center", |
| | | dataIndex: 'toolMaterial' |
| | | }, |
| | | { |
| | | title:'é¶ä»¶ææ', |
| | | align:"center", |
| | | dataIndex: 'partMaterial' |
| | | }, |
| | | { |
| | | title:'åå®¶', |
| | | align:"center", |
| | | dataIndex: 'supplierId' |
| | | }, |
| | | { |
| | | title:'åºåºæ°é', |
| | | align:"left", |
| | | dataIndex: 'outboundQuantity', |
| | | scopedSlots: { customRender: 'outboundQuantity' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/tms/preparationOrder/listPreparationOrderDetailByMainId", |
| | | delete: "/tms/preparationOrder/deletePreparationOrderDetail", |
| | | deleteBatch: "/tms/preparationOrder/deleteBatchPreparationOrderDetail", |
| | | exportXlsUrl: "/tms/preparationOrder/exportPreparationOrderDetail", |
| | | importUrl: "/tms/preparationOrder/importPreparationOrderDetail", |
| | | }, |
| | | dictOptions:{ |
| | | } |
| | | } |
| | | }, |
| | | 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 :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="åå¤åç¼å·"> |
| | | <a-input placeholder="请è¾å
¥åå¤åç¼å·" v-model="queryParam.preparationOrderNum"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="åæ®ç¶æ"> |
| | | <a-select placeholder="请è¾å
¥åå¤åç¼å·" v-model="queryParam.orderStatus"> |
| | | <a-select-option value="1">å¾
å®¡æ ¸</a-select-option> |
| | | <a-select-option value="2">å·²å®¡æ ¸</a-select-option> |
| | | <a-select-option value="3">已转åº</a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | <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 @click="handleConvert" type="primary" icon="arrow-right">转åºåºç³è¯·å</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>--> |
| | | <!-- é«çº§æ¥è¯¢åºå --> |
| | | <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> |
| | | </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" |
| | | bordered |
| | | rowKey="id" |
| | | class="j-table-force-nowrap" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}" |
| | | :customRow="clickThenSelect" |
| | | @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="handleDetail(record)">详æ
</a> |
| | | <span v-if="record.orderStatus === '1'"> |
| | | <a-divider type="vertical" /> |
| | | <a @click="handleConfirm(record)">å®¡æ ¸</a> |
| | | <a-divider type="vertical" /> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | |
| | | <!-- <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> |
| | | |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane tab="åå
·åå¤åæç»" key="1" > |
| | | <PreparationOrderDetailList :mainId="preparationOrderDetailMainId" /> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | |
| | | <preparationOrder-modal ref="modalForm" @ok="modalFormOk"></preparationOrder-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import PreparationOrderModal from './modules/preparationOrder/PreparationOrderModal' |
| | | import { getAction } from '@/api/manage' |
| | | import PreparationOrderDetailList from './PreparationOrderDetailList' |
| | | import '@/assets/less/TableExpand.less' |
| | | import { postAction } from '../../api/manage' |
| | | |
| | | export default { |
| | | name: "PreparationOrderList", |
| | | mixins:[JeecgListMixin], |
| | | components: { |
| | | PreparationOrderDetailList, |
| | | PreparationOrderModal |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'åå
·åå¤å管ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title:'åå¤åç¼å·', |
| | | align:"left", |
| | | dataIndex: 'preparationOrderNum' |
| | | }, |
| | | { |
| | | title:'é¶ä»¶å¾å·', |
| | | align:"center", |
| | | dataIndex: 'partDrawingNo' |
| | | }, |
| | | { |
| | | title:'é¶ä»¶åç§°', |
| | | align:"center", |
| | | dataIndex: 'partName' |
| | | }, |
| | | { |
| | | title:'é¶ä»¶ææ', |
| | | align:"center", |
| | | dataIndex: 'partMaterial' |
| | | }, |
| | | { |
| | | title:'å·¥åº', |
| | | align:"center", |
| | | dataIndex: 'productionProcessesNo' |
| | | }, |
| | | { |
| | | title:'å å·¥æ¹æ¬¡', |
| | | align:"center", |
| | | dataIndex: 'batchCode' |
| | | }, |
| | | { |
| | | title:'å å·¥æ°é', |
| | | align:"left", |
| | | dataIndex: 'machiningCount' |
| | | }, |
| | | { |
| | | title:'å 工设å¤', |
| | | align:"center", |
| | | dataIndex: 'equipmentCode' |
| | | }, |
| | | { |
| | | title:'ç¨åºå', |
| | | align:"center", |
| | | dataIndex: 'ncName' |
| | | }, |
| | | { |
| | | title:'ååç¶æ', |
| | | align:"center", |
| | | dataIndex: 'orderStatus_dictText' |
| | | }, |
| | | { |
| | | title:'æäº¤æ¶é´(æäº¤è³åºåºç³è¯·)', |
| | | align:"center", |
| | | dataIndex: 'outboundTime' |
| | | }, |
| | | { |
| | | title:'夿³¨', |
| | | align:"center", |
| | | dataIndex: 'remark' |
| | | }, |
| | | { |
| | | title:'å建人', |
| | | align:"center", |
| | | dataIndex: 'createBy' |
| | | }, |
| | | { |
| | | title:'å建æ¶é´(DNCæ¨éæ¶é´)', |
| | | align:"center", |
| | | dataIndex: 'createTime' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/tms/preparationOrder/list", |
| | | convertToOutboundOrder: "/tms/preparationOrder/convertToOutboundOrder", |
| | | delete: "/tms/preparationOrder/delete", |
| | | deleteBatch: "/tms/preparationOrder/deleteBatch", |
| | | exportXlsUrl: "/tms/preparationOrder/exportXls", |
| | | importExcelUrl: "tms/preparationOrder/importExcel", |
| | | }, |
| | | dictOptions:{ |
| | | }, |
| | | /* å页忰 */ |
| | | 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:[], |
| | | preparationOrderDetailMainId: '', |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | } |
| | | }, |
| | | methods: { |
| | | handleConvert() { |
| | | if (this.selectedRowKeys.length < 1) { |
| | | this.$message.warning('请è³å°éæ©ä¸æ¡ç³è¯·åæ°æ®ï¼') |
| | | return |
| | | } |
| | | console.log(this.selectionRows) |
| | | console.log(this.selectedRowKeys) |
| | | postAction(this.url.convertToOutboundOrder, this.selectedRowKeys).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success(res.message) |
| | | this.loadData(this.ipagination.current) |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | handleConfirm(record) { |
| | | this.$refs.modalForm.edit(record); |
| | | this.$refs.modalForm.title = "å®¡æ ¸"; |
| | | this.$refs.modalForm.disableSubmit = false; |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.preparationOrderDetailMainId = '' |
| | | this.loadData(1) |
| | | }, |
| | | initDictConfig(){ |
| | | }, |
| | | clickThenSelect(record) { |
| | | return { |
| | | on: { |
| | | click: () => { |
| | | this.onClickChange(record.id.split(","), [record]); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onClickChange(selectedRowKeys, selectionRows) { |
| | | this.preparationOrderDetailMainId = selectionRows[0]['id'] |
| | | }, |
| | | onClearSelected() { |
| | | this.selectedRowKeys = []; |
| | | this.selectionRows = []; |
| | | this.selectedMainId='' |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | this.selectedMainId=selectedRowKeys[0] |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.selectionRows = selectionRows; |
| | | }, |
| | | 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(res.code===510){ |
| | | this.$message.warning(res.message) |
| | | } |
| | | this.loading = false; |
| | | }) |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'string',value:'preparationOrderNum',text:'åå¤åç¼å·',dictCode:''}) |
| | | fieldList.push({type:'string',value:'partDrawingNo',text:'é¶ä»¶å¾å·',dictCode:''}) |
| | | fieldList.push({type:'string',value:'partName',text:'é¶ä»¶åç§°',dictCode:''}) |
| | | fieldList.push({type:'string',value:'partMaterial',text:'é¶ä»¶ææ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'productionProcessesNo',text:'å·¥åºï¼å·¥æ¥å·ï¼',dictCode:''}) |
| | | fieldList.push({type:'string',value:'batchCode',text:'å å·¥æ¹æ¬¡',dictCode:''}) |
| | | fieldList.push({type:'string',value:'machiningCount',text:'å å·¥æ°é',dictCode:''}) |
| | | fieldList.push({type:'string',value:'equipmentCode',text:'å 工设å¤',dictCode:''}) |
| | | fieldList.push({type:'string',value:'ncName',text:'ç¨åºå',dictCode:''}) |
| | | fieldList.push({type:'BigDecimal',value:'outboundQuantity',text:'åå¤ååºåºæ°é',dictCode:''}) |
| | | fieldList.push({type:'string',value:'orderStatus',text:'ååç¶æ;1.æªå®¡æ ¸ï¼2.è°æºåå·²å®¡æ ¸ï¼3.已转åºåºç³è¯·',dictCode:''}) |
| | | fieldList.push({type:'date',value:'outboundTime',text:'åå¤åæäº¤æ¶é´;æäº¤è³åºåºç³è¯·åçæ¶é´'}) |
| | | fieldList.push({type:'string',value:'remark',text:'夿³¨',dictCode:''}) |
| | | fieldList.push({type:'string',value:'createBy',text:'å建人',dictCode:''}) |
| | | fieldList.push({type:'date',value:'createTime',text:'å建æ¶é´;DNCæ¨éæ°æ®æ¶é´'}) |
| | | this.superFieldList = fieldList |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less' |
| | | </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="preparationOrderId"> |
| | | <a-input v-model="model.preparationOrderId"placeholder="请è¾å
¥åå¤åå·" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="åå
·ç¼ç " :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolCode"> |
| | | <a-input v-model="model.toolCode"placeholder="请è¾å
¥åå
·ç¼ç " ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="åå
·ç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolId"> |
| | | <a-input v-model="model.toolId"placeholder="请è¾å
¥åå
·ç¼å·" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ç³è¯·åºåºæ°é" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outboundQuantity"> |
| | | <a-input-number v-model="model.outboundQuantity"placeholder="请è¾å
¥ç³è¯·åºåºæ°é" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="ç§æ·å·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tenantId"> |
| | | <a-input v-model="model.tenantId"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: "PreparationOrderDetailModal", |
| | | 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/preparationOrder/addPreparationOrderDetail", |
| | | edit: "/tms/preparationOrder/editPreparationOrderDetail", |
| | | } |
| | | |
| | | } |
| | | }, |
| | | 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['preparationOrderId'] = 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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="12"> |
| | | <a-form-model-item label="åå¤åç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="preparationOrderNum"> |
| | | <a-input v-model="model.preparationOrderNum" placeholder="请è¾å
¥åå¤åç¼å·" disabled></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="é¶ä»¶å¾å·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partDrawingNo"> |
| | | <a-input v-model="model.partDrawingNo" placeholder="请è¾å
¥é¶ä»¶å¾å·" disabled></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="é¶ä»¶åç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partName"> |
| | | <a-input v-model="model.partName" placeholder="请è¾å
¥é¶ä»¶åç§°" disabled></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="é¶ä»¶ææ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partMaterial"> |
| | | <a-input v-model="model.partMaterial" placeholder="请è¾å
¥é¶ä»¶ææ" disabled></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å·¥åºï¼å·¥æ¥å·ï¼" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionProcessesNo"> |
| | | <a-input v-model="model.productionProcessesNo" placeholder="请è¾å
¥å·¥åºï¼å·¥æ¥å·ï¼" disabled></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å å·¥æ¹æ¬¡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchCode"> |
| | | <a-input v-model="model.batchCode" placeholder="请è¾å
¥å å·¥æ¹æ¬¡" disabled></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å 工设å¤" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentCode"> |
| | | <a-input v-model="model.equipmentCode" placeholder="请è¾å
¥å 工设å¤" disabled></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="ç¨åºå" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ncName"> |
| | | <a-input v-model="model.ncName" placeholder="请è¾å
¥ç¨åºå" disabled></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å å·¥æ°é" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="machiningCount"> |
| | | <a-input v-model="model.machiningCount" placeholder="请è¾å
¥å å·¥æ°é" disabled></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="夿³¨" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> |
| | | <a-textarea :disable="disableSubmit" v-model="model.remark" placeholder="请è¾å
¥å¤æ³¨" ></a-textarea> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :scroll="{x:true}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="null"> |
| | | |
| | | <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 === 'outboundQuantity'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | | /> |
| | | </div> |
| | | </template> |
| | | <span slot="action" v-if="disableSubmit === false" slot-scope="text, record, index"> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record, index)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </a-spin> |
| | | |
| | | <template slot="footer"> |
| | | <a-button :style="{ marginRight: '8px' }" @click="handleCancel">å
³é</a-button> |
| | | <a-button @click="handleOk" v-if="disableSubmit === false" type="primary">ç¡®å®</a-button> |
| | | </template> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | import { getAction } from '../../../../api/manage' |
| | | |
| | | export default { |
| | | name: "PreparationOrderModal", |
| | | components: { |
| | | }, |
| | | data () { |
| | | return { |
| | | title: "æä½", |
| | | width: 1200, |
| | | visible: false, |
| | | model:{ |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | loading: false, |
| | | dataSource: [], |
| | | /* å页忰 */ |
| | | ipagination:{ |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " å
±" + total + "æ¡" |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title:'å·¥å
·ç¼ç ', |
| | | align:"left", |
| | | dataIndex: 'toolNum' |
| | | }, |
| | | { |
| | | title:'å·¥å
፱Ȍ', |
| | | align:"center", |
| | | dataIndex: 'applicationType_dictText' |
| | | }, |
| | | { |
| | | title:'䏿åç§°', |
| | | align:"center", |
| | | dataIndex: 'chineseName' |
| | | }, |
| | | { |
| | | title:'åå·/å¾å·', |
| | | align:"left", |
| | | dataIndex: 'toolModel' |
| | | }, |
| | | { |
| | | title:'åå
·ææ', |
| | | align:"center", |
| | | dataIndex: 'toolMaterial' |
| | | }, |
| | | { |
| | | title:'é¶ä»¶ææ', |
| | | align:"center", |
| | | dataIndex: 'partMaterial' |
| | | }, |
| | | { |
| | | title:'åå®¶', |
| | | align:"center", |
| | | dataIndex: 'supplierId' |
| | | }, |
| | | { |
| | | title:'åºåºæ°é', |
| | | align:"left", |
| | | dataIndex: 'outboundQuantity', |
| | | scopedSlots: { customRender: 'outboundQuantity' } |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | ], |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | outboundQuantity: [ |
| | | { required: true, message: '请è¾å
¥åå¤ååºåºæ°é!'}, |
| | | ], |
| | | orderStatus: [ |
| | | { required: true, message: '请è¾å
¥ååç¶æ;1.æªå®¡æ ¸ï¼2.è°æºåå·²å®¡æ ¸ï¼3.已转åºåºç³è¯·!'}, |
| | | ], |
| | | outboundTime: [ |
| | | { required: true, message: '请è¾å
¥åå¤åæäº¤æ¶é´;æäº¤è³åºåºç³è¯·åçæ¶é´!'}, |
| | | ], |
| | | }, |
| | | url: { |
| | | list: "/tms/preparationOrder/listPreparationOrderDetailByMainId", |
| | | add: "/tms/preparationOrder/add", |
| | | edit: "/tms/preparationOrder/editTotal", |
| | | delete: "/tms/preparationOrder/deletePreparationOrderDetail" |
| | | } |
| | | |
| | | } |
| | | }, |
| | | created () { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | handleChange(value, key, column, index) { |
| | | console.log(value, key, column, index) |
| | | const temp = [...this.dataSource] |
| | | const target = temp.filter(item => key === item.key)[index]; |
| | | if (target) { |
| | | target[column.dataIndex] = value |
| | | this.dataSource = temp |
| | | if(column.dataIndex === 'outboundQuantity'){ |
| | | if(target['quantity']<value){ |
| | | this.$message.error('ç³è¯·åºåºæ°éä¸è½å¤§äºå¯ç¨åºå!') |
| | | this.isDisabled = true |
| | | }else{ |
| | | this.isDisabled = false |
| | | } |
| | | } |
| | | this.dataSource = temp |
| | | } |
| | | }, |
| | | add () { |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | getAction(this.url.list, { preparationOrderId: record.id}).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) |
| | | } |
| | | }) |
| | | this.visible = true; |
| | | }, |
| | | handleDelete(record, index) { |
| | | deleteAction(this.url.delete, { id: record.id }).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource.splice(index, 1); |
| | | this.$message.success(res.message) |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }); |
| | | }, |
| | | 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 = ''; |
| | | this.model.preparationOrderDetailList = this.dataSource |
| | | if(!this.model.id){ |
| | | httpurl+=this.url.add; |
| | | method = 'post'; |
| | | }else{ |
| | | httpurl+=this.url.edit; |
| | | method = 'put'; |
| | | if (this.title === 'å®¡æ ¸') { |
| | | this.model.orderStatus = '2'; |
| | | } |
| | | } |
| | | console.log(this.model) |
| | | 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> |