Merge branch 'master' of http://121.40.234.130:8899/root/hl_one
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="product_code">
|
||||
<label slot="label">生产车间:</label>
|
||||
<label slot="label">仓      库:</label>
|
||||
<el-select
|
||||
v-model="form.product_code"
|
||||
clearable
|
||||
@@ -116,6 +116,16 @@
|
||||
>
|
||||
添加物料
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="insertEvent()"
|
||||
>
|
||||
新增一行
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,389 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible2"
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
fullscreen
|
||||
@close="close"
|
||||
>
|
||||
|
||||
<span slot="title" class="dialog-footer">
|
||||
<div class="crud-opts2">
|
||||
<span class="el-dialog__title2">入库单任务操作</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button slot="left" type="info" @click="dialogVisible2 = false">关闭</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">入库单据明细项</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="this.openParam"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
border
|
||||
highlight-current-row
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@row-click="clcikRow"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="bill_code" label="单据号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="sap_pcsn" label="SAP批次" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
prop="assign_qty"
|
||||
:formatter="crud.formatNum3"
|
||||
label="已分配数量"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column show-overflow-tooltip prop="unassign_qty" :formatter="crud.formatNum3" label="未分配数量" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'20px 20px 0 20px'}">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini">
|
||||
<el-form-item prop="checked">
|
||||
<el-checkbox v-model="form.checked" true-label="1" false-label="0" @change="checkedChange()">仅显示未完成的任务</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">入库单据任务项</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<!-- <el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="updateTask()"
|
||||
>
|
||||
修改
|
||||
</el-button>-->
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="delTask()"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="reIssueTask()"
|
||||
>
|
||||
下发
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="confirmTask()"
|
||||
>
|
||||
标识完成
|
||||
</el-button>
|
||||
<!-- <el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="cancelTask()"
|
||||
>
|
||||
取消完成
|
||||
</el-button>-->
|
||||
</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="disTable"
|
||||
:data="form.tableMater"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
:row-class-name="tableRowClassName"
|
||||
highlight-current-row
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@row-click="clcikDisRow"
|
||||
>
|
||||
<el-table-column width="60" prop="seq_no" label="序号" align="center" />
|
||||
<el-table-column width="150" prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column width="150" prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column width="170" prop="pcsn" label="子卷号" align="center" />
|
||||
<el-table-column width="120" prop="sap_pcsn" label="SAP批次" align="center" />
|
||||
<el-table-column width="230" prop="box_no" label="木箱码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_code" label="分配货位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="work_status" label="指令状态" :formatter="statusFormat" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="task_code" label="指令操作号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="point_code" label="入库点位编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="point_name" label="入库点位名称" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<StructUpdateDiv :dialog-show.sync="structShow" :sect-prop="sectProp" :bucket-form="bucketForm" @updateCommit="updateCommit" />
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
|
||||
export default {
|
||||
name: 'TaskDialog',
|
||||
components: { StructUpdateDiv },
|
||||
mixins: [crud()],
|
||||
dicts: ['io_bill_status', 'task_status'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Array,
|
||||
default: () => { return [] }
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible2: false,
|
||||
tableDtl: [],
|
||||
stor_id: '',
|
||||
sect_id: '',
|
||||
sectProp: null,
|
||||
structShow: false,
|
||||
sects: [],
|
||||
dis_row: null,
|
||||
fullscreenLoading: false,
|
||||
bucketParam: null,
|
||||
bucketForm: null,
|
||||
bucketDtlShow: false,
|
||||
form: {
|
||||
tableMater: [],
|
||||
dtl_row: null,
|
||||
checked: '1'
|
||||
},
|
||||
storlist: [],
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible2 = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.form.tableMater = []
|
||||
this.form.checked = '1'
|
||||
this.form.dtl_row = null
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
delTask() {
|
||||
if (!this.dis_row) {
|
||||
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.dis_row.work_status !== '04') {
|
||||
this.crud.notify('只能对状态为生成的任务进行删除!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
crudRawAssist.delTask(this.dis_row).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
crudRawAssist.queryTask(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
crudRawAssist.getIODtl({ 'bill_code': this.currentRow.bill_code, 'open_flag': '2' }).then(res => {
|
||||
this.openParam = res
|
||||
this.dis_row = null
|
||||
this.crud.notify('删除任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
statusFormat(row, column) {
|
||||
return this.dict.label.task_status[row.work_status]
|
||||
},
|
||||
confirmTask() {
|
||||
if (!this.dis_row) {
|
||||
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.dis_row.work_status === '99' || this.dis_row.work_status === '00') {
|
||||
this.crud.notify('只能已生成或下发进行中的任务完成!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
crudRawAssist.confirmTask(this.dis_row).then(res => {
|
||||
crudRawAssist.queryTask(this.form.dtl_row).then(res2 => {
|
||||
this.form.tableMater = res2
|
||||
this.fullscreenLoading = false
|
||||
this.crud.notify('强制确认任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
cancelTask() {
|
||||
if (!this.dis_row) {
|
||||
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.dis_row.work_status !== '99') {
|
||||
this.crud.notify('只能对状态为完成的任务进行取消!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
crudRawAssist.cancelTask(this.dis_row).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
crudRawAssist.queryTask(this.form.dtl_row).then(res2 => {
|
||||
this.form.tableMater = res2
|
||||
this.crud.notify('取消确认任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
reIssueTask() {
|
||||
if (!this.dis_row) {
|
||||
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.dis_row.work_status !== '04') {
|
||||
this.crud.notify('只能对状态为生成的任务进行下发!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
crudRawAssist.reIssueTask(this.dis_row).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
crudRawAssist.queryTask(this.form.dtl_row).then(res2 => {
|
||||
this.form.tableMater = res2
|
||||
this.crud.notify('下发任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
crudRawAssist.queryTask(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
})
|
||||
},
|
||||
updateTask() {
|
||||
if (!this.dis_row) {
|
||||
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
debugger
|
||||
if (this.dis_row.work_status !== '01') {
|
||||
this.crud.notify('只能对状态为生成的任务进行修改!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.structShow = true
|
||||
this.bucketForm = this.dis_row
|
||||
},
|
||||
updateCommit() {
|
||||
crudRawAssist.queryTask(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.crud.notify('修改任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
checkedChange(val) {
|
||||
this.form.dtl_row.checked = this.form.checked
|
||||
crudRawAssist.queryTask(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
})
|
||||
},
|
||||
clcikRow(row, column, event) {
|
||||
this.form.dtl_row = row
|
||||
row.checked = this.form.checked
|
||||
crudRawAssist.queryTask(row).then(res => {
|
||||
this.form.tableMater = res
|
||||
})
|
||||
},
|
||||
clcikDisRow(row, column, event) {
|
||||
this.dis_row = row
|
||||
},
|
||||
assignFormat(row, column) {
|
||||
if (!row.assign_qty) {
|
||||
return '0'
|
||||
} else {
|
||||
return row.assign_qty
|
||||
}
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
row.index = rowIndex
|
||||
},
|
||||
bucketDtl(row) {
|
||||
crudRawAssist.bucketDtl(row).then(res => {
|
||||
this.bucketParam = res
|
||||
this.bucketDtlShow = true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .el-dialog__title2 {
|
||||
line-height: 24px;
|
||||
font-size:20px;
|
||||
color:#303133;
|
||||
}
|
||||
|
||||
.crud-opts2 .role-span {
|
||||
padding: 10px 0px 10px 0px;
|
||||
}
|
||||
.crud-opts2 .crud-opts-form {
|
||||
padding: 10px 0px 0px 20px;
|
||||
}
|
||||
|
||||
.input-with-select {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -12,27 +12,17 @@
|
||||
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-form-item label="所属仓库">
|
||||
<el-select
|
||||
v-model="query.product_code"
|
||||
v-model="query.stor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
v-for="item in dict.IO_BILL_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -40,7 +30,45 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="创建时间">
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<el-form-item label="单据日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
@@ -70,24 +98,34 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="业务类型">
|
||||
<el-select
|
||||
v-model="query.bill_type"
|
||||
clearable
|
||||
filterable
|
||||
<el-form-item label="入库单号">
|
||||
<el-input
|
||||
v-model="query.bill_code"
|
||||
size="mini"
|
||||
placeholder="业务类型"
|
||||
clearable
|
||||
placeholder="单据号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="生产车间">
|
||||
<el-select
|
||||
v-model="query.product_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_IN_TYPE"
|
||||
v-for="item in dict.product_area"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -104,6 +142,17 @@
|
||||
>
|
||||
分配
|
||||
</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"
|
||||
@@ -130,24 +179,25 @@
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态" />
|
||||
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(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="product_name" label="生产车间" width="130" show-overflow-tooltip />
|
||||
<el-table-column show-overflow-tooltip prop="bill_type" min-width="120" label="业务类型" :formatter="bill_typeFormat" />
|
||||
<el-table-column show-overflow-tooltip prop="bill_type" min-width="120" label="单据类型" :formatter="bill_typeFormat" />
|
||||
<el-table-column show-overflow-tooltip prop="stor_name" label="仓库" />
|
||||
<el-table-column prop="" label="生产车间" width="130" show-overflow-tooltip />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" 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="detail_count" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="制单人" align="center" prop="create_name" />
|
||||
<el-table-column label="制单时间" align="center" prop="create_time" width="150" />
|
||||
<el-table-column label="创建人" align="center" prop="create_name" />
|
||||
<el-table-column label="创建时间" align="center" prop="create_time" width="150" />
|
||||
<el-table-column label="修改人" align="center" prop="update_name" />
|
||||
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
|
||||
<el-table-column label="分配人" align="center" prop="dis_name" width="140px" />
|
||||
|
||||
@@ -249,12 +249,12 @@
|
||||
|
||||
<script>
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import BucketDialog from '@/views/wms/storage_manage/product/moreOrless/NewBucketDialog'
|
||||
import BucketDialog from '@/views/wms/storage_manage/product/productMoreOrless/NewBucketDialog'
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
import crudMoreOrless from '@/views/wms/storage_manage/product/moreOrless/moreorless'
|
||||
import crudMoreOrless from '@/views/wms/storage_manage/product/productMoreOrless/moreorless'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import StructDiv from '@/views/wms/storage_manage/product/moreOrless/StructDiv'
|
||||
import StructDiv from '@/views/wms/storage_manage/product/productMoreOrless/StructDiv'
|
||||
|
||||
const defaultForm = {
|
||||
mol_id: '',
|
||||
@@ -168,7 +168,7 @@ 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/storage_manage/product/moreOrless/AddDialog'
|
||||
import AddDialog from '@/views/wms/storage_manage/product/productMoreOrless/AddDialog'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
|
||||
@@ -0,0 +1,294 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
title="盘点单新增"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-input v-show="false" v-model="form.stor_code" placeholder="仓库编码" />
|
||||
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称" />
|
||||
<el-form-item label="单据号" prop="bill_code">
|
||||
<label slot="label">单 据 号:</label>
|
||||
<el-input v-model.trim="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<label slot="label">仓 库:</label>
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
clearable
|
||||
placeholder="仓库"
|
||||
class="filter-item"
|
||||
style="width: 210px"
|
||||
:disabled="crud.status.view > 0"
|
||||
@change="storChange"
|
||||
>
|
||||
<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="业务类型" prop="check_type">
|
||||
<el-select
|
||||
v-model="form.check_type"
|
||||
clearable
|
||||
placeholder="业务类型"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
:disabled="crud.status.view > 0"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_TYPE_CK"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-select
|
||||
v-model="form.status"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.check_bill_status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="dtl_num">
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model.trim="form.dtl_num" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model.trim="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">盘点明细</span>
|
||||
<span v-if="crud.status.cu > 0" class="crud-opts-right2">
|
||||
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="queryDtl()"
|
||||
>
|
||||
添加盘点物料
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" />
|
||||
<el-table-column prop="sect_name" label="盘点库区" align="center" />
|
||||
<el-table-column prop="struct_name" label="盘点货位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120" align="center" />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="base_qty" label="桶数" align="center" :formatter="crud.formatNum0" />
|
||||
<el-table-column prop="fac_qty" label="盘点桶数" align="center" :formatter="crud.formatNum0" />
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<AddDtl :dialog-show.sync="dtlShow" @tableChanged="tableChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import AddDtl from '@/views/wms/storage_manage/semiproduct/semiproductCheck/AddDtl'
|
||||
import check from '@/views/wms/storage_manage/semiproduct/semiproductCheck/check'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
|
||||
const defaultForm = {
|
||||
check_code: '',
|
||||
stor_id: '',
|
||||
stor_code: '',
|
||||
stor_name: '',
|
||||
status: '10',
|
||||
dtl_num: '0',
|
||||
check_type: '',
|
||||
remark: '',
|
||||
create_mode: '',
|
||||
tableData: []
|
||||
}
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { AddDtl },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
dicts: ['check_bill_status', 'ST_INV_TYPE_CK', 'check_dtl_status'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dtlShow: false,
|
||||
flagnow: false,
|
||||
nowrow: {},
|
||||
nowindex: '',
|
||||
storlist: [],
|
||||
rules: {
|
||||
stor_id: [
|
||||
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
||||
],
|
||||
check_type: [
|
||||
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// 查询原材料库的仓库
|
||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
check.getOutBillDtl({ 'check_id': this.form.check_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
row.edit = true
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToView]() {
|
||||
check.getOutBillDtl({ 'check_id': this.form.check_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
row.edit = true
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
bill_statusFormat(row) {
|
||||
return this.dict.label.check_dtl_status[row.status]
|
||||
},
|
||||
storChange(row) {
|
||||
this.storlist.forEach((item) => {
|
||||
if (item.stor_id === row) {
|
||||
this.form.stor_code = item.stor_code
|
||||
this.form.stor_name = item.stor_name
|
||||
}
|
||||
})
|
||||
},
|
||||
async queryDtl() {
|
||||
if (this.form.check_type === '') {
|
||||
this.crud.notify('请选择盘点单类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.dtlShow = true
|
||||
},
|
||||
tableChanged(rows) {
|
||||
const tablemap = new Map()
|
||||
rows.forEach((item) => {
|
||||
if (this.form.tableData.length !== 0) {
|
||||
this.flagnow = false
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if ((this.form.tableData[i].struct_code === item.struct_code) && (this.form.tableData[i].material_code === item.material_code)) {
|
||||
this.flagnow = true
|
||||
}
|
||||
}
|
||||
if (!this.flagnow) {
|
||||
item.edit = false
|
||||
item.status = '01'
|
||||
tablemap.set(item.struct_code + '间隔' + item.material_code, item)
|
||||
}
|
||||
} else {
|
||||
item.edit = false
|
||||
item.status = '01'
|
||||
tablemap.set(item.struct_code + '间隔' + item.material_code, item)
|
||||
}
|
||||
})
|
||||
for (const value of tablemap.values()) {
|
||||
this.form.tableData.push(value)
|
||||
}
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1)
|
||||
this.nowindex = ''
|
||||
this.nowrow = {}
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,173 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
title="盘点库存选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<!-- 搜索 -->
|
||||
<el-cascader
|
||||
placeholder="库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
v-model="query.struct_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="货位号模糊查询"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
v-model="query.remark"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip prop="sect_name" label="库区" width="110px" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" width="110px" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="150px" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="110px" />
|
||||
<el-table-column show-overflow-tooltip prop="base_qty" label="桶数" :formatter="crud.formatNum0" />
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="计量单位" />
|
||||
<el-table-column show-overflow-tooltip prop="storage_qty" :formatter="crud.formatNum3" label="重量" width="110px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
|
||||
<el-button slot="left" type="primary" @click="submit">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/api/wms/basedata/st/sectattr'
|
||||
|
||||
export default {
|
||||
name: 'AddDtl',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '用户', idField: 'stockrecord_id', url: 'api/check/getStructIvt',
|
||||
query: {
|
||||
struct_code: '',
|
||||
remark: '',
|
||||
sect_id: '',
|
||||
stor_id: ''
|
||||
},
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
opendtlParam: '',
|
||||
sects: [],
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudSectattr.getSect({ is_materialstore: '1' }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
this.crud.toQuery()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.crud.query.stor_id = val[0]
|
||||
this.crud.query.sect_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.crud.query.sect_id = ''
|
||||
this.crud.query.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.crud.query.stor_id = val[0]
|
||||
this.crud.query.sect_id = val[1]
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选载具物料')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,407 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
title="盘点单盘点"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:visible.sync="dialogVisible"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-input v-show="false" v-model="form.stor_code" placeholder="仓库编码" />
|
||||
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称" />
|
||||
<el-form-item label="单据号" prop="check_code">
|
||||
<el-input v-model.trim="form.check_code" placeholder="单据号" clearable disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="check_type">
|
||||
<el-select
|
||||
v-model="form.check_type"
|
||||
placeholder="业务类型"
|
||||
:disabled="true"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_TYPE_CK"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
placeholder="仓库"
|
||||
class="filter-item"
|
||||
:disabled="true"
|
||||
>
|
||||
<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="单据状态" prop="status">
|
||||
<el-select
|
||||
v-model="form.status"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.check_bill_status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="dtl_num">
|
||||
<el-input v-model.trim="form.dtl_num" style="width: 200px" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model.trim="form.remark" :disabled="true" style="width: 480px;" clearable :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" maxlength="100" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">盘点明细</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="add_flag"
|
||||
@click="addrow"
|
||||
>
|
||||
新增一行
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="sect_name" label="盘点库区" align="center" />
|
||||
<el-table-column prop="struct_name" label="盘点货位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="190" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-show="isShow(scope.$index, scope.row,1)" v-model="scope.row.material_code" disabled class="input-with-select">
|
||||
<el-button slot="append" icon="el-icon-search" @click="queryMater(scope.$index, scope.row)" />
|
||||
</el-input>
|
||||
<span v-show="isShow(scope.$index, scope.row,3)">{{ scope.row.material_code }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column prop="base_qty" label="桶数" :formatter="crud.formatNum0" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="fac_qty" label="盘点桶数" width="160" align="center">
|
||||
<template scope="scope">
|
||||
<el-input-number v-show="isShow(scope.$index, scope.row,2)" v-model="scope.row.fac_qty" :precision="0" :min="0" />
|
||||
<span v-show="isShow(scope.$index, scope.row,4)">{{ scope.row.fac_qty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
|
||||
<el-table-column prop="check_result" label="是否异常" align="center" :formatter="check_resultFormat" />
|
||||
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" />
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button :disabled="isCanDel(scope.$index, scope.row,1)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, tableData)" />
|
||||
<el-button v-show="!scope.row.edit" :disabled="isCanDel(scope.$index, scope.row,2)" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||
<el-button v-show="scope.row.edit" :disabled="isCanDel(scope.$index, scope.row,2)" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveCheck">保存</el-button>
|
||||
<el-button type="primary" @click="submitCheck">确认</el-button>
|
||||
</span>
|
||||
<MaterDialog :dialog-show.sync="materShow" @tableChanged2="tableChanged2" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import check from '@/views/wms/storage_manage/semiproduct/semiproductCheck/check'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
import MaterDialog from '@/views/wms/pub/MaterDialog'
|
||||
|
||||
export default {
|
||||
name: 'CheckDialog',
|
||||
components: { MaterDialog },
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
dicts: ['check_bill_status', 'ST_INV_TYPE_CK', 'check_dtl_status', 'check_result'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
materShow: false,
|
||||
add_flag: true,
|
||||
nowrow: null,
|
||||
nowindex: '',
|
||||
storlist: [],
|
||||
form: {
|
||||
check_id: '',
|
||||
check_code: '',
|
||||
stor_id: '',
|
||||
stor_code: '',
|
||||
stor_name: '',
|
||||
status: '10',
|
||||
dtl_num: '0',
|
||||
check_type: '',
|
||||
remark: '',
|
||||
create_mode: ''
|
||||
},
|
||||
tableData: [],
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// 查询原材料库的仓库
|
||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
check.getOutBillDtl2({ 'check_id': this.form.check_id }).then(res => {
|
||||
this.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
const row = this.tableData[i]
|
||||
row.edit = false
|
||||
if (row.status > '04') {
|
||||
row.edit = true
|
||||
}
|
||||
this.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
handleCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
this.nowrow = current
|
||||
const num = parseFloat(current.base_qty)
|
||||
if (num > 0) {
|
||||
this.add_flag = false
|
||||
} else {
|
||||
this.add_flag = true
|
||||
}
|
||||
} else {
|
||||
this.nowrow = null
|
||||
this.add_flag = true
|
||||
}
|
||||
},
|
||||
isCanDel(index, row, type) {
|
||||
const num = parseFloat(row.base_qty)
|
||||
if (type === 1) {
|
||||
if (row.status > '04' || num > 0) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
if (row.status > '04') {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
isShow(index, row, type) {
|
||||
const num = parseFloat(row.base_qty)
|
||||
if (type === 1) {
|
||||
if (row.status > '04') {
|
||||
return false
|
||||
} else {
|
||||
if (num > 0) {
|
||||
return false
|
||||
} else {
|
||||
if (row.edit) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (type === 2) {
|
||||
if (row.status > '04') {
|
||||
return false
|
||||
} else {
|
||||
if (row.edit) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
} else if (type === 3) {
|
||||
if (row.status > '04') {
|
||||
return true
|
||||
} else {
|
||||
if (num > 0) {
|
||||
return true
|
||||
} else {
|
||||
if (row.edit) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (type === 4) {
|
||||
if (row.status > '04') {
|
||||
return true
|
||||
} else {
|
||||
if (row.edit) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
setForm(row) {
|
||||
this.dialogVisible = true
|
||||
this.form = row
|
||||
},
|
||||
bill_statusFormat(row, column) {
|
||||
return this.dict.label.check_dtl_status[row.status]
|
||||
},
|
||||
check_resultFormat(row, column) {
|
||||
return this.dict.label.check_result[row.check_result]
|
||||
},
|
||||
addrow() {
|
||||
if (this.nowrow === null) {
|
||||
this.crud.notify('请先选中一条已存在的库存明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
this.tableData.push({ check_id: this.form.check_id, check_code: this.form.check_code, checkdtl_id: '', sect_id: this.nowrow.sect_id, sect_name: this.nowrow.sect_name, struct_id: this.nowrow.struct_id, struct_name: this.nowrow.struct_name, storagevehicle_id: this.nowrow.storagevehicle_id, storagevehicle_code: this.nowrow.storagevehicle_code, status: '01', material_id: '', material_name: '', base_qty: '0', qty_unit_id: '42', qty_unit_name: '桶', is_down: '0', fac_qty: '', check_result: '0', edit: false })
|
||||
this.form.dtl_num = this.tableData.length
|
||||
},
|
||||
async queryMater(index, row) {
|
||||
this.materShow = true
|
||||
this.nowindex = index
|
||||
this.nowrow = row
|
||||
},
|
||||
tableChanged2(row) {
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
if ((this.tableData[i].material_id === row.material_id) && (this.tableData[i].storagevehicle_code === this.nowrow.storagevehicle_code) && (this.tableData[i].struct_id === this.nowrow.struct_id)) {
|
||||
this.crud.notify('不允许货位、载具、物料同时相同!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
this.nowrow.material_id = row.material_id
|
||||
this.nowrow.material_code = row.material_code
|
||||
this.nowrow.material_name = row.material_name
|
||||
this.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
// 判断是否可以关闭编辑状态
|
||||
if (!row.edit) {
|
||||
const num = parseFloat(row.base_qty)
|
||||
const fac_qty = parseFloat(row.fac_qty)
|
||||
if (num <= 0 && fac_qty <= 0) {
|
||||
this.crud.notify('不允许新增明细,盘点数量为0!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!row.material_id) {
|
||||
this.crud.notify('物料不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
row.edit = !row.edit
|
||||
this.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1)
|
||||
this.nowindex = ''
|
||||
this.nowrow = null
|
||||
this.form.detail_count = this.tableData.length
|
||||
},
|
||||
submitCheck() {
|
||||
if (this.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
if (!this.tableData[i].edit) {
|
||||
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
|
||||
return false
|
||||
}
|
||||
}
|
||||
check.confirm({ 'row': this.form, 'rows': this.tableData }).then(res => {
|
||||
this.dialogVisible = false
|
||||
})
|
||||
},
|
||||
saveCheck() {
|
||||
if (this.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
if (!this.tableData[i].edit) {
|
||||
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
|
||||
return false
|
||||
}
|
||||
}
|
||||
check.saveCheck({ 'row': this.form, 'rows': this.tableData }).then(res => {
|
||||
this.dialogVisible = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
.input-with-select {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,252 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
title="盘点单异常处理"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:visible.sync="dialogVisible"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-input v-show="false" v-model="form.stor_code" placeholder="仓库编码" />
|
||||
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称" />
|
||||
<el-form-item label="单据号" prop="check_code">
|
||||
<el-input v-model.trim="form.check_code" placeholder="单据号" clearable disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="check_type">
|
||||
<el-select
|
||||
v-model="form.check_type"
|
||||
placeholder="业务类型"
|
||||
:disabled="true"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_TYPE_CK"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
placeholder="仓库"
|
||||
class="filter-item"
|
||||
:disabled="true"
|
||||
>
|
||||
<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="单据状态" prop="status">
|
||||
<el-select
|
||||
v-model="form.status"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.check_bill_status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="dtl_num">
|
||||
<el-input v-model.trim="form.dtl_num" style="width: 200px" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model.trim="form.remark" :disabled="true" style="width: 480px;" clearable :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" maxlength="100" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">盘点单明细</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="process1_flag"
|
||||
@click="process1"
|
||||
>
|
||||
重新盘点
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="process0_flag"
|
||||
@click="process0"
|
||||
>
|
||||
账务为准
|
||||
</el-button>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="sect_name" label="盘点库区" align="center" />
|
||||
<el-table-column prop="struct_name" label="盘点货位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="190" align="center" />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column prop="base_qty" label="桶数" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="fac_qty" label="盘点桶数" :formatter="crud.formatNum0" width="160" align="center" />
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
|
||||
<el-table-column prop="check_result" label="盘点结果" align="center" :formatter="check_resultFormat" />
|
||||
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" />
|
||||
</el-table>
|
||||
<ReCheckDialog ref="child3" @ReCheckChanged="getOutBillDtl" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { crud } from '@crud/crud'
|
||||
import check from '@/views/wms/storage_manage/semiproduct/semiproductCheck/check'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
import ReCheckDialog from '@/views/wms/storage_manage/semiproduct/semiproductCheck/ReCheckDialog'
|
||||
|
||||
export default {
|
||||
name: 'ProcessDialog',
|
||||
components: { ReCheckDialog },
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
dicts: ['check_bill_status', 'ST_INV_TYPE_CK', 'check_dtl_status', 'check_result'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
materShow: false,
|
||||
process1_flag: true,
|
||||
process0_flag: true,
|
||||
nowrow: null,
|
||||
nowindex: '',
|
||||
storlist: [],
|
||||
form: {
|
||||
check_id: '',
|
||||
check_code: '',
|
||||
stor_id: '',
|
||||
stor_code: '',
|
||||
stor_name: '',
|
||||
status: '10',
|
||||
dtl_num: '0',
|
||||
check_type: '',
|
||||
remark: '',
|
||||
create_mode: ''
|
||||
},
|
||||
tableData: [],
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// 查询原材料库的仓库
|
||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
this.getOutBillDtl()
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
handleCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
this.nowrow = current
|
||||
if (current.status === '05' || current.status === '06') {
|
||||
this.process0_flag = false
|
||||
this.process1_flag = false
|
||||
} else {
|
||||
this.process0_flag = true
|
||||
this.process1_flag = true
|
||||
}
|
||||
} else {
|
||||
this.nowrow = null
|
||||
this.process0_flag = true
|
||||
this.process1_flag = true
|
||||
}
|
||||
},
|
||||
setForm(row) {
|
||||
this.dialogVisible = true
|
||||
this.form = row
|
||||
},
|
||||
bill_statusFormat(row, column) {
|
||||
return this.dict.label.check_dtl_status[row.status]
|
||||
},
|
||||
check_resultFormat(row, column) {
|
||||
return this.dict.label.check_result[row.check_result]
|
||||
},
|
||||
process0() {
|
||||
check.process0({ 'form': this.form, 'row': this.nowrow }).then(res => {
|
||||
this.getOutBillDtl()
|
||||
})
|
||||
},
|
||||
process1() {
|
||||
if (this.nowrow !== null) {
|
||||
this.$refs.child3.setReForm(this.nowrow)
|
||||
}
|
||||
},
|
||||
getOutBillDtl() {
|
||||
check.getOutBillDtl({ 'check_id': this.form.check_id }).then(res => {
|
||||
this.tableData = res
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,353 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
title="重新盘点"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:visible.sync="dialogVisible"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="盘点单号" prop="check_code">
|
||||
<el-input v-model.trim="form.check_code" placeholder="盘点单号" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="盘点仓位" prop="struct_name">
|
||||
<el-input v-model.trim="form.struct_name" placeholder="盘点仓位" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="盘点载具" prop="storagevehicle_code">
|
||||
<el-input v-model.trim="form.storagevehicle_code" placeholder="盘点单号" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="dtl_num">
|
||||
<el-input v-model.trim="form.dtl_num" style="width: 200px" :disabled="true" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">盘点明细</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="add_flag"
|
||||
@click="addrow"
|
||||
>
|
||||
新增一行
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
|
||||
<el-table-column show-overflow-tooltip prop="bucketunique" label="桶号" width="190" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-show="isCanDel(scope.$index, scope.row,'3')" v-model="scope.row.bucketunique" disabled class="input-with-select">
|
||||
<el-button slot="append" icon="el-icon-search" @click="queryBucket(scope.$index, scope.row)" />
|
||||
</el-input>
|
||||
<span v-show="isCanDel(scope.$index, scope.row,'2')">{{ scope.row.bucketunique }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column prop="quality_scode" label="品质类型" align="center" width="110px">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.quality_scode"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_QUALITY_SCODE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="ivt_level" label="库存等级" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.ivt_level"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_IVT_LEVEL"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_active" label="是否可用" align="center" width="110px">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.is_active"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.is_used"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pcsn" label="批次" align="center" />
|
||||
<el-table-column prop="ivt_qty" label="库存重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="ivt_qty_ck" label="盘点重量" width="160" align="center">
|
||||
<template scope="scope">
|
||||
<el-input-number v-show="!scope.row.edit" v-model="scope.row.ivt_qty_ck" :precision="3" :min="0" />
|
||||
<span v-show="scope.row.edit">{{ scope.row.ivt_qty_ck }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button :disabled="scope.row.new_edit" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, tableData)" />
|
||||
<el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||
<el-button v-show="scope.row.edit" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="process1">确认</el-button>
|
||||
</span>
|
||||
<MaterDialog :dialog-show.sync="materShow" @tableChanged2="tableChanged2" />
|
||||
<BucketDialog :dialog-show.sync="bucketShow" @bucketChange="tableChanged2" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import check from '@/views/wms/storage_manage/semiproduct/semiproductCheck/check'
|
||||
// import BucketDialog from '@/views/wms/st/inStor/rawproductmoreOrless/NewBucketDialog'
|
||||
import MaterDialog from '@/views/wms/pub/MaterDialog'
|
||||
|
||||
export default {
|
||||
name: 'ReCheckDialog',
|
||||
components: { MaterDialog, BucketDialog },
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
dicts: ['check_bill_status', 'ST_INV_TYPE_CK', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
materShow: false,
|
||||
bucketShow: false,
|
||||
add_flag: true,
|
||||
nowrow: null,
|
||||
nowindex: '',
|
||||
form: {},
|
||||
tableData: [],
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
check.getOutBillDis({ 'storagevehicle_code': this.form.storagevehicle_code }).then(res => {
|
||||
this.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
const row = this.tableData[i]
|
||||
row.new_edit = true
|
||||
this.tableData.splice(i, 1, row)
|
||||
}
|
||||
this.form.dtl_num = this.tableData.length
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('ReCheckChanged')
|
||||
},
|
||||
handleCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
this.nowrow = current
|
||||
this.add_flag = false
|
||||
} else {
|
||||
this.nowrow = null
|
||||
this.add_flag = true
|
||||
}
|
||||
},
|
||||
setReForm(row) {
|
||||
this.dialogVisible = true
|
||||
this.form = row
|
||||
},
|
||||
addrow() {
|
||||
if (this.nowrow === null) {
|
||||
this.crud.notify('请先选中一条已存在的盘点明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
this.tableData.push({ bucketunique: '', storagevehicle_id: this.nowrow.storagevehicle_id, storagevehicle_type: this.nowrow.storagevehicle_type, storagevehicle_code: this.nowrow.storagevehicle_code, material_id: '', material_name: '', ivt_qty: '0', qty_unit_id: '', qty_unit_name: '', pcsn: '', quality_scode: '00', ivt_level: '01', is_active: '1', ivt_qty_ck: '0', edit: false, new_edit: false })
|
||||
this.form.dtl_num = this.tableData.length
|
||||
},
|
||||
async queryMater(index, row) {
|
||||
this.materShow = true
|
||||
this.nowindex = index
|
||||
this.nowrow = row
|
||||
},
|
||||
async queryBucket(index, row) {
|
||||
this.bucketShow = true
|
||||
this.nowindex = index
|
||||
this.nowrow = row
|
||||
},
|
||||
tableChanged2(row) {
|
||||
this.nowrow.material_code = row.material_code
|
||||
this.nowrow.material_id = row.material_id
|
||||
this.nowrow.material_name = row.material_name
|
||||
this.nowrow.qty_unit_id = row.qty_unit_id
|
||||
this.nowrow.qty_unit_name = row.qty_unit_name
|
||||
this.nowrow.quality_scode = row.quality_scode
|
||||
this.nowrow.is_active = row.is_active
|
||||
this.nowrow.ivt_level = row.ivt_level
|
||||
this.nowrow.pcsn = row.pcsn
|
||||
this.nowrow.ivt_qty_ck = row.storage_qty
|
||||
this.nowrow.bucketunique = row.bucketunique
|
||||
this.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
|
||||
},
|
||||
isCanDel(index, row, type) {
|
||||
if (type === '1') {
|
||||
if (row.new_edit) {
|
||||
return true
|
||||
} else {
|
||||
if (row.edit) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
} else if (type === '2') {
|
||||
if (row.new_edit) {
|
||||
return true
|
||||
} else {
|
||||
if (row.edit) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
} else if (type === '3') {
|
||||
if (row.new_edit) {
|
||||
return false
|
||||
} else {
|
||||
if (row.edit) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
// 判断是否可以关闭编辑状态
|
||||
if (!row.edit) {
|
||||
const num = parseFloat(row.ivt_qty)
|
||||
const fac_qty = parseFloat(row.ivt_qty_ck)
|
||||
if (num <= 0 && fac_qty <= 0) {
|
||||
this.crud.notify('不允许新增明细,盘点数量为0!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!row.material_id) {
|
||||
this.crud.notify('物料不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!row.pcsn) {
|
||||
this.crud.notify('物料批次不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!row.bucketunique) {
|
||||
this.crud.notify('桶号不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
if ((this.tableData[i].bucketunique === row.bucketunique) && (index !== i)) {
|
||||
this.crud.notify('不允许桶号同时相同!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
row.edit = !row.edit
|
||||
this.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1)
|
||||
this.nowindex = ''
|
||||
this.nowrow = null
|
||||
this.form.detail_count = this.tableData.length
|
||||
},
|
||||
process1() {
|
||||
if (this.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
if (!this.tableData[i].edit) {
|
||||
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
|
||||
return false
|
||||
}
|
||||
}
|
||||
check.process1({ 'row': this.form, 'rows': this.tableData }).then(res => {
|
||||
this.dialogVisible = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
.input-with-select {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,104 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/check',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/check/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/check',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getOutBillDtl(params) {
|
||||
return request({
|
||||
url: '/api/check/getOutBillDtl',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getOutBillDtl2(params) {
|
||||
return request({
|
||||
url: '/api/check/getOutBillDtl2',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getOutBillDis(params) {
|
||||
return request({
|
||||
url: '/api/check/getOutBillDis',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getInvTypes() {
|
||||
return request({
|
||||
url: '/api/check/getInvTypes',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function insertDtl(data) {
|
||||
return request({
|
||||
url: '/api/check/insertDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getStructIvt(params) {
|
||||
return request({
|
||||
url: '/api/check/getStructIvt',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function confirm(data) {
|
||||
return request({
|
||||
url: '/api/check/confirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function handdown(data) {
|
||||
return request({
|
||||
url: '/api/check/handdown',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function saveCheck(data) {
|
||||
return request({
|
||||
url: '/api/check/saveCheck',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function process0(data) {
|
||||
return request({
|
||||
url: '/api/check/process0',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function process1(data) {
|
||||
return request({
|
||||
url: '/api/check/process1',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, getOutBillDtl, getStructIvt, getOutBillDtl2, confirm, getInvTypes, saveCheck, process0, getOutBillDis, process1 }
|
||||
@@ -0,0 +1,359 @@
|
||||
<!--suppress ALL -->
|
||||
<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.check_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.status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.check_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.check_type"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="业务类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_TYPE_CK"
|
||||
: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="success"
|
||||
:disabled="check_flag"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="checkOpen"
|
||||
>
|
||||
盘点
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
:disabled="confirm_flag"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="confirm"
|
||||
>
|
||||
异常处理
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-check"
|
||||
:disabled="downdtl_flag"
|
||||
size="mini"
|
||||
@click="downdtl"
|
||||
>
|
||||
导出Excel
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:max-height="590"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
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','check:del','check:edit']"
|
||||
label="操作"
|
||||
width="160"
|
||||
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 :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column prop="check_code" min-width="130" label="订单编码">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.check_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :formatter="stateFormat" min-width="100" prop="status" label="单据状态" />
|
||||
<el-table-column prop="stor_name" label="仓库" min-width="100" />
|
||||
<el-table-column prop="check_type" :formatter="bill_typeFormat" min-width="100" label="业务类型" />
|
||||
<el-table-column prop="is_nok" :formatter="is_nokFormat" min-width="100" label="盘点状态" />
|
||||
<el-table-column :formatter="create_modeFormat" prop="create_mode" label="生成方式" min-width="100" />
|
||||
<el-table-column label="明细数" align="center" prop="dtl_num" min-width="100" />
|
||||
<el-table-column prop="input_time" min-width="135" label="创建日期" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<CheckDialog ref="child" @AddChanged="querytable" />
|
||||
<ProcessDialog ref="child2" @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import check from '@/views/wms/storage_manage/semiproduct/semiproductCheck/check'
|
||||
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/storage_manage/semiproduct/semiproductCheck/AddDialog'
|
||||
import CheckDialog from '@/views/wms/storage_manage/semiproduct/semiproductCheck/CheckDialog'
|
||||
import ProcessDialog from '@/views/wms/storage_manage/semiproduct/semiproductCheck/ProcessDialog'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'Check',
|
||||
components: { CheckDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, ProcessDialog },
|
||||
cruds() {
|
||||
return CRUD({ title: '用户',
|
||||
props: {
|
||||
// 每页数据条数
|
||||
size: 20
|
||||
},
|
||||
idField: 'check_id', url: 'api/check', crudMethod: { ...check },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
}})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: ['check_bill_status', 'ST_CREATE_MODE', 'ST_INV_TYPE_CK'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {
|
||||
add: ['admin', 'check:add'],
|
||||
edit: ['admin', 'check:edit'],
|
||||
del: ['admin', 'check:del']
|
||||
},
|
||||
check_flag: true,
|
||||
downdtl_flag: true,
|
||||
confirm_flag: true,
|
||||
currentRow: null,
|
||||
storlist: []
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
canUd(row) {
|
||||
return row.status !== '10'
|
||||
},
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.crud.query.buss_type = ''
|
||||
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
|
||||
this.downdtl_flag = false
|
||||
if (current.status === '10' || current.status === '30') {
|
||||
this.check_flag = false
|
||||
} else {
|
||||
this.check_flag = true
|
||||
}
|
||||
if (current.status === '30' && current.is_nok === '1') {
|
||||
this.confirm_flag = false
|
||||
} else {
|
||||
this.confirm_flag = true
|
||||
}
|
||||
}
|
||||
},
|
||||
stateFormat(row) {
|
||||
return this.dict.label.check_bill_status[row.status]
|
||||
},
|
||||
bill_typeFormat(row) {
|
||||
return this.dict.label.ST_INV_TYPE_CK[row.check_type]
|
||||
},
|
||||
create_modeFormat(row) {
|
||||
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
||||
},
|
||||
is_nokFormat(row) {
|
||||
if (row.is_nok === '1') {
|
||||
return '异常'
|
||||
} else {
|
||||
return '正常'
|
||||
}
|
||||
},
|
||||
handleCurrentChange(current) {
|
||||
if (current === null) {
|
||||
this.confirm_flag = true
|
||||
this.check_flag = true
|
||||
this.downdtl_flag = true
|
||||
this.currentRow = null
|
||||
}
|
||||
},
|
||||
checkboxT(row) {
|
||||
return row.bill_status !== '99'
|
||||
},
|
||||
checkOpen() {
|
||||
if (this.currentRow !== null) {
|
||||
this.$refs.child.setForm(this.currentRow)
|
||||
}
|
||||
},
|
||||
confirm() {
|
||||
if (this.currentRow !== null) {
|
||||
this.$refs.child2.setForm(this.currentRow)
|
||||
}
|
||||
},
|
||||
downdtl() {
|
||||
if (this.currentRow !== null) {
|
||||
crud.downloadLoading = true
|
||||
download('/api/check/download', { check_id: this.currentRow.check_id }).then(result => {
|
||||
downloadFile(result, this.currentRow.check_code + '盘点数据', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
}).catch(() => {
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
querytable() {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
this.handleCurrentChange(null)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,524 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="crud.status.title"
|
||||
append-to-body
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
fullscreen
|
||||
width="1200px"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form-item label="单据号" prop="bill_code">
|
||||
<label slot="label">单 据 号:</label>
|
||||
<el-input v-model.trim="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<label slot="label">仓 库:</label>
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
clearable
|
||||
placeholder="仓库"
|
||||
class="filter-item"
|
||||
style="width: 210px"
|
||||
:disabled="crud.status.view > 0"
|
||||
>
|
||||
<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="损溢类型" prop="mol_type">
|
||||
<el-select
|
||||
v-model="form.mol_type"
|
||||
style="width: 210px"
|
||||
clearable
|
||||
class="filter-item"
|
||||
:disabled="crud.status.view > 0"
|
||||
@change="typeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_MOL_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="货位" prop="struct_code">
|
||||
<label slot="label">货 位:</label>
|
||||
<el-input v-model.trim="form.struct_code" style="width: 210px" disabled placeholder="选择货位">
|
||||
<el-button v-show="crud.status.view <= 0" slot="append" icon="el-icon-plus" @click="queryStruct()" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="detail_count">
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model.trim="form.dtl_num" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总重量" prop="total_qty">
|
||||
<label slot="label">总 重 量:</label>
|
||||
<el-input-number
|
||||
v-model="form.total_qty"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
disabled
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model.trim="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<!--<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
:disabled="crud.status.view > 0"
|
||||
@click="resetTable()"
|
||||
>
|
||||
重置表格
|
||||
</el-button>-->
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:disabled="mater_btn"
|
||||
@click="insertdtl()"
|
||||
>
|
||||
新增一行
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" align="center" width="150px">
|
||||
<template scope="scope">
|
||||
<el-input v-show="!scope.row.edit && scope.row.is_add" v-model="scope.row.storagevehicle_code" size="mini" />
|
||||
<span v-show="scope.row.edit">{{ scope.row.storagevehicle_code }}</span>
|
||||
<span v-show="!scope.row.edit && !scope.row.is_add">{{ scope.row.storagevehicle_code }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="bucketunique" label="桶号" width="190" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-show="!scope.row.edit && scope.row.is_add" v-model="scope.row.bucketunique" disabled class="input-with-select">
|
||||
<el-button slot="append" icon="el-icon-plus" @click="queryBucket(scope.$index, scope.row)" />
|
||||
</el-input>
|
||||
<span v-show="scope.row.edit">{{ scope.row.bucketunique }}</span>
|
||||
<span v-show="!scope.row.edit && !scope.row.is_add">{{ scope.row.bucketunique }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" align="center" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column prop="pcsn" label="批次号" align="center" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column prop="quality_scode" label="品质类型" align="center" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.quality_scode"
|
||||
size="mini"
|
||||
clearable
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_QUALITY_SCODE"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="ivt_level" label="库存等级" align="center" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.ivt_level"
|
||||
size="mini"
|
||||
clearable
|
||||
class="filter-item"
|
||||
placeholder="无"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_IVT_LEVEL"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_active" label="是否可用" align="center" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.is_active"
|
||||
size="mini"
|
||||
clearable
|
||||
class="filter-item"
|
||||
placeholder="无"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.is_used"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="ivt_qty" label="库存重量" align="center" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="mol_qty" width="220" label="损溢重量" align="center">
|
||||
<template scope="scope">
|
||||
<el-input-number v-model="scope.row.mol_qty" :disabled="scope.row.edit" :precision="3" :controls="false" :min="0" style="width: 120px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="190" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click.native.prevent="deleteRow(scope.$index, form.tableData)"
|
||||
/>
|
||||
<el-button
|
||||
v-show="!scope.row.edit"
|
||||
type="primary"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.$index, scope.row)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-show="scope.row.edit"
|
||||
type="success"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-check"
|
||||
@click="handleEdit(scope.$index, scope.row)"
|
||||
>完成
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<MaterDtl :dialog-show.sync="materShow" :dialog-matertype="materType" @tableChanged2="tableChanged2" />
|
||||
<StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="tableChanged" />
|
||||
<BucketDialog :dialog-show.sync="bucketShow" @bucketChange="tableChanged2" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import BucketDialog from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/NewBucketDialog'
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
import crudMoreOrless from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/moreorless'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import StructDiv from '@/views/wms/storage_manage/semiproduct/semiproductMoreOrless/StructDiv'
|
||||
|
||||
const defaultForm = {
|
||||
mol_id: '',
|
||||
mol_code: '',
|
||||
mol_type: '',
|
||||
stor_id: '',
|
||||
total_qty: '0',
|
||||
dtl_num: '0',
|
||||
bill_type: '',
|
||||
remark: '',
|
||||
struct_id: '',
|
||||
sect_id: '',
|
||||
sect_name: '',
|
||||
struct_code: '',
|
||||
struct_name: '',
|
||||
tableData: []
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { crudOperation, MaterDtl, StructDiv, BucketDialog },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'ST_MOL_TYPE'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
materShow: false,
|
||||
bucketShow: false,
|
||||
structShow: false,
|
||||
materType: '',
|
||||
mater_btn: true,
|
||||
storlist: [],
|
||||
rules: {
|
||||
stor_id: [
|
||||
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
||||
],
|
||||
bill_type: [
|
||||
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
biz_date: [
|
||||
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// 查询原材料库的仓库
|
||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
// 获取入库单明细
|
||||
crudMoreOrless.queryMolDtl({ 'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
row.isadd = false
|
||||
row.edit = true
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToView]() {
|
||||
this.mater_btn = true
|
||||
crudMoreOrless.queryMolDetail({ 'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
row.edit = true
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
debugger
|
||||
// 提交前校验
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if (!this.form.tableData[i].edit) {
|
||||
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
|
||||
return false
|
||||
}
|
||||
const vehicle_code = this.form.tableData[i].storagevehicle_code
|
||||
const same = this.form.tableData.some(mater => mater.storagevehicle_code !== vehicle_code)
|
||||
if (same) {
|
||||
this.crud.notify('存在不同载具号', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
billTypeChange(val) {
|
||||
this.form.tableData = []
|
||||
this.form.total_qty = 0
|
||||
this.form.dtl_num = 0
|
||||
},
|
||||
resetTable() {
|
||||
if (!this.form.struct_id) {
|
||||
this.crud.notify('请先选择货物!')
|
||||
return false
|
||||
}
|
||||
if (this.crud.status.add > 0) {
|
||||
crudMoreOrless.getStructIvt({ 'struct_id': this.form.struct_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
})
|
||||
}
|
||||
if (this.crud.status.edit > 0) {
|
||||
crudMoreOrless.queryMolDtl({ 'mol_id': this.form.mol_id, 'struct_id': this.form.struct_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
})
|
||||
}
|
||||
},
|
||||
tableChanged2(row) {
|
||||
// 新增一行物料时,给行进行赋值
|
||||
this.nowrow.material_code = row.material_code
|
||||
this.nowrow.material_id = row.material_id
|
||||
this.nowrow.material_name = row.material_name
|
||||
this.nowrow.qty_unit_id = row.qty_unit_id
|
||||
this.nowrow.qty_unit_name = row.qty_unit_name
|
||||
this.nowrow.quality_scode = row.quality_scode
|
||||
this.nowrow.is_active = row.is_active
|
||||
this.nowrow.ivt_level = row.ivt_level
|
||||
this.nowrow.pcsn = row.pcsn
|
||||
this.nowrow.mol_qty = row.storage_qty
|
||||
this.nowrow.bucketunique = row.bucketunique
|
||||
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
|
||||
},
|
||||
tableChanged(row) {
|
||||
this.form.struct_id = row.struct_id
|
||||
this.form.struct_code = row.struct_code
|
||||
this.form.sect_id = row.sect_id
|
||||
this.form.sect_name = row.sect_name
|
||||
this.form.struct_name = row.struct_name
|
||||
crudMoreOrless.getStructIvt({ 'struct_id': row.struct_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
})
|
||||
},
|
||||
|
||||
async queryMater(index, row) {
|
||||
this.materShow = true
|
||||
this.nowindex = index
|
||||
this.nowrow = row
|
||||
},
|
||||
async queryStruct() {
|
||||
if (!this.form.mol_type) {
|
||||
this.crud.notify('请先选择损溢类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.structShow = true
|
||||
this.$refs.child.getMsg(this.form.mol_type)
|
||||
},
|
||||
async queryBucket(index, row) {
|
||||
this.bucketShow = true
|
||||
this.nowindex = index
|
||||
this.nowrow = row
|
||||
},
|
||||
async insertdtl() {
|
||||
this.form.tableData.push({ quality_scode: '02', ivt_qty: 0, mol_qty: 0, is_active: '1', ivt_level: '01', edit: false, is_add: true })
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
},
|
||||
typeChange(val) {
|
||||
if (val === '1') {
|
||||
this.mater_btn = false
|
||||
} else {
|
||||
this.mater_btn = true
|
||||
}
|
||||
this.form.tableData = []
|
||||
this.form.struct_id = ''
|
||||
this.form.struct_code = ''
|
||||
this.form.sect_id = ''
|
||||
this.form.sect_name = ''
|
||||
this.form.struct_name = ''
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
if (!row.edit) {
|
||||
if (parseFloat(row.mol_qty) <= 0) {
|
||||
this.crud.notify('不允许损溢数量为0!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!row.material_id) {
|
||||
this.crud.notify('物料不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!row.storagevehicle_code) {
|
||||
this.crud.notify('载具号不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!row.bucketunique) {
|
||||
this.crud.notify('桶号不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!row.pcsn) {
|
||||
this.crud.notify('批次不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (this.form.mol_type === '0' && (parseFloat(row.ivt_qty) < parseFloat(row.mol_qty))) {
|
||||
this.crud.notify('不允许损数量大于库存数量!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
// 修改行的编辑状态
|
||||
row.edit = !row.edit
|
||||
this.form.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||
if (row.edit) {
|
||||
this.form.total_qty = 0
|
||||
this.form.tableData.forEach((item) => {
|
||||
this.form.total_qty = this.form.total_qty + item.mol_qty
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].mol_qty)
|
||||
rows.splice(index, 1)
|
||||
this.form.dtl_num = this.form.tableData.length
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
</style>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="桶记录选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<!-- 搜索 -->
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-select
|
||||
v-model="query.storagevehicle_type"
|
||||
placeholder="桶类别"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.MD_BUCKET_TYPE"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
v-model="query.bucketunique"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="桶号"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
placeholder="状态"
|
||||
clearable
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.bucket_status"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="padding-top: 10px;padding-bottom: 10px;">
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
v-model="query.storagevehicle_code"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="载具"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
v-model="query.material_search"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="物料编码、名称"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="批次"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="bucketunique" label="桶号" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="label" label="桶类别" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="pcsn" label="批次" />
|
||||
<el-table-column prop="storage_qty" label="数量">
|
||||
<template slot-scope="scope">
|
||||
{{ fun(scope.row.storage_qty) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="qty_unit_name" label="单位" />
|
||||
<el-table-column prop="quality_scode" :formatter="qualityFormat" label="品质类型" />
|
||||
<el-table-column prop="ivt_level" :formatter="ivtFormat" label="库存等级" />
|
||||
<el-table-column prop="is_active" :formatter="activeFormat" label="是否可用" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" />
|
||||
<el-table-column prop="record_order" label="顺序号" />
|
||||
<el-table-column prop="bag_qty" label="袋数" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudStructattr from '@/api/wms/basedata/st/structattr'
|
||||
import crudSectattr from '@/api/wms/basedata/st/sectattr'
|
||||
|
||||
export default {
|
||||
name: 'BucketDiv',
|
||||
components: { crudOperation, rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '桶',
|
||||
optShow: {},
|
||||
query: { pcsn: '', storagevehicle_type: '', status: '01', bucketunique: '', storagevehicle_code: '', material_search: '' },
|
||||
url: 'api/Bucket',
|
||||
idField: 'bucket_record_id',
|
||||
sort: 'bucket_record_id,desc',
|
||||
crudMethod: { ...crudStructattr }
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
dicts: ['MD_BUCKET_TYPE', 'bucket_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'IS_OR_NOT'],
|
||||
data() {
|
||||
return {
|
||||
sects: [],
|
||||
classes: [],
|
||||
dialogVisible: false,
|
||||
bucket: {},
|
||||
checkrow: {},
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fun(val) {
|
||||
return Number(val).toFixed(3)
|
||||
},
|
||||
open() {
|
||||
crudSectattr.getSect().then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery()
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选仓位')
|
||||
return
|
||||
}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('bucketChange', this.checkrow)
|
||||
},
|
||||
qualityFormat(row, column) {
|
||||
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
|
||||
},
|
||||
ivtFormat(row, column) {
|
||||
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
|
||||
},
|
||||
activeFormat(row, column) {
|
||||
return this.dict.label.IS_OR_NOT[row.is_active]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="货位选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<!-- 搜索 -->
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-cascader
|
||||
v-model="query.sect"
|
||||
placeholder="所属库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="输入货位编码、名称"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/> </el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="struct_code" label="货位编码" />
|
||||
<el-table-column prop="struct_name" label="货位名称" />
|
||||
<el-table-column prop="sect_name" label="库区名称" />
|
||||
<el-table-column prop="lock_type" :formatter="lockFormat" label="是否锁定" />
|
||||
<el-table-column prop="storagevehicle_code" label="存储载具号" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudStructattr from '@/api/wms/basedata/st/structattr'
|
||||
import crudSectattr from '@/api/wms/basedata/st/sectattr'
|
||||
|
||||
export default {
|
||||
name: 'StructDiv',
|
||||
components: { crudOperation, rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '仓位',
|
||||
optShow: {},
|
||||
url: 'api/structattr',
|
||||
idField: 'struct_id',
|
||||
sort: 'struct_id,desc',
|
||||
query: { search: '', is_lock: '1', sect_id: '', stor_id: '' },
|
||||
crudMethod: { ...crudStructattr }
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
dicts: ['d_lock_type'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
sectProp: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sects: [],
|
||||
classes: [],
|
||||
dialogVisible: false,
|
||||
sect: {},
|
||||
mol_type: '',
|
||||
checkrow: {},
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
sectProp: {
|
||||
handler(newValue, oldValue) {
|
||||
this.sect = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.crud.resetQuery(false)
|
||||
crudSectattr.getSect({ 'is_materialstore': '1' }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
if (this.sect) {
|
||||
this.query.sect = this.sect
|
||||
if (this.sect.length === 1) {
|
||||
this.query.stor_id = this.sect[0]
|
||||
this.query.sect_id = ''
|
||||
}
|
||||
if (this.sect.length === 0) {
|
||||
this.query.sect_id = ''
|
||||
this.query.stor_id = ''
|
||||
}
|
||||
if (this.sect.length === 2) {
|
||||
this.query.stor_id = this.sect[0]
|
||||
this.query.sect_id = this.sect[1]
|
||||
}
|
||||
}
|
||||
this.query.is_used = '1'
|
||||
this.query.is_delete = '0'
|
||||
this.crud.toQuery()
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.query.sect_id = ''
|
||||
this.query.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_id = val[1]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
this.checkrow = row
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 接受父组件传值
|
||||
* @param msg
|
||||
*/
|
||||
getMsg(msg) {
|
||||
this.mol_type = msg
|
||||
},
|
||||
lockFormat(row, column) {
|
||||
return this.dict.label.d_lock_type[row.lock_type]
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.sects = null
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选仓位')
|
||||
return
|
||||
}
|
||||
// 溢单不允许选择已锁定或者有载具的货位
|
||||
if (this.mol_type === '1') {
|
||||
if (this.checkrow.lock_type !== '00') {
|
||||
this.$message('溢单不允许选择已锁定的货位!')
|
||||
return
|
||||
}
|
||||
}
|
||||
// 损单不允许选择已锁定或者无载具的货位
|
||||
if (this.mol_type === '0') {
|
||||
if (this.checkrow.lock_type !== '00') {
|
||||
this.$message('损单不允许选择已锁定的货位!')
|
||||
return
|
||||
}
|
||||
if (this.checkrow.storagevehicle_code === '') {
|
||||
this.$message('损单不允许选择无载具的货位!')
|
||||
return
|
||||
}
|
||||
}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.checkrow)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
<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.struct_search"
|
||||
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.mol_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="损溢类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_MOL_TYPE"
|
||||
: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.mol_bill_status"
|
||||
: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"
|
||||
:disabled="confirm_flag"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="confirm"
|
||||
>
|
||||
确认
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:max-height="590"
|
||||
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
|
||||
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 :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column prop="mol_code" min-width="140" label="损溢单号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.mol_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :formatter="typeFormat" prop="mol_inv_type" label="损溢类型" />
|
||||
<el-table-column prop="struct_name" label="货位" min-width="150" />
|
||||
<el-table-column label="明细数" align="center" prop="dtl_num" min-width="100" />
|
||||
<el-table-column label="重量" align="center" prop="total_qty" min-width="100" >
|
||||
<template slot-scope="scope">
|
||||
{{ fun(scope.row.total_qty) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :formatter="stateFormat" min-width="100" prop="status" label="单据状态" />
|
||||
<el-table-column label="备注" align="center" min-width="100" prop="remark" />
|
||||
<el-table-column prop="create_mode" min-width="100" :formatter="create_modeFormat" label="生成方式" />
|
||||
<el-table-column label="制单人" align="center" min-width="100" prop="input_optname" />
|
||||
<el-table-column label="制单时间" align="center" prop="input_time" min-width="150" />
|
||||
<el-table-column label="确认人" align="center" prop="confirm_optname" min-width="150" />
|
||||
<el-table-column label="确认时间" align="center" prop="confirm_time" min-width="150" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
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/storage_manage/semiproduct/semiproductMoreOrless/AddDialog'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
|
||||
export default {
|
||||
name: 'MoreOrLess',
|
||||
components: { AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '',
|
||||
optShow: { add: true, reset: true},
|
||||
props: {
|
||||
// 每页数据条数
|
||||
size: 20
|
||||
},
|
||||
idField: 'mol_id',
|
||||
url: '/api/instor/mol',
|
||||
crudMethod: { ...crudMoreOrless }
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: ['mol_bill_status', 'ST_CREATE_MODE', 'ST_MOL_TYPE'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {
|
||||
add: ['admin', 'user:add'],
|
||||
edit: ['admin', 'user:edit'],
|
||||
del: ['admin', 'user:del']
|
||||
},
|
||||
confirm_flag: true,
|
||||
currentRow: null,
|
||||
storlist: [],
|
||||
statuslist: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'user'
|
||||
])
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
fun(val) {
|
||||
return Number(val).toFixed(3)
|
||||
},
|
||||
canUd(row) {
|
||||
return row.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(current) {
|
||||
if (current !== null) {
|
||||
this.currentRow = current
|
||||
if (current.bill_status !== '99') {
|
||||
this.confirm_flag = false
|
||||
} else {
|
||||
this.confirm_flag = true
|
||||
}
|
||||
}
|
||||
}
|
||||
,
|
||||
querytable() {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
handleCurrentChange(currentRow) {
|
||||
if (currentRow === null) {
|
||||
this.currentRow = {}
|
||||
this.confirm_flag = true
|
||||
}
|
||||
},
|
||||
stateFormat(row, column) {
|
||||
return this.dict.label.mol_bill_status[row.status]
|
||||
},
|
||||
typeFormat(row, column) {
|
||||
return this.dict.label.ST_MOL_TYPE[row.mol_type]
|
||||
},
|
||||
create_modeFormat(row, column) {
|
||||
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
||||
},
|
||||
checkboxT(row) {
|
||||
return row.bill_status !== '99'
|
||||
},
|
||||
confirm() {
|
||||
if (!this.currentRow) {
|
||||
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudMoreOrless.confirm(this.currentRow).then(res => {
|
||||
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.refresh()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,59 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/instor/mol',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/instor/mol',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/instor/mol',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getStructIvt(params) {
|
||||
return request({
|
||||
url: '/api/instor/mol/getStructIvt',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function queryMolDtl(params) {
|
||||
return request({
|
||||
url: '/api/instor/mol/queryMolDtl',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function queryMolDetail(params) {
|
||||
return request({
|
||||
url: '/api/instor/mol/queryMolDetail',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function confirm(data) {
|
||||
return request({
|
||||
url: '/api/instor/mol/confirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getStructIvt, queryMolDtl, queryMolDetail, confirm }
|
||||
Reference in New Issue
Block a user