rev:修改半成品出库页面接口。

This commit is contained in:
2023-04-17 11:22:36 +08:00
parent 640503c693
commit b762ec097a
6 changed files with 714 additions and 516 deletions

View File

@@ -1,228 +1,261 @@
import request from '@/utils/request' import request from '@/utils/request'
export function add(data) { export function add(data) {
return request({ return request({
url: 'api/productOut', url: 'api/semiProductOut',
method: 'post', method: 'post',
data data
}) })
} }
export function del(ids) { export function del(ids) {
return request({ return request({
url: 'api/productOut/', url: 'api/semiProductOut/',
method: 'delete', method: 'delete',
data: ids data: ids
}) })
} }
export function edit(data) { export function edit(data) {
return request({ return request({
url: 'api/productOut', url: 'api/semiProductOut',
method: 'put', method: 'put',
data data
}) })
} }
export function getOutBillDtl(data) { export function getOutBillDtl(data) {
return request({ return request({
url: '/api/productOut/getOutBillDtl', url: '/api/semiProductOut/getOutBillDtl',
method: 'post', method: 'post',
data data
}) })
} }
export function getOutBillDis(data) { export function getOutBillDis(data) {
return request({ return request({
url: '/api/productOut/getOutBillDis', url: '/api/semiProductOut/getOutBillDis',
method: 'post', method: 'post',
data data
}) })
} }
export function getOutBillDisDtl(params) { export function getOutBillDisDtl(params) {
return request({ return request({
url: '/api/productOut/getOutBillDisDtl', url: '/api/semiProductOut/getOutBillDisDtl',
method: 'get', method: 'get',
params params
}) })
} }
export function getOutBillTask(params) { export function getOutBillTask(params) {
return request({ return request({
url: '/api/productOut/getOutBillTask', url: '/api/semiProductOut/getOutBillTask',
method: 'get', method: 'get',
params params
}) })
} }
export function getInvTypes() { export function getInvTypes() {
return request({ return request({
url: '/api/productOut/getInvTypes', url: '/api/semiProductOut/getInvTypes',
method: 'get' method: 'get'
}) })
} }
export function insertDtl(data) { export function insertDtl(data) {
return request({ return request({
url: '/api/productOut/insertDtl', url: '/api/semiProductOut/insertDtl',
method: 'post', method: 'post',
data data
}) })
} }
export function allDiv(data) { export function allDiv(data) {
return request({ return request({
url: '/api/productOut/allDiv', url: '/api/semiProductOut/allDiv',
method: 'post', method: 'post',
data data
}) })
} }
export function allDivOne(data) { export function allDivOne(data) {
return request({ return request({
url: '/api/productOut/allDivOne', url: '/api/semiProductOut/allDivOne',
method: 'post', method: 'post',
data data
}) })
} }
export function allCancel(data) { export function allCancel(data) {
return request({ return request({
url: '/api/productOut/allCancel', url: '/api/semiProductOut/allCancel',
method: 'post', method: 'post',
data data
}) })
} }
export function oneCancel(data) { export function oneCancel(data) {
return request({ return request({
url: '/api/productOut/oneCancel', url: '/api/semiProductOut/oneCancel',
method: 'post', method: 'post',
data data
}) })
} }
export function setPoint(data) { export function setPoint(data) {
return request({
url: '/api/productOut/setPoint', return request({
method: 'post', url: '/api/semiProductOut/setPoint',
data method: 'post',
}) data
})
} }
export function oneSetPoint(data) { export function oneSetPoint(data) {
return request({ return request({
url: '/api/productOut/oneSetPoint', url: '/api/semiProductOut/oneSetPoint',
method: 'post', method: 'post',
data data
}) })
} }
export function getStructIvt(params) { export function getStructIvt(params) {
return request({ return request({
url: '/api/productOut/getStructIvt', url: '/api/semiProductOut/getStructIvt',
method: 'get', method: 'get',
params params
}) })
} }
export function manualDiv(data) { export function manualDiv(data) {
return request({ return request({
url: '/api/productOut/manualDiv', url: '/api/semiProductOut/manualDiv',
method: 'post', method: 'post',
data data
}) })
} }
export function confirm(data) { export function confirm(data) {
return request({ return request({
url: '/api/productOut/confirm', url: '/api/semiProductOut/confirm',
method: 'post', method: 'post',
data data
}) })
} }
export function issueTask(data) { export function issueTask(data) {
return request({ return request({
url: '/api/productOut/issueTask', url: '/api/semiProductOut/issueTask',
method: 'post', method: 'post',
data data
}) })
} }
export function finishTask(data) { export function finishTask(data) {
return request({ return request({
url: '/api/productOut/finishTask', url: '/api/semiProductOut/finishTask',
method: 'post', method: 'post',
data data
}) })
} }
export function cancleTaskfinish(data) { export function cancleTaskfinish(data) {
return request({ return request({
url: '/api/productOut/cancleTaskfinish', url: '/api/semiProductOut/cancleTaskfinish',
method: 'post', method: 'post',
data data
}) })
} }
export function paramByCodeType(data) { export function paramByCodeType(data) {
return request({ return request({
url: '/api/productOut/paramByCodeType', url: '/api/semiProductOut/paramByCodeType',
method: 'post', method: 'post',
data data
}) })
} }
export function schAreaType(data) { export function schAreaType(data) {
return request({ return request({
url: '/api/productOut/schAreaType', url: '/api/semiProductOut/schAreaType',
method: 'post', method: 'post',
data data
}) })
} }
export function backConfirm(data) { export function backConfirm(data) {
return request({ return request({
url: '/api/productOut/backConfirm', url: '/api/semiProductOut/backConfirm',
method: 'post', method: 'post',
data data
}) })
} }
export function getType() { export function getType() {
return request({ return request({
url: '/api/productOut/getType', url: '/api/semiProductOut/getType',
method: 'get' method: 'get'
}) })
} }
export function moneySubmit(data) { export function moneySubmit(data) {
return request({ return request({
url: '/api/productOut/moneySubmit', url: '/api/semiProductOut/moneySubmit',
method: 'post', method: 'post',
data data
}) })
} }
export function getDisNum(data) { export function getDisNum(data) {
return request({ return request({
url: '/api/productOut/getDisNum', url: '/api/semiProductOut/getDisNum',
method: 'post', method: 'post',
data data
}) })
} }
export function queryBox(data) { export function queryBox(data) {
return request({ return request({
url: '/api/productOut/queryBox', url: '/api/semiProductOut/queryBox',
method: 'post', method: 'post',
data data
}) })
} }
export function getOutBillTask2(data) { export function getOutBillTask2(data) {
return request({ return request({
url: '/api/productOut/getOutBillTask2', url: '/api/semiProductOut/getOutBillTask2',
method: 'post', method: 'post',
data data
}) })
} }
export function cancelTask(data) { export function cancelTask(data) {
return request({ return request({
url: '/api/productOut/cancelTask', url: '/api/semiProductOut/cancelTask',
method: 'post', method: 'post',
data data
}) })
} }
export function allSetPoint(data) { export function allSetPoint(data) {
return request({ return request({
url: '/api/productOut/allSetPoint', url: '/api/semiProductOut/allSetPoint',
method: 'post', method: 'post',
data data
}) })
} }
export function oneSetPoint2(data) { export function oneSetPoint2(data) {
return request({ return request({
url: '/api/productOut/oneSetPoint2', url: '/api/semiProductOut/oneSetPoint2',
method: 'post', method: 'post',
data data
}) })
}
export default {
add,
edit,
del,
allDiv,
allCancel,
getOutBillDtl,
getOutBillDis,
setPoint,
oneSetPoint,
getOutBillTask,
getStructIvt,
manualDiv,
confirm,
issueTask,
finishTask,
cancleTaskfinish,
getInvTypes,
paramByCodeType,
schAreaType,
backConfirm,
getOutBillDisDtl,
getType,
allDivOne,
moneySubmit,
getDisNum,
queryBox,
getOutBillTask2,
oneCancel,
cancelTask,
allSetPoint,
oneSetPoint2
} }
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2 }

