优化
This commit is contained in:
@@ -31,6 +31,15 @@ export function getOutBillDtl(params) {
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function queryDtl2(params) {
|
||||
return request({
|
||||
url: '/api/checkoutbill/queryDtl2',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getOutBillDis(params) {
|
||||
return request({
|
||||
url: '/api/checkoutbill/getOutBillDis',
|
||||
@@ -155,4 +164,4 @@ export function getType() {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType,backConfirm, getOutBillDisDtl, getType }
|
||||
export default { queryDtl2, add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType }
|
||||
|
||||
120
mes/qd/src/views/wms/statistics/outStorQuery/ViewDialog.vue
Normal file
120
mes/qd/src/views/wms/statistics/outStorQuery/ViewDialog.vue
Normal file
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="明细详情"
|
||||
width="1100px"
|
||||
:visible.sync="dialogVisible"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableDtl"
|
||||
style="width: 100%;"
|
||||
max-height="400"
|
||||
size="mini"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" min-width="55" align="center" />
|
||||
<el-table-column prop="formula_code" label="配方号" min-width="120" align="center" />
|
||||
<el-table-column prop="seq_no" label="配方序号" align="center" min-width="70" />
|
||||
<el-table-column min-width="120" prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column min-width="120" prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column prop="pcsn" label="批次号" align="center" min-width="100" />
|
||||
<el-table-column min-width="70" prop="formula_qty" :formatter="crud.formatNum3" label="计划重量" align="center" />
|
||||
<el-table-column min-width="70" prop="confirm_qty" :formatter="crud.formatNum3" label="实际重量" align="center" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" min-width="70" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import checkoutbill from '@/api/wms/st/core/outbill/checkoutbill'
|
||||
import { crud } from '@crud/crud'
|
||||
|
||||
export default {
|
||||
name: 'ViewDialog',
|
||||
// eslint-disable-next-line no-undef
|
||||
mixins: [crud()],
|
||||
components: { },
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
rowmst: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableDtl: [],
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
rowmst: {
|
||||
handler(newValue) {
|
||||
this.form = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
checkoutbill.queryDtl2(this.form).then(res => {
|
||||
this.tableDtl = res
|
||||
})
|
||||
},
|
||||
getSummaries(param) {
|
||||
debugger
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]))
|
||||
if (column.property === 'confirm_qty' || column.property === 'formula_qty') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index]
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.tableDtl = []
|
||||
this.form = {}
|
||||
this.$emit('AddChanged')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
.crud-opts2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -50,12 +50,12 @@
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
@input="onInput()"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
@input="onInput()"
|
||||
@change="mytoQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料">
|
||||
@@ -77,7 +77,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工令">
|
||||
<el-input v-model="query.source_bill_code" size="mini" placeholder="工令号" disabled class="input-with-select">
|
||||
<el-input v-model="query.source_bill_code" size="mini" placeholder="工令号" disabled class="input-with-select">
|
||||
<el-button slot="append" icon="el-icon-search" @click="queryMater" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@@ -94,8 +94,7 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
</crudOperation>
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
@@ -110,9 +109,13 @@
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="material_code" label="物料编码" width="150" align="center" />
|
||||
<el-table-column prop="material_name" label="物料名称" width="150" align="center" />
|
||||
<el-table-column min-width="90" prop="pcsn" label="批次号" align="center" />
|
||||
<el-table-column prop="sum_plan_qty" label="计划重量(KG)" :formatter="crud.formatNum3" width="150" align="center" />
|
||||
<el-table-column prop="sum_real_qty" label="实际重量(KG)" :formatter="crud.formatNum3" width="150" align="center" />
|
||||
<el-table-column prop="pcsn" min-width="130" label="批次号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="mytoView(scope.$index, scope.row)">{{ scope.row.pcsn }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sum_plan_qty" label="计划重量(KG)" :formatter="crud.formatNum3" width="150" align="center" />
|
||||
<el-table-column prop="sum_real_qty" label="实际重量(KG)" :formatter="crud.formatNum3" width="150" align="center" />
|
||||
<el-table-column prop="quality_scode" label="品质类型" align="center" width="110px" :formatter="quality_scodeFormat" />
|
||||
<el-table-column prop="ivt_level" label="库存等级" align="center" width="100px" :formatter="ivt_levelFormat" />
|
||||
<el-table-column prop="is_active" label="是否可用" align="center" width="110px" :formatter="is_activeFormat" />
|
||||
@@ -121,6 +124,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="currentRow" @AddChanged="crud.refresh()"/>
|
||||
<StructIvt :dialog-show.sync="structshow" @StructIvtClosed="queryTableDtl" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -133,18 +137,19 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
import Date from '@/utils/datetime'
|
||||
import ViewDialog from '@/views/wms/statistics/outStorQuery/ViewDialog'
|
||||
import StructIvt from '@/views/wms/statistics/outStorQuery/StructIvt'
|
||||
import crudRawAssist from '@/api/wms/st/core/inbill/rawassist'
|
||||
|
||||
export default {
|
||||
name: 'outStorQuery',
|
||||
components: { StructIvt, crudOperation, rrOperation, pagination },
|
||||
name: 'OutStorQuery',
|
||||
components: { ViewDialog, StructIvt, crudOperation, rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '生产配粉领料',
|
||||
props: {
|
||||
// 每页数据条数
|
||||
size: 20
|
||||
},idField: 'iostorinv_id', url: 'api/checkoutbill/queryDtl', crudMethod: { ...checkoutbill },
|
||||
}, idField: 'iostorinv_id', url: 'api/checkoutbill/queryDtl', crudMethod: { ...checkoutbill },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
@@ -162,7 +167,9 @@ export default {
|
||||
permission: {
|
||||
},
|
||||
structshow: false,
|
||||
query_flag: true,
|
||||
currentRow: null,
|
||||
viewShow: false,
|
||||
storlist: [],
|
||||
billtypelist: []
|
||||
}
|
||||
@@ -181,12 +188,18 @@ export default {
|
||||
this.billtypelist = res
|
||||
})
|
||||
this.crud.query.createTime = [new Date(), new Date()]
|
||||
this.crud.toQuery()
|
||||
},
|
||||
methods: {
|
||||
onInput() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.query_flag) {
|
||||
this.crud.query.begin_time = (new Date()).strftime('%F', 'zh')
|
||||
this.crud.query.end_time = (new Date()).strftime('%F', 'zh')
|
||||
this.query_flag = false
|
||||
}
|
||||
},
|
||||
async queryMater() {
|
||||
this.structshow = true
|
||||
},
|
||||
@@ -199,16 +212,36 @@ export default {
|
||||
is_activeFormat(row, column) {
|
||||
return this.dict.label.is_usable[row.is_active]
|
||||
},
|
||||
mytoView(index, row) {
|
||||
this.currentRow = row
|
||||
this.currentRow.stor_id = this.crud.query.stor_id
|
||||
this.currentRow.begin_time = this.crud.query.begin_time
|
||||
this.currentRow.end_time = this.crud.query.end_time
|
||||
this.currentRow.bill_type = this.crud.query.bill_type
|
||||
this.currentRow.source_bill_code = this.crud.query.source_bill_code
|
||||
this.currentRow.username = this.crud.query.username
|
||||
this.viewShow = true
|
||||
},
|
||||
mytoQuery(array1) {
|
||||
if (array1 === null) {
|
||||
this.crud.query.begin_time = ''
|
||||
this.crud.query.end_time = ''
|
||||
} else {
|
||||
this.crud.query.begin_time = array1[0]
|
||||
this.crud.query.end_time = array1[1]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
queryTableDtl(rows) {
|
||||
let devices = ''
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
if ( i === 0 ) {
|
||||
if (i === 0) {
|
||||
devices = rows[i].workorder_code
|
||||
}else{
|
||||
} else {
|
||||
devices = devices + ',' + rows[i].workorder_code
|
||||
}
|
||||
}
|
||||
if(rows.length > 0){
|
||||
if (rows.length > 0) {
|
||||
this.crud.query.source_bill_code = devices
|
||||
this.crud.toQuery()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user