印尼海亮一期
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

651 lines
22 KiB

<template>
<div class="app-container">
<!-- 出库管理 -->
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="模糊查询">
<el-input
v-model="query.bill_code"
size="mini"
clearable
placeholder="单据号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="所属仓库">
<el-select
v-model="query.stor_id"
multiple
collapse-tags
clearable
size="mini"
placeholder="全部"
class="filter-item"
>
<el-option
v-for="item in storlist"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="生成方式">
<el-select
v-model="query.create_mode"
clearable
size="mini"
placeholder="生成方式"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_CREATE_MODE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>-->
<el-form-item label="单据状态">
<el-select
v-model="query.bill_status"
multiple
collapse-tags
clearable
size="mini"
placeholder="单据状态"
class="filter-item"
>
<el-option
v-for="item in dict.io_bill_status"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="业务类型">
<el-select
v-model="query.bill_type"
multiple
collapse-tags
clearable
filterable
size="mini"
placeholder="业务类型"
class="filter-item"
>
<el-option
v-for="item in dict.ST_INV_OUT_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="交货单号">
<el-input
v-model="query.vbeln"
size="mini"
clearable
placeholder="交货单号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="木箱号">
<el-input
v-model="query.box_no"
size="mini"
clearable
placeholder="木箱号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="子卷批次">
<el-input
v-model="query.pcsn"
size="mini"
clearable
placeholder="子卷批次"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="sap批次">
<el-input
v-model="query.sap_pcsn"
size="mini"
clearable
placeholder="sap批次"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="客户搜索">
<el-input
v-model="query.cust_code"
size="mini"
clearable
placeholder="编码、名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="发货幅宽">
<el-input
v-model="query.width"
size="mini"
clearable
placeholder="幅宽"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="是否回传">
<el-select
v-model="query.is_upload"
clearable
size="mini"
placeholder="是否回传"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.is_upload"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@change="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
:disabled="dis_flag"
@click="divOpen"
>
分配
</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
:disabled="work_flag"
icon="el-icon-position"
size="mini"
@click="taskOpen"
>
作业任务
</el-button>
<el-button
slot="right"
v-permission="permission.confirm"
class="filter-item"
:loading="loadingConfirm"
type="warning"
:disabled="confirm_flag"
icon="el-icon-check"
size="mini"
@click="confirm"
>
强制确认
</el-button>
<el-button
slot="right"
class="filter-item"
:loading="loadingConfirm"
type="warning"
:disabled="business_confirm_flag"
icon="el-icon-check"
size="mini"
@click="confirm"
>
业务强制确认
</el-button>
<el-button
slot="right"
class="filter-item"
:loading="loadingConfirm"
type="warning"
:disabled="outReturn_flag"
icon="el-icon-check"
size="mini"
@click="outReturn"
>
质量报告回传
</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-check"
size="mini"
@click="downdtl"
>
导出Excel
</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-check"
size="mini"
@click="Import"
>
导入运费
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
size="mini"
:data="crud.data"
style="width: 100%;"
:highlight-current-row="true"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column
v-permission="['admin','checkoutbill:del','checkoutbill:edit']"
label="操作"
width="250"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
:data="scope.row"
style="display: inline"
:permission="permission"
:disabled-edit="canUd(scope.row)"
:disabled-dle="canUd(scope.row)"
/>
<el-button
type="text"
icon="el-icon-upload"
@click="openMoney(scope.row)"
>
发货信息
</el-button>
<el-button
type="text"
icon="el-icon-printer"
@click="printExcel(scope.row)"
>
打印
</el-button>
</template>
</el-table-column>
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :formatter="stateFormat" width="80" prop="bill_status" label="单据状态" />
<el-table-column show-overflow-tooltip prop="stor_name" label="仓库" width="80" />
<el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" label="业务类型" />
<el-table-column show-overflow-tooltip width="100" prop="biz_date" label="业务日期" />
<el-table-column show-overflow-tooltip label="明细数" align="center" prop="detail_count" width="60" />
<el-table-column show-overflow-tooltip label="计划重量" align="center" prop="total_qty" width="100" :formatter="crud.formatNum3" />
<el-table-column show-overflow-tooltip label="实际重量" align="center" prop="plan_qty" width="100" :formatter="crud.formatNum3" />
<el-table-column show-overflow-tooltip label="收货地址" align="center" prop="total_qty" width="100">
<template slot-scope="scope">
{{ scope.row.bill_type === '1004' ? scope.row.out_stor_name : scope.row.receiptaddress }}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip label="客户" align="center" prop="cust_simple_name" width="100" />
<el-table-column show-overflow-tooltip label="客户编码" align="center" prop="cust_code" width="100" />
<el-table-column show-overflow-tooltip label="交货单号" align="center" prop="vbeln" width="100" />
<el-table-column show-overflow-tooltip label="是否回传" align="center" prop="is_upload" width="80" :formatter="formatIsUpload" />
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="100" />
<el-table-column show-overflow-tooltip :formatter="isOverdue" prop="is_overdue" label="是否超期发货('否'为正常库存发货)" width="220" />
<el-table-column show-overflow-tooltip label="备注" align="center" prop="remark" width="100" />
<el-table-column show-overflow-tooltip label="制单人" align="center" prop="input_optname" />
<el-table-column show-overflow-tooltip label="制单时间" align="center" prop="input_time" width="140" />
<el-table-column show-overflow-tooltip label="修改人" align="center" prop="update_optname" />
<el-table-column show-overflow-tooltip label="修改时间" align="center" prop="update_time" width="140" />
<el-table-column show-overflow-tooltip label="分配人" align="center" prop="dis_optname" />
<el-table-column show-overflow-tooltip label="分配时间" align="center" prop="dis_time" width="140" />
<el-table-column show-overflow-tooltip label="确认人" align="center" prop="confirm_optname" />
<el-table-column show-overflow-tooltip label="确认时间" align="center" prop="confirm_time" width="140" />
</el-table>
<!--分页组件-->
<pagination />
</div>
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<DivDialog :dialog-show.sync="divShow" :open-array="openParam" :stor-id="storId" :rowmst="mstrow" @DivChanged="querytable" />
<TaskDialog :dialog-show.sync="taskShow" :open-array="openParam" :rowmst="mstrow" @TaskChanged="querytable" />
<MoneyDialog :dialog-show.sync="openMoneyDialog" :open-param-money="openParamMoney" />
<UploadDialog :dialog-show.sync="uploadDialogShow" @tableChanged="tableChanged"/>
</div>
</template>
<script>
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import AddDialog from '@/views/wms/st/outbill/AddDialog'
import MoneyDialog from '@/views/wms/st/outbill/MoneyDialog'
import UploadDialog from '@/views/wms/st/outbill/UploadDialog'
import DivDialog from '@/views/wms/st/outbill/DivDialog'
import TaskDialog from '@/views/wms/st/outbill/TaskDialog'
import ViewDialog from '@/views/wms/st/outbill/ViewDialog'
import { download } from '@/api/data'
import { downloadFile } from '@/utils'
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
const start = new Date()
export default {
name: 'Checkoutbill',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DivDialog, TaskDialog, MoneyDialog, UploadDialog },
cruds() {
return CRUD({ title: '用户', idField: 'iostorinv_id', url: 'api/checkoutbill', crudMethod: { ...checkoutbill },
optShow: {
add: true,
edit: false,
del: false,
reset: true,
download: false
},
queryOnPresenterCreated: false
})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['io_bill_status', 'ST_CREATE_MODE', 'ST_INV_OUT_TYPE', 'is_upload', 'IS_OR_NOT'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
permission: {
add: ['admin', 'checkoutbill:add'],
edit: ['admin', 'checkoutbill:edit'],
del: ['admin', 'checkoutbill:del'],
confirm: ['admin', 'checkoutbill:confirm']
},
openMoneyDialog: false,
loadingConfirm: false,
divShow: false,
taskShow: false,
dis_flag: true,
work_flag: true,
confirm_flag: true,
business_confirm_flag: true,
outReturn_flag: true,
openParam: [],
openParamMoney: null,
mstrow: {},
viewShow: false,
uploadDialogShow: false,
currentRow: null,
checkrows: [],
storlist: [],
billtypelist: [],
storId: null
}
},
mounted: function() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
},
created() {
crudUserStor.getUserStor().then(res => {
this.storlist = res
})
this.initQuery()
},
methods: {
/* 搜索框创建时间默认最近一周*/
initQuery() {
const end = new Date()
const start = new Date()
const endYear = end.getFullYear()
var endMonth = end.getMonth() + 1
if (end.getMonth() + 1 < 10) {
endMonth = '0' + endMonth.toString()
}
var endDay = end.getDate()
if (end.getDate() < 10) {
endDay = '0' + endDay.toString()
}
const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59'
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
const startYear = start.getFullYear()
var startMonth = start.getMonth() + 1
if (start.getMonth() + 1 < 10) {
startMonth = '0' + startMonth.toString()
}
var startDay = start.getDate()
if (start.getDate() < 10) {
startDay = '0' + startDay.toString()
}
const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00'
this.$set(this.query, 'createTime', [startDate, endDate])
this.crud.toQuery()
},
canUd(row) {
return row.bill_status !== '10'
},
toView(index, row) {
this.mstrow = row
this.viewShow = true
},
[CRUD.HOOK.beforeRefresh]() {
this.handleCurrentChange(null)
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
this.buttonChange(row)
} else if (val.length === 1) {
this.buttonChange(row)
} else {
this.handleCurrentChange(null)
}
},
onSelectAll() {
this.$refs.table.clearSelection()
this.handleCurrentChange(null)
},
buttonChange(current) {
if (current !== null) {
this.currentRow = current
if (current.bill_status === '10' || current.bill_status === '30' || current.bill_status === '40') {
this.dis_flag = false
} else {
this.dis_flag = true
}
if (current.bill_status === '30' || current.bill_status === '40') {
this.work_flag = false
} else {
this.work_flag = true
}
if (current.bill_status === '50' || current.bill_status === '40' || current.bill_status === '30') {
this.confirm_flag = false
} else {
this.confirm_flag = true
}
if (current.bill_type === '1006' || current.bill_type === '1003') {
this.business_confirm_flag = false
} else {
this.business_confirm_flag = true
}
if (current.bill_status === '40' || current.bill_status === '30') {
this.outReturn_flag = false
} else {
this.outReturn_flag = true
}
}
},
stateFormat(row) {
return this.dict.label.io_bill_status[row.bill_status]
},
bill_typeFormat(row) {
return this.dict.label.ST_INV_OUT_TYPE[row.bill_type]
},
create_modeFormat(row) {
return this.dict.label.ST_CREATE_MODE[row.create_mode]
},
isOverdue(row) {
return this.dict.label.IS_OR_NOT[row.is_overdue]
},
handleCurrentChange(current) {
if (current === null) {
this.dis_flag = true
this.confirm_flag = true
this.work_flag = true
this.outReturn_flag = true
this.currentRow = {}
}
},
checkboxT(row) {
return row.bill_status !== '99'
},
divOpen() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
debugger
this.openParam = res
this.storId = this.currentRow.stor_id
this.divShow = true
this.mstrow = this.currentRow
})
},
taskOpen() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.openParam = res
this.taskShow = true
this.mstrow = this.currentRow
})
},
confirm() {
this.loadingConfirm = true
checkoutbill.confirm({ 'iostorinv_id': this.currentRow.iostorinv_id, 'stor_id': this.currentRow.stor_id }).then(res => {
this.querytable()
this.crud.notify('出库成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.loadingConfirm = false
}).catch(() => {
this.loadingConfirm = false
})
},
outReturn() {
alert('点击确认按钮后,单据进行回传!')
checkoutbill.outReturn(this.currentRow).then(res => {
this.crud.notify('回传成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.querytable()
})
},
querytable() {
this.onSelectAll()
this.crud.toQuery()
this.handleCurrentChange(null)
},
openMoney(row) {
this.openParamMoney = row
this.openMoneyDialog = true
},
formatIsUpload(row) {
if (row.is_upload === '0') {
return '否'
} else if (row.is_upload === '1') {
return '是'
}
},
printExcel(jo) {
/*if (jo.bill_type !== '1004' && jo.bill_type !== '1009') {
if (jo.shd_dtl_num === '') {
return this.crud.notify('客户为空!', CRUD.NOTIFICATION_TYPE.INFO)
}
}*/
/* if (jo.bill_type === '1004' || jo.bill_type === '1009') {
jo.shd_dtl_num = 44
}*/
jo.shd_dtl_num = 44
checkoutbill.getDisNum({ 'iostorinv_id': jo.iostorinv_id }).then(res => {
const j = Math.ceil(res.num / jo.shd_dtl_num)
debugger
for (let i = 0; i < j; i++) {
download('/api/checkoutbill/downloadExcel', { 'iostorinv_id': jo.iostorinv_id, 'j': i, 'pageNum': j }).then(result => {
downloadFile(result, '发货单', 'xlsx')
crud.downloadLoading = false
}).catch(() => {
crud.downloadLoading = false
})
}
})
},
downdtl() {
/* const data = {
'bill_code': this.crud.query.bill_code,
'buss_type': this.crud.query.buss_type,
'io_type': this.crud.query.io_type,
'is_upload': this.crud.query.is_upload,
'pcsn': this.crud.query.pcsn,
'material_code': this.crud.query.material_code,
}*/
if (this.crud.query.createTime !== undefined) {
this.query.begin_time = this.crud.query.createTime[0]
this.query.end_time = this.crud.query.createTime[1]
}
crud.downloadLoading = true
download('/api/checkoutbill/download', this.crud.query).then(result => {
debugger
downloadFile(result, '发货', 'xlsx')
crud.downloadLoading = false
}).catch(() => {
crud.downloadLoading = false
})
},
Import() {
this.uploadDialogShow = true
},
tableChanged() {
this.crud.toQuery()
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
</style>