388 lines
12 KiB
Vue
388 lines
12 KiB
Vue
<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"
|
||
clearable
|
||
size="mini"
|
||
placeholder="全部"
|
||
class="filter-item"
|
||
@change="crud.toQuery"
|
||
>
|
||
<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-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>
|
||
<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"
|
||
clearable
|
||
size="mini"
|
||
placeholder="单据状态"
|
||
class="filter-item"
|
||
@change="crud.toQuery"
|
||
>
|
||
<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"
|
||
clearable
|
||
filterable
|
||
size="mini"
|
||
placeholder="业务类型"
|
||
class="filter-item"
|
||
@change="crud.toQuery"
|
||
>
|
||
<el-option
|
||
v-for="item in dict.ST_INV_IN_TYPE"
|
||
:key="item.value"
|
||
:label="item.label"
|
||
:value="item.value"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<rrOperation />
|
||
</el-form>
|
||
</div>
|
||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||
<crudOperation :permission="permission">
|
||
<!-- <el-button
|
||
slot="right"
|
||
class="filter-item"
|
||
type="warning"
|
||
icon="el-icon-check"
|
||
size="mini"
|
||
:disabled="audit_flag"
|
||
@click="audit"
|
||
>
|
||
审核
|
||
</el-button>-->
|
||
<el-button
|
||
slot="right"
|
||
class="filter-item"
|
||
type="success"
|
||
:disabled="dis_flag"
|
||
icon="el-icon-position"
|
||
size="mini"
|
||
@click="divOpen"
|
||
>
|
||
分配
|
||
</el-button>
|
||
<el-button
|
||
slot="right"
|
||
class="filter-item"
|
||
type="success"
|
||
:disabled="dis_flag"
|
||
icon="el-icon-position"
|
||
size="mini"
|
||
@click="taskOpen"
|
||
>
|
||
作业任务
|
||
</el-button>
|
||
<el-button
|
||
slot="right"
|
||
class="filter-item"
|
||
type="warning"
|
||
icon="el-icon-check"
|
||
size="mini"
|
||
:disabled="task_flag"
|
||
@click="confirm"
|
||
>
|
||
强制确认
|
||
</el-button>
|
||
</crudOperation>
|
||
<!--表格渲染-->
|
||
<el-table
|
||
ref="table"
|
||
v-loading="crud.loading"
|
||
size="mini"
|
||
:data="crud.data"
|
||
highlight-current-row
|
||
style="width: 100%;"
|
||
@selection-change="crud.selectionChangeHandler"
|
||
@current-change="handleCurrentChange"
|
||
@select="handleSelectionChange"
|
||
@select-all="onSelectAll"
|
||
>
|
||
<el-table-column type="selection" width="55" />
|
||
<el-table-column
|
||
label="操作"
|
||
width="115"
|
||
align="center"
|
||
fixed="right"
|
||
>
|
||
<template slot-scope="scope">
|
||
<udOperation
|
||
:data="scope.row"
|
||
:permission="permission"
|
||
:disabled-edit="canUd(scope.row)"
|
||
:disabled-dle="canUd(scope.row)"
|
||
/>
|
||
</template>
|
||
</el-table-column>
|
||
<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" prop="bill_status" label="单据状态" />
|
||
<el-table-column prop="stor_name" label="仓库" />
|
||
<el-table-column show-overflow-tooltip prop="bill_type" min-width="120" :formatter="bill_typeFormat" label="业务类型" />
|
||
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
|
||
<el-table-column show-overflow-tooltip prop="create_mode" :formatter="create_modeFormat" label="生成方式" />
|
||
<el-table-column label="明细数" align="center" prop="detail_count" />
|
||
<el-table-column label="总重量" align="center" prop="total_qty">
|
||
<template slot-scope="scope">
|
||
{{ fun(scope.row.total_qty) }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="备注" align="center" prop="remark" />
|
||
<el-table-column label="制单人" align="center" prop="input_optname" />
|
||
<el-table-column label="制单时间" align="center" prop="input_time" width="150" />
|
||
<el-table-column label="修改人" align="center" prop="update_optname" />
|
||
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
|
||
<el-table-column label="分配人" align="center" prop="dis_optname" />
|
||
<el-table-column label="分配时间" align="center" prop="dis_time" width="150" />
|
||
<el-table-column label="确认人" align="center" prop="confirm_optname" width="150" />
|
||
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
|
||
</el-table>
|
||
<!--分页组件-->
|
||
<pagination />
|
||
</div>
|
||
<AddDialog @AddChanged="querytable" />
|
||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||
<DivDialog :dialog-show.sync="divShow" :stor-id="storId" :open-param="openParam" :bill-type="billType" :buss-config="bussConfig" @AddChanged="querytable" />
|
||
<TaskDialog :dialog-show.sync="taskShow" :open-param="openParam" :buss-config="bussConfig" @AddChanged="querytable" />
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import rawAssist from '@/views/wms/st/inbill/rawassist'
|
||
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
|
||
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 DateRangePicker from '@/components/DateRangePicker/index'
|
||
import AddDialog from '@/views/wms/st/inbill/AddDialog'
|
||
import DivDialog from '@/views/wms/st/inbill/DivDialog'
|
||
import ViewDialog from '@/views/wms/st/inbill/ViewDialog'
|
||
import TaskDialog from '@/views/wms/st/inbill/TaskDialog'
|
||
import { mapGetters } from 'vuex'
|
||
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
|
||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||
|
||
export default {
|
||
name: 'Rawassist',
|
||
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker, DivDialog, TaskDialog },
|
||
cruds() {
|
||
return CRUD({
|
||
title: '',
|
||
optShow: { add: true, reset: true },
|
||
idField: 'iostorinv_id',
|
||
url: '/api/in/rawAssist',
|
||
crudMethod: { ...rawAssist }
|
||
})
|
||
},
|
||
mixins: [presenter(), header(), crud()],
|
||
// 数据字典
|
||
dicts: ['io_bill_status', 'ST_CREATE_MODE','ST_INV_IN_TYPE'],
|
||
data() {
|
||
return {
|
||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||
permission: {
|
||
add: ['admin', 'user:add'],
|
||
edit: ['admin', 'user:edit'],
|
||
del: ['admin', 'user:del']
|
||
},
|
||
audit_flag: true,
|
||
dis_flag: true,
|
||
task_flag: true,
|
||
disShow: false,
|
||
viewShow: false,
|
||
mstrow: {},
|
||
divShow: false,
|
||
taskShow: false,
|
||
openParam: [],
|
||
billType: null,
|
||
bussConfig: null,
|
||
currentRow: null,
|
||
storlist: [],
|
||
createtypelist: [],
|
||
statuslist: [],
|
||
storId: null
|
||
}
|
||
},
|
||
computed: {
|
||
...mapGetters([
|
||
'user'
|
||
])
|
||
},
|
||
mounted: function() {
|
||
const that = this
|
||
window.onresize = function temp() {
|
||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||
}
|
||
},
|
||
created() {
|
||
crudUserStor.getUserStor().then(res => {
|
||
this.storlist = res
|
||
})
|
||
},
|
||
methods: {
|
||
fun(val) {
|
||
return Number(val).toFixed(3)
|
||
},
|
||
canUd(row) {
|
||
return row.bill_status !== '10'
|
||
},
|
||
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(currentRow) {
|
||
if (currentRow !== null) {
|
||
this.currentRow = currentRow
|
||
if (currentRow.bill_status === '10' || currentRow.bill_status === '20' || currentRow.bill_status === '30' || currentRow.bill_status === '40') {
|
||
this.dis_flag = false
|
||
} else {
|
||
this.dis_flag = true
|
||
}
|
||
if (currentRow.bill_status === '30' || currentRow.bill_status === '40') {
|
||
this.task_flag = false
|
||
} else {
|
||
this.task_flag = true
|
||
}
|
||
}
|
||
},
|
||
handleCurrentChange(currentRow) {
|
||
if (currentRow === null) {
|
||
this.dis_flag = true
|
||
this.task_flag = true
|
||
this.currentRow = {}
|
||
}
|
||
},
|
||
bill_typeFormat(row, column) {
|
||
return this.dict.label.ST_INV_IN_TYPE[row.bill_type]
|
||
},
|
||
toView(index, row) {
|
||
this.mstrow = row
|
||
this.viewShow = true
|
||
},
|
||
confirm() {
|
||
if (!this.currentRow) {
|
||
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||
return
|
||
}
|
||
crudRawAssist.confirm(this.currentRow).then(res => {
|
||
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||
this.crud.toQuery()
|
||
})
|
||
},
|
||
stateFormat(row, column) {
|
||
return this.dict.label.io_bill_status[row.bill_status]
|
||
},
|
||
create_modeFormat(row, column) {
|
||
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
||
},
|
||
divOpen() {
|
||
crudRawAssist.getIODtl({ 'bill_code': this.currentRow.bill_code, 'open_flag': '1' }).then(res => {
|
||
this.openParam = res
|
||
this.storId = this.currentRow.stor_id
|
||
this.billType = this.currentRow.bill_type
|
||
this.divShow = true
|
||
})
|
||
},
|
||
querytable() {
|
||
this.onSelectAll()
|
||
this.crud.toQuery()
|
||
},
|
||
taskOpen() {
|
||
crudRawAssist.getIODtl({ 'bill_code': this.currentRow.bill_code, 'open_flag': '2' }).then(res => {
|
||
this.openParam = res
|
||
this.taskShow = true
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||
::v-deep .el-dialog__body {
|
||
padding-top: 10px;
|
||
}
|
||
</style>
|