View File

@@ -81,7 +81,7 @@ export default {
components: { rrOperation, pagination }, components: { rrOperation, pagination },
cruds() { cruds() {
return CRUD({ return CRUD({
title: '用户', url: 'api/productOut/addDtl', title: '用户', url: 'api/semiProductOut/addDtl',
optShow: { optShow: {
add: false, add: false,
edit: false, edit: false,

View File

@@ -1,69 +1,28 @@
<template> <template>
<el-dialog <el-dialog append-to-body title="出库单详情" :visible.sync="dialogVisible" destroy-on-close fullscreen @close="close"
append-to-body @open="open">
title="出库单详情" <el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form"
:visible.sync="dialogVisible" size="mini" label-width="85px" label-suffix=":">
destroy-on-close
fullscreen
@close="close"
@open="open"
>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="单据号" prop="bill_code"> <el-form-item label="单据号" prop="bill_code">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label> <label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" /> <el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
</el-form-item> </el-form-item>
<el-form-item label="生产区域"> <el-form-item label="生产区域">
<el-select <el-select v-model="form.product_code" clearable size="mini" placeholder="全部" :disabled="true" class="filter-item"
v-model="form.product_code" @change="crud.toQuery">
clearable <el-option v-for="item in dict.product_area" :key="item.value" :label="item.label" :value="item.value" />
size="mini"
placeholder="全部"
:disabled="true"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.product_area"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="业务类型" prop="bill_type"> <el-form-item label="业务类型" prop="bill_type">
<el-select <el-select v-model="form.bill_type" clearable filterable size="mini" placeholder="业务类型" class="filter-item"
v-model="form.bill_type" disabled>
clearable <el-option v-for="item in dict.bill_type" :key="item.value" :label="item.label" :value="item.value" />
filterable
size="mini"
placeholder="业务类型"
class="filter-item"
disabled
>
<el-option
v-for="item in dict.bill_type"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="单据状态" prop="bill_status"> <el-form-item label="单据状态" prop="bill_status">
<el-select <el-select v-model="form.bill_status" clearable style="width: 210px" placeholder="单据状态" class="filter-item"
v-model="form.bill_status" disabled>
clearable <el-option v-for="item in dict.io_bill_status" :key="item.id" :label="item.label" :value="item.value" />
style="width: 210px"
placeholder="单据状态"
class="filter-item"
disabled
>
<el-option
v-for="item in dict.io_bill_status"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="明细数" prop="detail_count"> <el-form-item label="明细数" prop="detail_count">
@@ -72,17 +31,12 @@
</el-form-item> </el-form-item>
<el-form-item label="总重量" prop="total_qty"> <el-form-item label="总重量" prop="total_qty">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label> <label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input-number <el-input-number v-model="form.total_qty" :controls="false" :precision="3" :min="0" disabled
v-model="form.total_qty" style="width: 210px" />
:controls="false"
:precision="3"
:min="0"
disabled
style="width: 210px"
/>
</el-form-item> </el-form-item>
<el-form-item label="业务日期" prop="biz_date"> <el-form-item label="业务日期" prop="biz_date">
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="true" /> <el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px"
value-format="yyyy-MM-dd" :disabled="true" />
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label> <label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
@@ -92,19 +46,11 @@
<div class="crud-opts2"> <div class="crud-opts2">
<span class="role-span2">出库明细</span> <span class="role-span2">出库明细</span>
</div> </div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}"> <el-card class="box-card" shadow="never" :body-style="{ padding: '0' }">
<!--表格渲染--> <!--表格渲染-->
<el-table <el-table ref="table" :data="tableDtl" style="width: 100%;" max-height="300" size="mini" border
ref="table" :highlight-current-row="true" :header-cell-style="{ background: '#f5f7fa', color: '#606266' }"
:data="tableDtl" @current-change="handleDtlCurrentChange">
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" /> <el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" />
<el-table-column min-width="140" show-overflow-tooltip prop="material_code" label="物料编码" align="center" /> <el-table-column min-width="140" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
@@ -121,19 +67,11 @@
<div class="crud-opts2"> <div class="crud-opts2">
<span class="role-span">作业明细</span> <span class="role-span">作业明细</span>
</div> </div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}"> <el-card class="box-card" shadow="never" :body-style="{ padding: '0' }">
<!--表格渲染--> <!--表格渲染-->
<el-table <el-table ref="table2" :data="tabledis" style="width: 100%;" max-height="300" size="mini" border
ref="table2" :highlight-current-row="true" :header-cell-style="{ background: '#f5f7fa', color: '#606266' }"
:data="tabledis" @current-change="handleDisCurrentChange">
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDisCurrentChange"
>
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" /> <el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" /> <el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" /> <el-table-column min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
@@ -155,7 +93,7 @@ import crudProductIn from '@/views/wms/st/productIn/productin'
export default { export default {
name: 'ViewDialog', name: 'ViewDialog',
components: { }, components: {},
mixins: [crud()], mixins: [crud()],
dicts: ['io_bill_status', 'work_status', 'task_status', 'SCH_TASK_TYPE_DTL', 'bill_type', 'product_area'], dicts: ['io_bill_status', 'work_status', 'task_status', 'SCH_TASK_TYPE_DTL', 'bill_type', 'product_area'],
props: { props: {
@@ -167,7 +105,7 @@ export default {
type: Object type: Object
} }
}, },
data() { data () {
return { return {
dialogVisible: false, dialogVisible: false,
tableDtl: [], tableDtl: [],
@@ -180,26 +118,26 @@ export default {
}, },
watch: { watch: {
dialogShow: { dialogShow: {
handler(newValue) { handler (newValue) {
this.dialogVisible = newValue this.dialogVisible = newValue
} }
}, },
rowmst: { rowmst: {
handler(newValue) { handler (newValue) {
this.form = newValue this.form = newValue
} }
} }
}, },
created() { created () {
crudProductIn.queryStor().then(res => { crudProductIn.queryStor().then(res => {
this.storlist = res this.storlist = res
}) })
}, },
methods: { methods: {
open() { open () {
this.queryTableDtl() this.queryTableDtl()
}, },
close() { close () {
this.$emit('update:dialogShow', false) this.$emit('update:dialogShow', false)
this.currentDis = {} this.currentDis = {}
this.currentdtl = null this.currentdtl = null
@@ -207,19 +145,19 @@ export default {
this.tabledis = [] this.tabledis = []
this.$emit('AddChanged') this.$emit('AddChanged')
}, },
bill_statusFormat(row) { bill_statusFormat (row) {
return this.dict.label.io_bill_status[row.bill_status] return this.dict.label.io_bill_status[row.bill_status]
}, },
taskdtl_typeFormat(row) { taskdtl_typeFormat (row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type] return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
}, },
task_statusFormat(row) { task_statusFormat (row) {
return this.dict.label.task_status[row.task_status] return this.dict.label.task_status[row.task_status]
}, },
work_statusFormat(row) { work_statusFormat (row) {
return this.dict.label.work_status[row.work_status] return this.dict.label.work_status[row.work_status]
}, },
handleDtlCurrentChange(current) { handleDtlCurrentChange (current) {
if (current !== null) { if (current !== null) {
this.tabledis = [] this.tabledis = []
this.currentdtl = current this.currentdtl = current
@@ -229,22 +167,22 @@ export default {
this.currentdtl = {} this.currentdtl = {}
} }
}, },
invtypeFormat(row, column) { invtypeFormat (row, column) {
for (const item of this.billtypelist) { for (const item of this.billtypelist) {
if (item.code === row.source_bill_type) { if (item.code === row.source_bill_type) {
return item.name return item.name
} }
} }
}, },
handleDisCurrentChange(current) { handleDisCurrentChange (current) {
this.currentDis = current this.currentDis = current
}, },
queryTableDtl() { queryTableDtl () {
productOut.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => { productOut.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
this.tableDtl = res this.tableDtl = res
}) })
}, },
queryTableDdis() { queryTableDdis () {
if (this.currentdtl !== null) { if (this.currentdtl !== null) {
productOut.getOutBillDis({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id }).then(res => { productOut.getOutBillDis({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id }).then(res => {
this.tabledis = res this.tabledis = res
@@ -267,15 +205,15 @@ export default {
.crud-opts2 .el-dialog__title2 { .crud-opts2 .el-dialog__title2 {
line-height: 24px; line-height: 24px;
font-size:20px; font-size: 20px;
color:#303133; color: #303133;
} }
.crud-opts2 .role-span2 { .crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px; padding: 0px 0px 20px 0px;
} }
.crud-opts2 { .crud-opts2 {
padding: 10px 0px 0px 50px; padding: 10px 0px 0px 50px;
} }
</style> </style>

View File

@@ -15,16 +15,44 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<span> <span>
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button> <el-button
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</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> </span>
</el-col> </el-col>
</el-row> </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
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"> <el-form-item label="单据号" prop="bill_code">
<label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label> <label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" /> <el-input
v-model="form.bill_code"
disabled
placeholder="系统生成"
clearable
style="width: 210px"
/>
</el-form-item> </el-form-item>
<el-form-item label="仓库" prop="product_code"> <el-form-item label="仓库" prop="product_code">
<label slot="label">生产区域:</label> <label slot="label">生产区域:</label>
@@ -79,7 +107,12 @@
</el-form-item> </el-form-item>
<el-form-item label="明细数" prop="detail_count"> <el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label> <label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label>
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" /> <el-input
v-model="form.detail_count"
size="mini"
disabled
style="width: 210px"
/>
</el-form-item> </el-form-item>
<el-form-item label="总重量" prop="total_qty"> <el-form-item label="总重量" prop="total_qty">
<label slot="label">总&nbsp;&nbsp;重&nbsp;量:</label> <label slot="label">总&nbsp;&nbsp;重&nbsp;量:</label>
@@ -93,11 +126,26 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="业务日期" prop="biz_date"> <el-form-item label="业务日期" prop="biz_date">
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" /> <el-date-picker
v-model="form.biz_date"
type="date"
placeholder="选择日期"
style="width: 210px"
value-format="yyyy-MM-dd"
:disabled="crud.status.view > 0"
/>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label> <label slot="label"
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" /> >备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label
>
<el-input
v-model="form.remark"
style="width: 380px;"
rows="2"
type="textarea"
:disabled="crud.status.view > 0"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
@@ -117,7 +165,6 @@
添加物料 添加物料
</el-button> </el-button>
</span> </span>
</div> </div>
<!--表格渲染--> <!--表格渲染-->
<el-table <el-table
@@ -125,13 +172,25 @@
:data="form.tableData" :data="form.tableData"
style="width: 100%;" style="width: 100%;"
border border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}" :header-cell-style="{ background: '#f5f7fa', color: '#606266' }"
> >
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" /> <el-table-column
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" /> show-overflow-tooltip
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" /> prop="material_code"
label="物料编码"
/>
<el-table-column
show-overflow-tooltip
prop="material_name"
label="物料名称"
/>
<el-table-column
show-overflow-tooltip
prop="material_spec"
label="物料规格"
/>
<el-table-column show-overflow-tooltip prop="pcsn" label="订单号"> <el-table-column show-overflow-tooltip prop="pcsn" label="订单号">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
@@ -156,7 +215,13 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right"> <el-table-column
v-if="crud.status.cu > 0"
align="center"
label="操作"
width="170"
fixed="right"
>
<template scope="scope"> <template scope="scope">
<el-button <el-button
type="danger" type="danger"
@@ -175,33 +240,32 @@
:mater-opt-code="materType" :mater-opt-code="materType"
@setMaterValue="tableChanged" @setMaterValue="tableChanged"
/> />
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import CRUD, { crud, form } from '@crud/crud' import CRUD, { crud, form } from "@crud/crud";
import crudSemiProductIn from '@/api/wms/st/in/semiProductIn' import crudSemiProductIn from "@/api/wms/st/in/semiProductIn";
import MaterDtl from '@/views/wms/pub/MaterDialog' import MaterDtl from "@/views/wms/pub/MaterDialog";
const defaultForm = { const defaultForm = {
bill_code: '', bill_code: "",
product_code: 'A1', product_code: "A1",
bill_status: '10', bill_status: "10",
total_qty: '0', total_qty: "0",
detail_count: '0', detail_count: "0",
bill_type: '', bill_type: "",
remark: '', remark: "",
biz_date: new Date(), biz_date: new Date(),
create_mode: '', create_mode: "",
tableData: [] tableData: []
} };
export default { export default {
name: 'AddDialog', name: "AddDialog",
components: { MaterDtl }, components: { MaterDtl },
mixins: [crud(), form(defaultForm)], mixins: [crud(), form(defaultForm)],
dicts: ['IO_BILL_STATUS', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'], dicts: ["IO_BILL_STATUS", "ST_QUALITY_SCODE", "bill_type", "product_area"],
props: { props: {
dialogShow: { dialogShow: {
type: Boolean, type: Boolean,
@@ -217,121 +281,130 @@ export default {
materShow: false, materShow: false,
dtlShow: false, dtlShow: false,
opendtlParam: null, opendtlParam: null,
materType: '03', // 关键成品 materType: "03", // 关键成品
storlist: [], storlist: [],
billtypelist: [], billtypelist: [],
rules: { rules: {
product_code: [ product_code: [
{ required: true, message: '生产区域不能为空', trigger: 'blur' } { required: true, message: "生产区域不能为空", trigger: "blur" }
], ],
bill_type: [ bill_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' } { required: true, message: "业务类型不能为空", trigger: "blur" }
], ],
biz_date: [ biz_date: [
{ required: true, message: '业务日期不能为空', trigger: 'blur' } { required: true, message: "业务日期不能为空", trigger: "blur" }
] ]
} }
} };
}, },
watch: { watch: {
dialogShow: { dialogShow: {
handler(newValue, oldValue) { handler(newValue, oldValue) {
this.dialogVisible = newValue this.dialogVisible = newValue;
} }
} }
}, },
methods: { methods: {
open() { open() {
crudSemiProductIn.queryStor().then(res => { crudSemiProductIn.queryStor().then(res => {
this.storlist = res this.storlist = res;
}) });
}, },
close() { close() {
this.$emit('AddChanged') this.$emit("AddChanged");
}, },
[CRUD.HOOK.afterToEdit]() { [CRUD.HOOK.afterToEdit]() {
// 获取入库单明细 // 获取入库单明细
crudSemiProductIn.getIODtl({ 'bill_code': this.form.bill_code }).then(res => { crudSemiProductIn
this.form.tableData = res .getIODtl({ bill_code: this.form.bill_code })
// 将明细变成不可编辑 .then(res => {
for (let i = 0; i < this.form.tableData.length; i++) { this.form.tableData = res;
const row = this.form.tableData[i] // 将明细变成不可编辑
this.form.tableData.splice(i, 1, row) for (let i = 0; i < this.form.tableData.length; i++) {
} const row = this.form.tableData[i];
}) this.form.tableData.splice(i, 1, row);
}
});
}, },
[CRUD.HOOK.afterToView]() { [CRUD.HOOK.afterToView]() {
crudSemiProductIn.getIODtl({ 'bill_code': this.form.bill_code }).then(res => { crudSemiProductIn
this.form.tableData = res .getIODtl({ bill_code: this.form.bill_code })
// 将明细变成不可编辑 .then(res => {
for (let i = 0; i < this.form.tableData.length; i++) { this.form.tableData = res;
const row = this.form.tableData[i] // 将明细变成不可编辑
this.form.tableData.splice(i, 1, row) for (let i = 0; i < this.form.tableData.length; i++) {
} const row = this.form.tableData[i];
}) this.form.tableData.splice(i, 1, row);
}
});
}, },
[CRUD.HOOK.beforeSubmit]() { [CRUD.HOOK.beforeSubmit]() {
// 提交前校验 // 提交前校验
if (this.form.tableData.length === 0) { if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO) this.crud.notify("请至少选择一条明细", CRUD.NOTIFICATION_TYPE.INFO);
return false return false;
} }
for (let i = 0; i < this.form.tableData.length; i++) { for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i] const row = this.form.tableData[i];
if (!row.pcsn || !row.plan_qty) { if (!row.pcsn || !row.plan_qty) {
this.crud.notify('订单号、数量不能为空', CRUD.NOTIFICATION_TYPE.INFO) this.crud.notify("订单号、数量不能为空", CRUD.NOTIFICATION_TYPE.INFO);
return false return false;
} }
} }
}, },
deleteRow(index, rows) { deleteRow(index, rows) {
const material_code = rows[index].material_code const material_code = rows[index].material_code;
let len = rows.length let len = rows.length;
while (len--) { while (len--) {
const obj = rows[len] const obj = rows[len];
if (material_code === obj.material_code) { if (material_code === obj.material_code) {
const index = rows.indexOf(obj) const index = rows.indexOf(obj);
if (index > -1) { // 移除找到的指定元素 if (index > -1) {
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty) // 移除找到的指定元素
rows.splice(index, 1) this.form.total_qty =
this.form.detail_count = this.form.tableData.length parseFloat(this.form.total_qty) -
parseFloat(rows[index].plan_qty);
rows.splice(index, 1);
this.form.detail_count = this.form.tableData.length;
} }
} }
} }
}, },
tableChanged(rows) { tableChanged(rows) {
// 对新增的行进行校验不能存在相同物料批次 // 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => { rows.forEach(item => {
let same_mater = true let same_mater = true;
this.form.tableData.forEach((row) => { this.form.tableData.forEach(row => {
if (row.material_code === item.material_code) { if (row.material_code === item.material_code) {
same_mater = false same_mater = false;
} }
}) });
if (same_mater) { if (same_mater) {
item.quality_scode = '01' item.quality_scode = "01";
item.ivt_level = '01' item.ivt_level = "01";
item.is_active = '1' item.is_active = "1";
item.plan_qty = '1' item.plan_qty = "1";
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty) this.form.total_qty =
this.form.tableData.splice(-1, 0, item) parseFloat(this.form.total_qty) + parseFloat(item.plan_qty);
this.form.tableData.splice(-1, 0, item);
} }
}) });
this.form.detail_count = this.form.tableData.length this.form.detail_count = this.form.tableData.length;
}, },
insertEvent(row) { insertEvent(row) {
this.materShow = true this.materShow = true;
}, },
changeQty() { changeQty() {
this.form.total_qty = 0 this.form.total_qty = 0;
this.form.tableData.forEach((item) => { this.form.tableData.forEach(item => {
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty) this.form.total_qty =
}) parseFloat(this.form.total_qty) + parseFloat(item.plan_qty);
});
} }
} }
} };
</script> </script>
<style> <style>

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog <el-dialog
title="出库单编辑" title="出库单新增"
append-to-body append-to-body
fullscreen fullscreen
:before-close="crud.cancelCU" :before-close="crud.cancelCU"
@@ -14,23 +14,50 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<span> <span>
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button> <el-button
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</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> </span>
</el-col> </el-col>
</el-row> </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
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"> <el-form-item label="单据号" prop="bill_code">
<label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label> <label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label>
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" /> <el-input
v-model="form.bill_code"
disabled
placeholder="系统生成"
clearable
style="width: 210px"
/>
</el-form-item> </el-form-item>
<el-form-item label="生产区域" prop="product_code"> <el-form-item label="生产区域" prop="product_code">
<label slot="label">生产区域:</label> <label slot="label">生产区域:</label>
<el-select <el-select
v-model="form.product_code" v-model="form.product_code"
clearable clearable
placeholder="生产区域"
class="filter-item" class="filter-item"
style="width: 210px" style="width: 210px"
:disabled="crud.status.view > 0" :disabled="crud.status.view > 0"
@@ -80,7 +107,12 @@
</el-form-item> </el-form-item>
<el-form-item label="明细数" prop="detail_count"> <el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label> <label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label>
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" /> <el-input
v-model="form.detail_count"
size="mini"
disabled
style="width: 210px"
/>
</el-form-item> </el-form-item>
<el-form-item label="总重量" prop="total_qty"> <el-form-item label="总重量" prop="total_qty">
<label slot="label">总&nbsp;&nbsp;重&nbsp;量:</label> <label slot="label">总&nbsp;&nbsp;重&nbsp;量:</label>
@@ -94,18 +126,32 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="业务日期" prop="biz_date"> <el-form-item label="业务日期" prop="biz_date">
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" /> <el-date-picker
v-model="form.biz_date"
type="date"
placeholder="选择日期"
style="width: 210px"
value-format="yyyy-MM-dd"
:disabled="crud.status.view > 0"
/>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label> <label slot="label"
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="crud.status.view > 0" /> >备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label
>
<el-input
v-model="form.remark"
style="width: 380px;"
rows="2"
type="textarea"
:disabled="crud.status.view > 0"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="crud-opts2"> <div class="crud-opts2">
<span class="role-span">出库明细</span> <span class="role-span">出库明细</span>
<span v-if="crud.status.cu > 0" class="crud-opts-right2"> <span v-if="crud.status.cu > 0" class="crud-opts-right2">
<!--左侧插槽--> <!--左侧插槽-->
<slot name="left" /> <slot name="left" />
<el-button <el-button
@@ -118,7 +164,7 @@
> >
添加物料 添加物料
</el-button> </el-button>
<!-- <el-button <!-- <el-button
slot="left" slot="left"
class="filter-item" class="filter-item"
type="primary" type="primary"
@@ -129,7 +175,6 @@
新增一行 新增一行
</el-button>--> </el-button>-->
</span> </span>
</div> </div>
<!--表格渲染--> <!--表格渲染-->
<el-table <el-table
@@ -137,72 +182,128 @@
:data="form.tableData" :data="form.tableData"
style="width: 100%;" style="width: 100%;"
border border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}" :header-cell-style="{ background: '#f5f7fa', color: '#606266' }"
> >
<el-table-column type="index" label="序号" width="50" align="center" /> <el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="190" align="center"> <el-table-column
<!-- <template scope="scope"> show-overflow-tooltip
prop="material_code"
label="物料编码"
width="190"
align="center"
>
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.material_code" disabled class="input-with-select"> <el-input v-show="!scope.row.edit" 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-button slot="append" icon="el-icon-search" @click="queryMater(scope.$index, scope.row)" />
</el-input> </el-input>
<span v-show="scope.row.edit">{{ scope.row.material_code }}</span> <span v-show="scope.row.edit">{{ scope.row.material_code }}</span>
</template>--> </template>
</el-table-column> </el-table-column>
<el-table-column prop="material_name" label="物料名称" align="center" min-width="150px" show-overflow-tooltip /> <el-table-column
<el-table-column prop="material_spec" label="物料规格" align="center" min-width="150px" show-overflow-tooltip /> prop="material_name"
<el-table-column show-overflow-tooltip prop="pcsn" label="订单号" width="150px" align="center"> label="物料名称"
<!-- <template scope="scope"> align="center"
min-width="150px"
show-overflow-tooltip
/>
<el-table-column
prop="material_spec"
label="物料规格"
align="center"
min-width="150px"
show-overflow-tooltip
/>
<el-table-column
show-overflow-tooltip
prop="pcsn"
label="订单号"
width="150px"
align="center"
>
<!-- <template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.pcsn" size="mini" /> <el-input v-show="!scope.row.edit" v-model="scope.row.pcsn" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.pcsn }}</span> <span v-show="scope.row.edit">{{ scope.row.pcsn }}</span>
</template>--> </template>-->
</el-table-column> </el-table-column>
<el-table-column prop="plan_qty" label="出库重量" width="150" align="center"> <el-table-column
prop="plan_qty"
label="出库重量"
width="150"
align="center"
>
<template scope="scope"> <template scope="scope">
<el-input-number v-model="scope.row.plan_qty" :precision="3" :controls="false" :min="1" style="width: 120px" /> <el-input-number
<!-- <span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>--> v-model="scope.row.plan_qty"
:precision="3"
:controls="false"
:min="1"
style="width: 120px"
/>
<!-- <span v-show="scope.row.edit">{{ scope.row.plan_qty }}</span>-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="qty_unit_name" label="单位" align="center" /> <el-table-column prop="qty_unit_name" label="单位" align="center" />
<!-- <el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center"> <!-- <el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center">
<template scope="scope"> <template scope="scope">
<el-input v-model="scope.row.remark" size="mini" /> <el-input v-model="scope.row.remark" size="mini" />
<span>{{ scope.row.remark }}</span> <span>{{ scope.row.remark }}</span>
</template> </template>
</el-table-column>--> </el-table-column>-->
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="160" fixed="right"> <el-table-column
v-if="crud.status.cu > 0"
align="center"
label="操作"
width="160"
fixed="right"
>
<template scope="scope"> <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
type="danger"
class="filter-item"
size="mini"
icon="el-icon-delete"
@click.native.prevent="deleteRow(scope.$index, form.tableData)"
/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged5" /> <AddDtl
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" /> :dialog-show.sync="dtlShow"
:stor-id="storId"
@tableChanged="tableChanged5"
/>
<MaterDialog
:dialog-show.sync="materShow"
:mater-opt-code.sync="materType"
@setMaterValue="setMaterValue"
/>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import CRUD, { crud, form } from '@crud/crud' import CRUD, { crud, form } from "@crud/crud";
import AddDtl from '@/views/wms/st/semiProductOut/AddDtl' import AddDtl from "@/views/wms/st/semiProductOut/AddDtl";
import MaterDialog from '@/views/wms/pub/MaterDialog' import MaterDialog from "@/views/wms/pub/MaterDialog";
import crudSemiProductIn from '@/api/wms/st/out/semiProductOut' import crudSemiProductIn from "@/api/wms/st/out/semiProductOut";
const defaultForm = { const defaultForm = {
bill_code: '', bill_code: "",
stor_id: '', stor_id: "",
stor_code: '', stor_code: "",
stor_name: '', stor_name: "",
bill_status: '10', product_code:"A1",
total_qty: '0', bill_status: "10",
detail_count: '0', total_qty: "0",
bill_type: '', detail_count: "0",
remark: '', bill_type: "",
remark: "",
biz_date: new Date(), biz_date: new Date(),
out_stor_id: '', out_stor_id: "",
create_mode: '', create_mode: "",
tableData: [] tableData: []
} };
export default { export default {
name: 'AddDialog', name: "AddDialog",
components: { AddDtl, MaterDialog }, components: { AddDtl, MaterDialog },
mixins: [crud(), form(defaultForm)], mixins: [crud(), form(defaultForm)],
props: { props: {
@@ -211,161 +312,182 @@ export default {
default: false default: false
} }
}, },
dicts: ['IO_BILL_STATUS', 'bill_type', 'product_area'], dicts: ["IO_BILL_STATUS", "bill_type", "product_area"],
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
dtlShow: false, dtlShow: false,
materType: '', materType: "",
materShow: false, materShow: false,
flagnow: false, flagnow: false,
nowrow: {}, nowrow: {},
nowindex: '', nowindex: "",
storlist: [], storlist: [],
inStorList: [], inStorList: [],
invtypelist: [], invtypelist: [],
storId: null, storId: null,
rules: { rules: {
product_code: [ product_code: [
{ required: true, message: '生产区域不能为空', trigger: 'blur' } { required: true, message: "生产区域不能为空", trigger: "blur" }
], ],
bill_type: [ bill_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' } { required: true, message: "业务类型不能为空", trigger: "blur" }
], ],
biz_date: [ biz_date: [
{ required: true, message: '业务日期不能为空', trigger: 'blur' } { required: true, message: "业务日期不能为空", trigger: "blur" }
] ]
} }
} };
}, },
watch: { watch: {
dialogShow: { dialogShow: {
handler(newValue) { handler(newValue) {
this.dialogVisible = newValue this.dialogVisible = newValue;
} }
} }
}, },
methods: { methods: {
open() { open() {
crudSemiProductIn.queryStor().then(res => { crudSemiProductIn.queryStor().then(res => {
this.storlist = res this.storlist = res;
}) });
}, },
close() { close() {
this.$emit('AddChanged') this.$emit("AddChanged");
}, },
[CRUD.HOOK.beforeSubmit]() { [CRUD.HOOK.beforeSubmit]() {
if (this.form.tableData.length === 0) { if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO) this.crud.notify("请至少选择一条明细", CRUD.NOTIFICATION_TYPE.INFO);
return false return false;
} }
}, },
[CRUD.HOOK.afterToEdit]() { [CRUD.HOOK.afterToEdit]() {
semiSemiProductOut.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => { semiSemiProductOut
this.form.tableData = res .getOutBillDtl({ iostorinv_id: this.form.iostorinv_id })
// 将明细变成不可编辑 .then(res => {
/* for (let i = 0; i < this.form.tableData.length; i++) { this.form.tableData = res;
// 将明细变成不可编辑
/* for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i] const row = this.form.tableData[i]
row.edit = false row.edit = false
this.form.tableData.splice(i, 1, row) this.form.tableData.splice(i, 1, row)
}*/ }*/
}) });
}, },
[CRUD.HOOK.afterToView]() { [CRUD.HOOK.afterToView]() {
semiSemiProductOut.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => { semiSemiProductOut
this.form.tableData = res .getOutBillDtl({ iostorinv_id: this.form.iostorinv_id })
// 将明细变成不可编辑 .then(res => {
for (let i = 0; i < this.form.tableData.length; i++) { this.form.tableData = res;
const row = this.form.tableData[i] // 将明细变成不可编辑
row.edit = true for (let i = 0; i < this.form.tableData.length; i++) {
this.form.tableData.splice(i, 1, row) const row = this.form.tableData[i];
} row.edit = true;
}) this.form.tableData.splice(i, 1, row);
}
});
}, },
invtypeFormat(row, column) { invtypeFormat(row, column) {
return this.dict.label.bill_type[row.source_bill_type] return this.dict.label.bill_type[row.source_bill_type];
}, },
storChange(row) { storChange(row) {
this.storlist.forEach((item) => { this.storlist.forEach(item => {
if (item.product_code === row) { if (item.product_code === row) {
this.form.product_code = item.product_code this.form.product_code = item.product_code;
} }
}) });
}, },
async queryMater(index, row) { async queryMater(index, row) {
if (this.form.bill_type === '') { if (this.form.bill_type === "") {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO) this.crud.notify("请选择业务类型", CRUD.NOTIFICATION_TYPE.INFO);
return return;
} }
this.materShow = true this.materShow = true;
this.nowindex = index this.nowindex = index;
this.nowrow = row this.nowrow = row;
}, },
queryDtl(index, row) { queryDtl(index, row) {
if (this.form.bill_type === '') { if (this.form.bill_type === "") {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO) this.crud.notify("请选择业务类型", CRUD.NOTIFICATION_TYPE.INFO);
return return;
} }
if (this.form.product_code === '') { if (this.form.product_code === "") {
this.crud.notify('请选择生产区域!', CRUD.NOTIFICATION_TYPE.INFO) this.crud.notify("请选择生产区域", CRUD.NOTIFICATION_TYPE.INFO);
return return;
} }
this.storId = this.form.product_code this.storId = this.form.product_code;
this.dtlShow = true this.dtlShow = true;
}, },
tableChanged5(rows) { tableChanged5(rows) {
rows.forEach((item) => { rows.forEach(item => {
debugger debugger;
if (this.form.tableData.length !== 0) { if (this.form.tableData.length !== 0) {
this.flagnow = false this.flagnow = false;
for (let i = 0; i < this.form.tableData.length; i++) { for (let i = 0; i < this.form.tableData.length; i++) {
if (this.form.tableData[i].material_id === item.material_id && this.form.tableData[i].pcsn === item.pcsn) { if (
this.flagnow = true this.form.tableData[i].material_id === item.material_id &&
this.form.tableData[i].pcsn === item.pcsn
) {
this.flagnow = true;
} }
} }
if (!this.flagnow) { if (!this.flagnow) {
item.edit = true item.edit = true;
this.form.tableData.splice(-1, 0, item) this.form.tableData.splice(-1, 0, item);
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty) this.form.total_qty =
parseFloat(this.form.total_qty) + parseFloat(item.plan_qty);
} }
} else { } else {
item.edit = true item.edit = true;
this.form.tableData.splice(-1, 0, item) this.form.tableData.splice(-1, 0, item);
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty) this.form.total_qty =
parseFloat(this.form.total_qty) + parseFloat(item.plan_qty);
} }
}) });
this.form.detail_count = this.form.tableData.length this.form.detail_count = this.form.tableData.length;
}, },
setMaterValue(row) { setMaterValue(row) {
for (let i = 0; i < this.form.tableData.length; i++) { for (let i = 0; i < this.form.tableData.length; i++) {
if (this.form.tableData[i].material_id === row.material_id) { if (this.form.tableData[i].material_id === row.material_id) {
this.crud.notify('不允许添加相同物料') this.crud.notify("不允许添加相同物料");
return false return false;
} }
} }
this.nowrow.material_id = row.material_id this.nowrow.material_id = row.material_id;
this.nowrow.material_code = row.material_code this.nowrow.material_code = row.material_code;
this.nowrow.material_name = row.material_name this.nowrow.material_name = row.material_name;
this.nowrow.qty_unit_id = row.base_unit_id this.nowrow.qty_unit_id = row.base_unit_id;
this.nowrow.qty_unit_name = row.unit_name this.nowrow.qty_unit_name = row.unit_name;
this.nowrow.plan_qty = '1' this.nowrow.plan_qty = "1";
this.nowrow.edit = false this.nowrow.edit = false;
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新 this.form.tableData.splice(this.nowindex, 1, this.nowrow); // 通过splice 替换数据 触发视图更新
}, },
async insertdtl() { async insertdtl() {
if (this.form.bill_type === '') { if (this.form.bill_type === "") {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO) this.crud.notify("请选择业务类型", CRUD.NOTIFICATION_TYPE.INFO);
return return;
} }
this.form.tableData.push({ material_id: '', material_code: '', material_name: '', pcsn: '', quality_scode: '00', plan_qty: '1', qty_unit_name: '', qty_unit_id: '', remark: '', edit: false }) this.form.tableData.push({
this.form.detail_count = this.form.tableData.length material_id: "",
material_code: "",
material_name: "",
pcsn: "",
quality_scode: "00",
plan_qty: "1",
qty_unit_name: "",
qty_unit_id: "",
remark: "",
edit: false
});
this.form.detail_count = this.form.tableData.length;
}, },
deleteRow(index, rows) { deleteRow(index, rows) {
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty) this.form.total_qty =
rows.splice(index, 1) parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty);
rows.splice(index, 1);
} }
} }
} };
</script> </script>
<style> <style>
@@ -379,7 +501,7 @@ export default {
margin-left: auto; margin-left: auto;
padding: 4px 4px; padding: 4px 4px;
} }
.input-with-select { .input-with-select {
background-color: #fff; background-color: #fff;
} }
</style> </style>

