|  |  |  | 
|---|
|  |  |  | <div class="main_app"> | 
|---|
|  |  |  | <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" /> | 
|---|
|  |  |  | <div class="mt20"> | 
|---|
|  |  |  | <el-button type="primary" @click="handleEx()" v-permissions="['business:ywpatrolline:create']">导出</el-button> | 
|---|
|  |  |  | <el-button @click="handleEx()" v-permissions="['business:ywoutinboundrecord:exportExcel']">导出</el-button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <el-table v-loading="loading" :data="list" stripe> | 
|---|
|  |  |  | <el-table-column prop="platformName" label="单据日期" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="platformName" label="资产编码" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="platformGroupName" label="资产名称" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="carCodeFront" label="资产分类" min-width="100" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="carCodeBack" label="数量" min-width="80" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="param1" label="类型" min-width="80" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="workTime" label="仓库" min-width="90" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="workTime" label="单据编号" min-width="120" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="workTime" label="创建人" min-width="80" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="workTime" label="创建时间" min-width="140" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="doneDate" label="单据日期" min-width="90" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="materialCode" label="物料编码" min-width="90" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="materialName" label="物料名称" min-width="90" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="carCodeFront" label="物料分类" min-width="120" show-overflow-tooltip> | 
|---|
|  |  |  | <template v-slot="{ row }"> | 
|---|
|  |  |  | <span>{{ row.categoryParentName }}/{{ row.categoryName }}</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="carCodeBack" label="数量" min-width="80" show-overflow-tooltip> | 
|---|
|  |  |  | <template v-slot="{ row }"> | 
|---|
|  |  |  | <span>{{ row.stock }}{{ row.materialUnitName }}</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="param1" label="类型" min-width="70" show-overflow-tooltip> | 
|---|
|  |  |  | <template v-slot="{ row }"> | 
|---|
|  |  |  | <span v-if="row.type || row.type == 0">{{ StoreTypeOps[row.type].name }}</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="warehouseName" label="仓库" min-width="90" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="code" label="单据编号" min-width="140"> | 
|---|
|  |  |  | <template v-slot="{ row }"> | 
|---|
|  |  |  | <span class="primaryColor pointer" @click='detailClick(row)'>{{ row.code }}</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="createUserName" label="创建人" min-width="80" show-overflow-tooltip /> | 
|---|
|  |  |  | <el-table-column prop="createDate" label="创建时间" min-width="140" show-overflow-tooltip /> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | <div class="mt20"> | 
|---|
|  |  |  | <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!--  --> | 
|---|
|  |  |  | <OutDetail v-if="isShowOutDetail" ref="OutDetailRef" /> | 
|---|
|  |  |  | <InDetail v-if="isShowInDetail" ref="InDetailRef" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import Pagination from '@/components/common/Pagination' | 
|---|
|  |  |  | import QueryForm from '@/components/common/QueryForm' | 
|---|
|  |  |  | import InDetail from './components/InDetail' | 
|---|
|  |  |  | import OutDetail from './components/OutDetail.vue' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import dayjs from 'dayjs' | 
|---|
|  |  |  | import duration from 'dayjs/plugin/duration' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | dayjs.extend(duration) | 
|---|
|  |  |  | import { platformLogPage, getPlatformGroupList } from '@/api' | 
|---|
|  |  |  | import { ywOutinboundRecord, ywOutinboundRecordEx } from '@/api' | 
|---|
|  |  |  | import { fetchList as getStoreList } from '@/api/ywWarehouse' | 
|---|
|  |  |  | import { StoreTypeOps } from './components/config' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | components: { | 
|---|
|  |  |  | Pagination, | 
|---|
|  |  |  | QueryForm | 
|---|
|  |  |  | QueryForm, | 
|---|
|  |  |  | InDetail, | 
|---|
|  |  |  | OutDetail | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | loading: false, | 
|---|
|  |  |  | isShowInDetail: false, | 
|---|
|  |  |  | isShowOutDetail: false, | 
|---|
|  |  |  | pagination: { | 
|---|
|  |  |  | pageSize: 10, | 
|---|
|  |  |  | page: 1, | 
|---|
|  |  |  | 
|---|
|  |  |  | filters: {}, | 
|---|
|  |  |  | list: [], | 
|---|
|  |  |  | total: 0, | 
|---|
|  |  |  | StoreTypeOps, | 
|---|
|  |  |  | queryFormConfig: { | 
|---|
|  |  |  | formItems: [ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | filed: 'carCodeFront', | 
|---|
|  |  |  | filed: 'materialCode', | 
|---|
|  |  |  | type: 'input', | 
|---|
|  |  |  | label: '资产编码', | 
|---|
|  |  |  | label: '物料编码', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | filed: 'platformGroupId', | 
|---|
|  |  |  | filed: 'warehouseId', | 
|---|
|  |  |  | type: 'select', | 
|---|
|  |  |  | labelCode: 'name', | 
|---|
|  |  |  | valueCode: 'id', | 
|---|
|  |  |  | label: '所在仓库', | 
|---|
|  |  |  | options: [] | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | filed: 'carCodeFront', | 
|---|
|  |  |  | filed: 'code', | 
|---|
|  |  |  | type: 'input', | 
|---|
|  |  |  | label: '单据编号', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | filed: 'platformGroupId', | 
|---|
|  |  |  | filed: 'type', | 
|---|
|  |  |  | type: 'select', | 
|---|
|  |  |  | label: '单据类型', | 
|---|
|  |  |  | options: [] | 
|---|
|  |  |  | labelCode: 'name', | 
|---|
|  |  |  | valueCode: 'id', | 
|---|
|  |  |  | options: StoreTypeOps | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | filed: 'selDate', | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | filed: 'selTime', | 
|---|
|  |  |  | type: 'daterange', | 
|---|
|  |  |  | type: 'datetimerange', | 
|---|
|  |  |  | label: '创建时间', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | created() { | 
|---|
|  |  |  | // this.getList() | 
|---|
|  |  |  | // this.getGroupList() | 
|---|
|  |  |  | this.getList() | 
|---|
|  |  |  | this.initData() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | handleSub() { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleEx() { }, | 
|---|
|  |  |  | getGroupList() { | 
|---|
|  |  |  | getPlatformGroupList({ queryData: 0, queryType: 0 }).then(res => { | 
|---|
|  |  |  | this.queryFormConfig.formItems[1].options = res.map(i => { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | value: i.id, | 
|---|
|  |  |  | label: i.name | 
|---|
|  |  |  | } | 
|---|
|  |  |  | detailClick(item) { | 
|---|
|  |  |  | const index = item.code.indexOf('RK') | 
|---|
|  |  |  | if(index > -1){ | 
|---|
|  |  |  | this.isShowInDetail = true | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.InDetailRef.visible = true | 
|---|
|  |  |  | this.$refs.InDetailRef.getDetail(item.outInBoundId) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | // this.queryFormConfig.formItems[1].options.unshift({ value: '', label: '全部月台组' }) | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | this.isShowOutDetail = true | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.OutDetailRef.visible = true | 
|---|
|  |  |  | this.$refs.OutDetailRef.getDetail(item.outInBoundId) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleEx() { | 
|---|
|  |  |  | this.$dialog.exportConfirm('确认导出吗?') | 
|---|
|  |  |  | .then(() => { | 
|---|
|  |  |  | this.loading = true | 
|---|
|  |  |  | ywOutinboundRecordEx({ | 
|---|
|  |  |  | page: this.pagination.page, | 
|---|
|  |  |  | capacity: 1000000, | 
|---|
|  |  |  | model: this.filters | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .then(response => { | 
|---|
|  |  |  | this.download(response) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$tip.apiFailed(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.loading = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(() => { }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | initData() { | 
|---|
|  |  |  | getStoreList({ capacity: 9999, page: 1, model: {} }).then(res => { | 
|---|
|  |  |  | this.queryFormConfig.formItems[1].options = res.records || [] | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getList(page) { | 
|---|
|  |  |  | const { pagination, filters } = this | 
|---|
|  |  |  | this.loading = true | 
|---|
|  |  |  | platformLogPage({ | 
|---|
|  |  |  | if (filters.selDate && filters.selDate.length > 0) { | 
|---|
|  |  |  | filters.doneDateStart = filters.selDate[0] | 
|---|
|  |  |  | filters.doneDateEnd = filters.selDate[1] | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | filters.doneDateStart = null | 
|---|
|  |  |  | filters.doneDateEnd = null | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (filters.selTime && filters.selTime.length > 0) { | 
|---|
|  |  |  | filters.createDateStart = filters.selTime[0] | 
|---|
|  |  |  | filters.createDateEnd = filters.selTime[1] | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | filters.createDateStart = null | 
|---|
|  |  |  | filters.createDateEnd = null | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(page){ | 
|---|
|  |  |  | pagination.page = page | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ywOutinboundRecord({ | 
|---|
|  |  |  | model: { | 
|---|
|  |  |  | ...filters, | 
|---|
|  |  |  | queryStatus: '6,7,8', | 
|---|
|  |  |  | beginWorkDateStart: filters.selDate && filters.selDate.length > 0 ? filters.selDate[0] : null, | 
|---|
|  |  |  | beginWorkDateEnd: filters.selDate && filters.selDate.length > 0 ? filters.selDate[1] : null, | 
|---|
|  |  |  | ...filters | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | sorts: [{ direction: 'DESC', property: 'param1' }], | 
|---|
|  |  |  | capacity: pagination.pageSize, | 
|---|
|  |  |  | page: page || pagination.page, | 
|---|
|  |  |  | page: pagination.page, | 
|---|
|  |  |  | }).then(res => { | 
|---|
|  |  |  | this.loading = false | 
|---|
|  |  |  | this.list = res.records || [] | 
|---|
|  |  |  | this.list.forEach(item => { | 
|---|
|  |  |  | item.inTypeTemp = item.inType == 0 ? '整托盘' : '件烟' | 
|---|
|  |  |  | item.taskOrigin = 'WMS获取' | 
|---|
|  |  |  | item.workTime = dayjs.duration(item.param3, 'seconds').format('H时m分s秒') | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.pagination.total = res.total || 0 | 
|---|
|  |  |  | }, () => { | 
|---|
|  |  |  | this.loading = false | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleSizeChange(capacity) { | 
|---|
|  |  |  | this.pagination.pageSize = capacity | 
|---|
|  |  |  | this.getList() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|