|
@@ -1,19 +1,65 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-button type="primary" size="small" :disabled="data.length !== 1" @click="onShow">明细变更</el-button>
|
|
|
- <el-dialog title="明细变更" append-to-body :visible.sync="dialogVisible" width="400px">
|
|
|
- <el-form :model="form" size="small">
|
|
|
- <el-form-item label="产品" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="form.itemno" disabled autocomplete="off"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="产品" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="form.itemname" disabled autocomplete="off"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="数量变更" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="form.qty" autocomplete="off"></el-input>
|
|
|
- </el-form-item>
|
|
|
+ <el-button type="primary" size="small" :disabled="tableData.length === 0" @click="onShow">明细变更</el-button>
|
|
|
+ <el-dialog title="明细变更" append-to-body :visible.sync="dialogVisible" width="900px">
|
|
|
+ <el-table
|
|
|
+ class="normal-margin"
|
|
|
+ :data="listData"
|
|
|
+ style="width: 100%"
|
|
|
+ border
|
|
|
+ size="small">
|
|
|
+ <el-table-column
|
|
|
+ prop="itemname"
|
|
|
+ label="产品名称"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="itemno"
|
|
|
+ label="产品编号"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="erpitemno"
|
|
|
+ label="erp编号"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="model"
|
|
|
+ label="型号"
|
|
|
+ width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <p><span>{{scope.row.model}}</span></p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="spec"
|
|
|
+ label="规格"
|
|
|
+ width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <p><span>{{scope.row.spec}}</span></p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="undeliqty"
|
|
|
+ label="未发数量"
|
|
|
+ width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.undeliqty}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="newvalue"
|
|
|
+ label="变更数量"
|
|
|
+ width="180"
|
|
|
+ fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input size="mini" @input="onInput(scope.row,scope.$index)" v-model="scope.row.newvalue"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-form :model="form" label-position="top" size="small">
|
|
|
<el-form-item label="变更备注" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="form.remarks" autocomplete="off"></el-input>
|
|
|
+ <el-input v-model="form.remarks" type="textarea" :autosize="{minRows:5}" placeholder="输入变更备注" autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -27,10 +73,11 @@
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
- props:['data'],
|
|
|
+ props:['data','tableData'],
|
|
|
data () {
|
|
|
return {
|
|
|
formLabelWidth:'80px',
|
|
|
+ listData:[],
|
|
|
dialogVisible:false,
|
|
|
form:{
|
|
|
qty:''
|
|
@@ -39,20 +86,38 @@ export default {
|
|
|
},
|
|
|
methods:{
|
|
|
onShow () {
|
|
|
- this.form = Object.assign({},this.form,this.data[0])
|
|
|
+ this.listData = this.tableData.map(e=>{
|
|
|
+ e.newvalue = 0
|
|
|
+ return e
|
|
|
+ })
|
|
|
+ console.log(this.listData)
|
|
|
this.dialogVisible = true
|
|
|
- console.log(this.form)
|
|
|
+
|
|
|
+ },
|
|
|
+ onInput(row,index) {
|
|
|
+ if (row.newvalue > row.undeliqty) {
|
|
|
+ this.$message({
|
|
|
+ message:"变更数量不能大于未发数量",
|
|
|
+ type:"error"
|
|
|
+ })
|
|
|
+ row.newvalue = row.undeliqty
|
|
|
+ }
|
|
|
+ this.$set(this.listData,index,row)
|
|
|
},
|
|
|
async submit () {
|
|
|
const res = await this.$api.requested({
|
|
|
"id": 20221110145302,
|
|
|
"content": {
|
|
|
- "sa_orderitemsid":this.form.sa_orderitemsid,
|
|
|
- "sa_orderid":this.form.sa_orderid,//订单ID
|
|
|
- "itemid":this.form.itemid,//商品ID
|
|
|
+ "sa_orderid":this.data.sa_orderid,//订单ID
|
|
|
"type":"数量",//调整类型,目前只支持数量
|
|
|
- "newvalue":this.form.qty,//调整后值
|
|
|
- "remarks":this.form.remarks
|
|
|
+ "remarks":this.data.remarks,
|
|
|
+ "itemifnos":this.listData.map(e=>{
|
|
|
+ return {
|
|
|
+ sa_orderitemsid:e.sa_orderitemsid,
|
|
|
+ itemid:e.itemid,
|
|
|
+ newvalue:e.newvalue
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
this.tool.showMessage(res,()=>{
|