View File

@@ -49,39 +49,74 @@
:data="crud.data" :data="crud.data"
style="width: 100%;" style="width: 100%;"
border border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}" :header-cell-style="{ background: '#f5f7fa', color: '#606266' }"
> >
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column prop="instorage_time" label="入库日期" :min-width="flexWidth('instorage_time',crud.data,'入库日期')" /> <el-table-column
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" /> prop="instorage_time"
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" /> label="入库日期"
<el-table-column prop="material_spec" label="物料规格" :min-width="flexWidth('material_name',crud.data,'物料规格')" /> :min-width="flexWidth('instorage_time', crud.data, '入库日期')"
<el-table-column prop="struct_code" label="点位" :min-width="flexWidth('struct_name',crud.data,'点位')" /> />
<el-table-column prop="pcsn" label="订单号" :min-width="flexWidth('pcsn',crud.data,'订单号')" /> <el-table-column
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="可用数" /> prop="material_code"
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" /> label="物料编码"
:min-width="flexWidth('material_code', crud.data, '物料编码')"
/>
<el-table-column
prop="material_name"
label="物料名称"
:min-width="flexWidth('material_name', crud.data, '物料名称')"
/>
<el-table-column
prop="material_spec"
label="物料规格"
:min-width="flexWidth('material_name', crud.data, '物料规格')"
/>
<el-table-column
prop="struct_code"
label="点位"
:min-width="flexWidth('struct_name', crud.data, '点位')"
/>
<el-table-column
prop="pcsn"
label="订单号"
:min-width="flexWidth('pcsn', crud.data, '订单号')"
/>
<el-table-column
show-overflow-tooltip
prop="plan_qty"
:formatter="crud.formatNum3"
label="可用数"
/>
<el-table-column
show-overflow-tooltip
prop="qty_unit_name"
label="重量单位"
/>
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination /> <pagination />
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button> <el-button slot="left" type="info" @click="dialogVisible = false"
>关闭</el-button
>
<el-button slot="left" type="primary" @click="submit">保存</el-button> <el-button slot="left" type="primary" @click="submit">保存</el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import CRUD, { header, presenter } from "@crud/crud";
import CRUD, { header, presenter } from '@crud/crud' import rrOperation from "@crud/RR.operation";
import rrOperation from '@crud/RR.operation' import pagination from "@crud/Pagination";
import pagination from '@crud/Pagination'
export default { export default {
name: 'AddDtl', name: "AddDtl",
components: { rrOperation, pagination }, components: { rrOperation, pagination },
cruds() { cruds() {
return CRUD({ return CRUD({
title: '用户', url: 'api/productOut/addDtl', title: "用户",
url: "api/semiProductOut/addDtl",
optShow: { optShow: {
add: false, add: false,
edit: false, edit: false,
@@ -89,10 +124,8 @@ export default {
reset: true, reset: true,
download: false download: false
}, },
query: { query: {}
});
}
})
}, },
mixins: [presenter(), header()], mixins: [presenter(), header()],
props: { props: {
@@ -110,54 +143,53 @@ export default {
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
opendtlParam: '', opendtlParam: "",
rows: [], rows: [],
openShow: true openShow: true
} };
}, },
watch: { watch: {
dialogShow: { dialogShow: {
handler(newValue, oldValue) { handler(newValue, oldValue) {
this.dialogVisible = newValue this.dialogVisible = newValue;
} }
}, },
openParam: { openParam: {
handler(newValue, oldValue) { handler(newValue, oldValue) {
this.opendtlParam = newValue this.opendtlParam = newValue;
} }
} }
}, },
methods: { methods: {
[CRUD.HOOK.beforeRefresh]() { [CRUD.HOOK.beforeRefresh]() {
this.crud.query.mater_type = this.opendtlParam this.crud.query.mater_type = this.opendtlParam;
this.crud.query.stor_id = this.storId this.crud.query.stor_id = this.storId;
if (this.openShow) { if (this.openShow) {
this.openShow = false this.openShow = false;
return false return false;
} else { } else {
return true return true;
} }
}, },
close() { close() {
this.crud.resetQuery(false) this.crud.resetQuery(false);
// 清空grid数据 // 清空grid数据
this.crud.data = undefined this.crud.data = undefined;
this.$emit('update:dialogShow', false) this.$emit("update:dialogShow", false);
}, },
open() { open() {
this.crud.query.mater_type = this.opendtlParam this.crud.query.mater_type = this.opendtlParam;
}, },
submit() { submit() {
this.rows = this.$refs.multipleTable.selection this.rows = this.$refs.multipleTable.selection;
if (this.rows.length <= 0) { if (this.rows.length <= 0) {
this.$message('请先勾选物料') this.$message("请先勾选物料");
return return;
} }
this.crud.resetQuery(false) this.crud.resetQuery(false);
this.$emit('update:dialogShow', false) this.$emit("update:dialogShow", false);
this.$emit('tableChanged', this.rows) this.$emit("tableChanged", this.rows);
} }
} }
} };
</script> </script>