Files
longdianningxing/lms/nladmin-ui/src/views/wms/st/outbill/index.vue

366 lines
11 KiB
Vue
Raw Normal View History

2022-10-08 13:44:33 +08:00
<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"
2022-10-25 18:43:38 +08:00
label-width="80px"
2022-10-08 13:44:33 +08:00
label-suffix=":"
>
2022-10-25 18:43:38 +08:00
<el-form-item label="模糊查询">
2022-10-08 13:44:33 +08:00
<el-input
v-model="query.bill_code"
2022-10-25 18:43:38 +08:00
size="mini"
2022-10-08 13:44:33 +08:00
clearable
2022-10-25 18:43:38 +08:00
placeholder="出库单号"
2022-10-08 13:44:33 +08:00
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
2022-10-25 18:43:38 +08:00
<el-form-item label="所属仓库">
<el-select
v-model="query.stor_id"
2022-10-08 13:44:33 +08:00
clearable
2022-10-25 18:43:38 +08:00
size="mini"
placeholder="全部"
2022-10-08 13:44:33 +08:00
class="filter-item"
2022-10-25 18:43:38 +08:00
@change="crud.toQuery"
>
<el-option
v-for="item in storlist"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id"
/>
</el-select>
2022-10-08 13:44:33 +08:00
</el-form-item>
2022-10-25 18:43:38 +08:00
<el-form-item label="创建时间">
<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"
2022-10-08 13:44:33 +08:00
/>
</el-form-item>
2022-10-25 18:43:38 +08:00
<el-form-item label="生成方式">
<el-select
v-model="query.create_mode"
2022-10-08 13:44:33 +08:00
clearable
2022-10-25 18:43:38 +08:00
size="mini"
placeholder="生成方式"
2022-10-08 13:44:33 +08:00
class="filter-item"
2022-10-25 18:43:38 +08:00
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_CREATE_MODE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
2022-10-08 13:44:33 +08:00
</el-form-item>
2022-10-25 18:43:38 +08:00
2022-10-08 13:44:33 +08:00
<el-form-item label="单据状态">
<el-select
v-model="query.bill_status"
clearable
size="mini"
2022-10-25 18:43:38 +08:00
placeholder="单据状态"
2022-10-08 13:44:33 +08:00
class="filter-item"
2022-10-25 18:43:38 +08:00
@change="crud.toQuery"
2022-10-08 13:44:33 +08:00
>
<el-option
2022-10-25 18:43:38 +08:00
v-for="item in dict.io_bill_status"
:key="item.value"
2022-10-08 13:44:33 +08:00
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
2022-10-25 18:43:38 +08:00
<el-form-item label="业务类型">
<el-select
v-model="query.bill_type"
2022-10-08 13:44:33 +08:00
clearable
2022-10-25 18:43:38 +08:00
filterable
size="mini"
placeholder="业务类型"
2022-10-08 13:44:33 +08:00
class="filter-item"
2022-10-25 18:43:38 +08:00
@change="crud.toQuery"
>
<el-option
v-for="item in billtypelist"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
2022-10-08 13:44:33 +08:00
</el-form-item>
2022-10-25 18:43:38 +08:00
<rrOperation />
2022-10-08 13:44:33 +08:00
</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"
2022-10-25 18:43:38 +08:00
:disabled="dis_flag"
@click="divOpen"
2022-10-08 13:44:33 +08:00
>
2022-10-25 18:43:38 +08:00
分配
</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"
class="filter-item"
type="warning"
:disabled="confirm_flag"
icon="el-icon-check"
size="mini"
@click="confirm"
>
强制确认
2022-10-08 13:44:33 +08:00
</el-button>
</crudOperation>
<!--表格渲染-->
2022-10-25 18:43:38 +08:00
<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="115"
align="center"
fixed="right"
>
2022-10-08 13:44:33 +08:00
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
2022-10-25 18:43:38 +08:00
:disabled-edit="canUd(scope.row)"
:disabled-dle="canUd(scope.row)"
2022-10-08 13:44:33 +08:00
/>
</template>
</el-table-column>
2022-10-25 18:43:38 +08:00
<el-table-column :selectable="checkboxT" type="selection" width="55" />
2022-10-26 19:58:51 +08:00
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据编码">
2022-10-25 18:43:38 +08:00
<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="100" prop="bill_status" label="单据状态" />
<el-table-column prop="stor_name" label="仓库" width="100" />
<el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" min-width="120" label="业务类型" />
<el-table-column show-overflow-tooltip width="135" prop="biz_date" label="业务日期" />
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="100" />
<el-table-column label="明细数" align="center" prop="detail_count" width="100" />
<el-table-column show-overflow-tooltip prop="input_time" width="135" label="创建日期" />
2022-10-08 13:44:33 +08:00
</el-table>
<!--分页组件-->
<pagination />
</div>
2022-10-25 18:43:38 +08:00
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<DivDialog :dialog-show.sync="divShow" :open-array="openParam" :rowmst="mstrow" @DivChanged="querytable" />
<TaskDialog :dialog-show.sync="taskShow" :open-array="openParam" :rowmst="mstrow" @TaskChanged="querytable" />
2022-10-08 13:44:33 +08:00
</div>
</template>
<script>
2022-10-25 18:43:38 +08:00
import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
import CRUD, { crud, header, presenter } from '@crud/crud'
2022-10-08 13:44:33 +08:00
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
2022-10-25 18:43:38 +08:00
import AddDialog from '@/views/wms/st/outbill/AddDialog'
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 crudStorattr from '@/views/wms/basedata/st/stor/storattr'
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
2022-10-08 13:44:33 +08:00
export default {
2022-10-25 18:43:38 +08:00
name: 'Checkoutbill',
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DivDialog, TaskDialog },
2022-10-08 13:44:33 +08:00
cruds() {
2022-10-25 18:43:38 +08:00
return CRUD({ title: '用户', idField: 'iostorinv_id', url: 'api/checkoutbill', crudMethod: { ...checkoutbill },
2022-10-08 13:44:33 +08:00
optShow: {
add: true,
edit: false,
del: false,
2022-10-25 18:43:38 +08:00
reset: true,
download: false
}})
2022-10-08 13:44:33 +08:00
},
2022-10-25 18:43:38 +08:00
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['io_bill_status', 'ST_CREATE_MODE'],
2022-10-08 13:44:33 +08:00
data() {
return {
2022-10-25 18:43:38 +08:00
height: document.documentElement.clientHeight - 180 + 'px;',
permission: {
add: ['admin', 'checkoutbill:add'],
edit: ['admin', 'checkoutbill:edit'],
del: ['admin', 'checkoutbill:del']
},
divShow: false,
taskShow: false,
dis_flag: true,
work_flag: true,
confirm_flag: true,
openParam: [],
mstrow: {},
viewShow: false,
currentRow: null,
checkrows: [],
storlist: [],
billtypelist: []
}
},
mounted: function() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
2022-10-08 13:44:33 +08:00
}
},
created() {
2022-10-25 18:43:38 +08:00
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
this.storlist = res.content
})
crudRawAssist.getType({ 'io_code': '0101', 'io_flag': '01' }).then(res => {
this.billtypelist = res
2022-10-08 13:44:33 +08:00
})
},
methods: {
2022-10-25 18:43:38 +08:00
canUd(row) {
return row.bill_status !== '10'
2022-10-08 13:44:33 +08:00
},
2022-10-25 18:43:38 +08:00
toView(index, row) {
this.mstrow = row
this.viewShow = true
2022-10-08 13:44:33 +08:00
},
2022-10-25 18:43:38 +08:00
[CRUD.HOOK.beforeRefresh]() {
this.handleCurrentChange(null)
2022-10-08 13:44:33 +08:00
},
2022-10-25 18:43:38 +08:00
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)
}
2022-10-08 13:44:33 +08:00
},
2022-10-25 18:43:38 +08:00
onSelectAll() {
this.$refs.table.clearSelection()
this.handleCurrentChange(null)
2022-10-08 13:44:33 +08:00
},
2022-10-25 18:43:38 +08:00
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') {
this.confirm_flag = false
} else {
this.confirm_flag = true
}
2022-10-08 13:44:33 +08:00
}
},
2022-10-25 18:43:38 +08:00
stateFormat(row) {
return this.dict.label.io_bill_status[row.bill_status]
},
bill_typeFormat(row) {
for (const item of this.billtypelist) {
if (item.code === row.bill_type) {
return item.name
}
2022-10-08 13:44:33 +08:00
}
},
2022-10-25 18:43:38 +08:00
create_modeFormat(row) {
return this.dict.label.ST_CREATE_MODE[row.create_mode]
2022-10-08 13:44:33 +08:00
},
2022-10-25 18:43:38 +08:00
handleCurrentChange(current) {
if (current === null) {
this.dis_flag = true
this.confirm_flag = true
this.work_flag = true
this.currentRow = {}
2022-10-08 13:44:33 +08:00
}
},
2022-10-25 18:43:38 +08:00
checkboxT(row) {
return row.bill_status !== '99'
},
divOpen() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.openParam = res
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
2022-10-08 13:44:33 +08:00
})
2022-10-25 18:43:38 +08:00
},
confirm() {
checkoutbill.confirm({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.querytable()
})
},
querytable() {
this.onSelectAll()
this.crud.toQuery()
this.handleCurrentChange(null)
2022-10-08 13:44:33 +08:00
}
}
}
</script>
2022-10-25 18:43:38 +08:00
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
2022-10-08 13:44:33 +08:00
</style>