| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <a-card :bordered="false" style="flex: 1;overflow:auto;max-height: 600px; min-height: 600px"> |
| | | <!-- 查询区域 --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | |
| | | :sm="8" |
| | | > |
| | | <a-form-item |
| | | label="工具编号" |
| | | label="工具编码" |
| | | :labelCol="{span: 5}" |
| | | :wrapperCol="{span: 18, offset: 1}" |
| | | > |
| | |
| | | <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-button @click="handleInbound(nodeSelected)" type="primary" icon="plus">申请单入库</a-button> |
| | | <a-button @click="handleInbound" type="primary">申请单入库</a-button> |
| | | </div> |
| | | |
| | | <!-- table区域-begin --> |
| | |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}" |
| | | class="j-table-force-nowrap" |
| | | :customRow="customRow" |
| | | @change="handleTableChange"> |
| | | |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">编辑</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详情</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
| | | <a>删除</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a |
| | | href="javascript:;" |
| | | @click="handlePrint(record)" |
| | | >打印二维码</a> |
| | | </span> |
| | | |
| | | </a-table> |
| | |
| | | </a-tabs> |
| | | |
| | | <inbound-model ref="modalForm" @ok="modalFormOk" :nodeSelected="nodeSelected"></inbound-model> |
| | | <inbound-apply-model-list ref="inboundApplyModelList"></inbound-apply-model-list> |
| | | <div id="printArea" style="display: block;"> |
| | | <div v-for="(item, index) in qrList" :key="index" class="qrcode-item"> |
| | | <p>{{ item.onlyCode }}</p> |
| | | <p>{{ item.toolName }}</p> |
| | | <img :src="item.base64" alt="QR Code"> |
| | | </div> |
| | | </div> |
| | | </a-card> |
| | | </template> |
| | | |
| | |
| | | import ParaCommonToolList from '.././baseTools/ParaCommonToolList' |
| | | import ParaBladeList from '.././baseTools/ParaBladeList' |
| | | import InboundModel from './InboundModel' |
| | | import InboundApplyModelList from './InboundApplyModelList.vue' |
| | | import printJS from 'print-js'; |
| | | |
| | | export default { |
| | | name: 'InboundListRight', |
| | |
| | | ParaTurningToolsList, |
| | | ParaCommonToolList, |
| | | ParaBladeList, |
| | | InboundModel |
| | | InboundModel, |
| | | InboundApplyModelList |
| | | }, |
| | | data () { |
| | | return { |
| | |
| | | /* 分页参数 */ |
| | | ipagination:{ |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '50'], |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " 共" + total + "条" |
| | | }, |
| | |
| | | dataIndex: 'toolCode' |
| | | }, |
| | | { |
| | | title:'工具编号', |
| | | align:"center", |
| | | dataIndex: 'onlyCode' |
| | | }, |
| | | { |
| | | title:'入库类型', |
| | | align:"center", |
| | | dataIndex: 'inStorehouseType' |
| | | dataIndex: 'inStorehouseTypeName' |
| | | }, |
| | | { |
| | | title:'型号/图号', |
| | |
| | | { |
| | | title:'入库数量', |
| | | align:"center", |
| | | dataIndex: 'inStorageQuantity' |
| | | dataIndex: 'inNumber' |
| | | }, |
| | | // { |
| | | // title:'备注', |
| | |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/tms/inboundDetail/list", |
| | | list: "/tms/inStoreDetail/list", |
| | | paraHolesToolsList:"/tms/baseTools/paraHolesToolsList", |
| | | paraCommonToolList:"/tms/baseTools/paraCommonToolList", |
| | | paraThreadingToolList:"/tms/baseTools/paraThreadingToolList", |
| | |
| | | exportXlsUrl: "/tms/baseTools/exportXls", |
| | | importExcelUrl: "tms/baseTools/importExcel", |
| | | queryParaByToolCode:"/tms/baseTools/queryByToolCode", |
| | | queryByToolCode:"/tms/toolsConfigProperty/queryByToolCode" |
| | | queryByToolCode:"/tms/toolsConfigProperty/queryByToolCode", |
| | | print:'/tms/inStoreDetail/print' |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | nodeSelected: {}, // 当前选中的节点数据 |
| | | paraTypeFlag:'', |
| | | disableMixinCreated:true |
| | | disableMixinCreated:true, |
| | | qrList: [] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | } |
| | | // 打开新增模态框,并传递当前选中的节点 |
| | | this.$refs.modalForm.add(this.nodeSelected); |
| | | this.$refs.modalForm.title = "新增通用参数类型工具"; |
| | | this.$refs.modalForm.title = "新增工具入库"; |
| | | this.$refs.modalForm.disableSubmit = false; |
| | | }, |
| | | |
| | | handleInbound() { |
| | | this.$refs.inboundApplyModelList.show(); |
| | | }, |
| | | handleDelete(id) { |
| | | deleteAction(this.url.delete, {id: id}).then((res) => { |
| | |
| | | this.$bus.$emit('queryTreeData') //刷新左侧树 |
| | | }, |
| | | |
| | | onSelectChange(selectedRowKeys) { |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | | click: () => { |
| | | this.onSelectChange(record.id.split(","), [record]); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | onSelectChange(selectedRowKeys,selectionRows) { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.selectionRows = selectionRows |
| | | //通过id查询管理参数和参数数据 |
| | | getAction(this.url.queryParaByToolCode, { toolCode: this.selectedRowKeys[0],paraTypeFlag:this.paraTypeFlag}).then((res) => { |
| | | getAction(this.url.queryParaByToolCode, { toolCode: this.selectionRows[0].toolCodeId,paraTypeFlag:this.paraTypeFlag}).then((res) => { |
| | | if (res.success) { |
| | | if(this.paraTypeFlag === "1"){ |
| | | this.$refs.paraCommonToolList.getPara(res.result); |
| | |
| | | this.$message.warning(res.message); |
| | | } |
| | | }) |
| | | getAction(this.url.queryByToolCode, { toolCode: this.selectedRowKeys[0]}).then((res) => { |
| | | getAction(this.url.queryByToolCode, { toolCode: this.selectionRows[0].toolCodeId}).then((res) => { |
| | | if (res.success) { |
| | | this.$refs.toolsConfigPropertyList.getPara(res.result); |
| | | } else { |
| | |
| | | if (res.success) { |
| | | this.dataSource = res.result.records; // 更新表格数据 |
| | | this.ipagination.total = res.result.total |
| | | //默认选中第一条数据 |
| | | this.selectedRowKeys[0] = res.result.records[0].id |
| | | this.selectionRows = res.result.records |
| | | this.onSelectChange(this.selectedRowKeys,this.selectionRows) |
| | | } else { |
| | | this.$message.warning("请选择叶子节点进行查询"); |
| | | //this.$message.warning("请选择叶子节点进行查询"); |
| | | this.ipagination.total = 0 |
| | | } |
| | | }) |
| | |
| | | this.loading = false; |
| | | }); |
| | | } else { |
| | | this.$message.warning("请选择叶子节点进行查询"); |
| | | //this.$message.warning("请选择叶子节点进行查询"); |
| | | } |
| | | }, |
| | | onClearSelected() { |
| | |
| | | this.$refs.paraTurningToolsList.visable = false |
| | | this.$refs.paraBladeList.visable = false |
| | | this.$refs.toolsConfigPropertyList.visable = false |
| | | } |
| | | }, |
| | | handlePrint(record){ |
| | | this.loading = true |
| | | getAction(this.url.print, {onlyCode:record.onlyCode}) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | this.qrList = res.result.map((content, i) => ({ |
| | | onlyCode:res.result[i].onlyCode, |
| | | toolName:res.result[i].toolName, |
| | | base64: res.result[i].image |
| | | })); |
| | | this.handleBacthPrint(); |
| | | this.$emit('ok', new Date()) |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false |
| | | this.close() |
| | | }) |
| | | }, |
| | | // 执行打印 |
| | | handleBacthPrint() { |
| | | this.$nextTick(() => { |
| | | printJS({ |
| | | printable: 'printArea', |
| | | type: 'html', |
| | | style: ` |
| | | .qrcode-item { |
| | | page-break-inside: avoid; |
| | | margin: 10px; |
| | | text-align: center; |
| | | } |
| | | img { width: 100px; height: 100px; } |
| | | `, |
| | | scanStyles: false |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | } |