|
@@ -42,16 +42,19 @@
|
|
|
<p>{{scope.column.data[scope.column.columnname]}}</p>
|
|
<p>{{scope.column.data[scope.column.columnname]}}</p>
|
|
|
</template>
|
|
</template>
|
|
|
</tableTemplate>
|
|
</tableTemplate>
|
|
|
- <el-input slot="reference" :readonly="true" v-model="sonum" autocomplete="off" placeholder="请选择客户" ></el-input>
|
|
|
|
|
|
|
+ <el-input slot="reference" :readonly="true" v-model="sonum" autocomplete="off" placeholder="请选择订单" ></el-input>
|
|
|
</el-popover>
|
|
</el-popover>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
<el-form-item label="订单行" prop="orderRow">
|
|
<el-form-item label="订单行" prop="orderRow">
|
|
|
- <tableTemplate prop="amount" :checkbox="true" ref="orderRow" :param="orderRow.param" :layout="orderRow.tablecols" height="calc(100vh - 295px)" :custom="true" :width="true" @selectionChange="orderRowSelect">
|
|
|
|
|
|
|
+ <tableTemplate prop="amount" :isPagination="false" :isInput="false" :checkbox="false" ref="orderRow" :layout="orderRow.tablecols" height="calc(100vh - 266px)" :custom="true" :width="true">
|
|
|
|
|
+ <template v-slot:add>
|
|
|
|
|
+ <el-button size="small" type="primary" @click="addRowsShow(visible = true)" :disabled="sonum === ''">添加</el-button>
|
|
|
|
|
+ </template>
|
|
|
<template v-slot:customcol="scope">
|
|
<template v-slot:customcol="scope">
|
|
|
<div v-if="scope.column.columnname === 'amount'">
|
|
<div v-if="scope.column.columnname === 'amount'">
|
|
|
- <el-form-item style="margin-bottom: 0 !important;" :rules="[{required: true, validator: validateAmount(scope.column.data,scope.column.data.amount,scope.column.data.overdueamount),message: '姓名不能为空', trigger: 'blur'}]" >
|
|
|
|
|
|
|
+ <el-form-item style="margin-bottom: 0 !important;" :rules="[{required: true, validator: validateAmount(scope.column.data,scope.column.data.amount,scope.column.data.overdueamount),message: '不能为空', trigger: 'blur'}]" >
|
|
|
<el-input v-model="scope.column.data.amount" autocomplete="off" placeholder="请输入" ></el-input>
|
|
<el-input v-model="scope.column.data.amount" autocomplete="off" placeholder="请输入" ></el-input>
|
|
|
<div style="font-size: 12px;color: red" v-if="scope.column.data.isAmount">大于原逾期金额</div>
|
|
<div style="font-size: 12px;color: red" v-if="scope.column.data.isAmount">大于原逾期金额</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -69,6 +72,9 @@
|
|
|
</div>
|
|
</div>
|
|
|
<p v-else>{{scope.column.data[scope.column.columnname]}}</p>
|
|
<p v-else>{{scope.column.data[scope.column.columnname]}}</p>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template v-slot:opreation="scope">
|
|
|
|
|
+ <el-button size="mini" type="text" @click="delRows(scope.data)" :disabled="sonum === ''">删除</el-button>
|
|
|
|
|
+ </template>
|
|
|
</tableTemplate>
|
|
</tableTemplate>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
@@ -80,14 +86,56 @@
|
|
|
<el-button size="small" type="primary" @click="onSubmit" :loading="loading" class="normal-btn-width" :disabled="orderInfo.length === 0">确 定</el-button>
|
|
<el-button size="small" type="primary" @click="onSubmit" :loading="loading" class="normal-btn-width" :disabled="orderInfo.length === 0">确 定</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-drawer>
|
|
</el-drawer>
|
|
|
|
|
+ <el-drawer
|
|
|
|
|
+ title="可选订单行"
|
|
|
|
|
+ :visible.sync="visible"
|
|
|
|
|
+ size="65%"
|
|
|
|
|
+ direction="rtl"
|
|
|
|
|
+ :show-close="false"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ @close="onClose(visible = false)">
|
|
|
|
|
+ <div class="drawer__panel" style="margin-bottom: 0 !important;">
|
|
|
|
|
+ <el-form :model="form" :rules="rules" ref="form" label-position="right" size="mini">
|
|
|
|
|
+ <tableTemplate ref="rows" :checkbox="true" :isInput="false" :isPagination="false" :param="orderRow.param" :layout="tablecols" height="calc(100vh - 200px)" :custom="true" :width="true" @selectionChange="rowsSelect" @listData="queryListData">
|
|
|
|
|
+ <template v-slot:customcol="scope">
|
|
|
|
|
+ <div v-if="scope.column.columnname === 'amount'">
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item style="margin-bottom: 0 !important;" :rules="[{required: true, validator: validateAmount(scope.column.data,scope.column.data.amount,scope.column.data.overdueamount),message: '不能为空', trigger: 'blur'}]" >
|
|
|
|
|
+ <el-input v-model="scope.column.data.amount" autocomplete="off" placeholder="请输入" style="width: 100%"></el-input>
|
|
|
|
|
+ <div style="font-size: 12px;color: red" v-if="scope.column.data.isAmount">大于原逾期金额</div>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-else-if="scope.column.columnname === 'intoaccountdate'">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ v-model="scope.column.data.intoaccountdate"
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ format="yyyy-MM-dd"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ @change="orderRowChange(scope.column.data)"
|
|
|
|
|
+ placeholder="选择日期">
|
|
|
|
|
+ </el-date-picker>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <p v-else>{{scope.column.data[scope.column.columnname]}}</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </tableTemplate>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="fixed__btn__panel">
|
|
|
|
|
+ <el-button size="small" @click="visible = false" class="normal-btn-width">取 消</el-button>
|
|
|
|
|
+ <el-button size="small" type="primary" @click="rowsData" :loading="loading" class="normal-btn-width" :disabled="rowsInfo.length === 0">确 定</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-drawer>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import tableTemplate from '@/template/tableTemplate/index'
|
|
import tableTemplate from '@/template/tableTemplate/index'
|
|
|
|
|
+import addRows from './addRows'
|
|
|
export default {
|
|
export default {
|
|
|
name: "add",
|
|
name: "add",
|
|
|
- components:{tableTemplate},
|
|
|
|
|
|
|
+ components:{tableTemplate,addRows},
|
|
|
data(){
|
|
data(){
|
|
|
var validateAmount = (rule, value, callback) =>{
|
|
var validateAmount = (rule, value, callback) =>{
|
|
|
console.log(rule,'rule')
|
|
console.log(rule,'rule')
|
|
@@ -95,8 +143,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
|
dialogVisible:false,
|
|
dialogVisible:false,
|
|
|
|
|
+ visible:false,
|
|
|
enterprisename:'',
|
|
enterprisename:'',
|
|
|
sonum:'',
|
|
sonum:'',
|
|
|
|
|
+ tablecols:[],
|
|
|
customer:{
|
|
customer:{
|
|
|
show:false,
|
|
show:false,
|
|
|
tablecols:[],
|
|
tablecols:[],
|
|
@@ -132,13 +182,14 @@ export default {
|
|
|
"content": {
|
|
"content": {
|
|
|
"sa_orderid": "",
|
|
"sa_orderid": "",
|
|
|
"pageNumber": 1,
|
|
"pageNumber": 1,
|
|
|
- "pageSize": 20,
|
|
|
|
|
|
|
+ "pageSize": 999,
|
|
|
"where": {
|
|
"where": {
|
|
|
"condition": ""
|
|
"condition": ""
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
form:{
|
|
form:{
|
|
|
"sys_enterpriseid": "",
|
|
"sys_enterpriseid": "",
|
|
|
"sa_overdueadjustid": 0,
|
|
"sa_overdueadjustid": 0,
|
|
@@ -160,21 +211,55 @@ export default {
|
|
|
// 其他校验规则
|
|
// 其他校验规则
|
|
|
],*/
|
|
],*/
|
|
|
},
|
|
},
|
|
|
|
|
+ rowsInfo:[],
|
|
|
orderInfo:[],
|
|
orderInfo:[],
|
|
|
loading:false,
|
|
loading:false,
|
|
|
- inputValidations: {}
|
|
|
|
|
|
|
+ rowsListOld:[],
|
|
|
|
|
+ inputValidations: {},
|
|
|
|
|
+ isCheck:false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods:{
|
|
methods:{
|
|
|
validateAmount(data,val,oldVal) {
|
|
validateAmount(data,val,oldVal) {
|
|
|
if (val > oldVal){
|
|
if (val > oldVal){
|
|
|
data.isAmount = true
|
|
data.isAmount = true
|
|
|
|
|
+ this.isCheck = true
|
|
|
}else {
|
|
}else {
|
|
|
data.isAmount = false
|
|
data.isAmount = false
|
|
|
|
|
+ this.isCheck = false
|
|
|
}
|
|
}
|
|
|
this.orderRowChange(data)
|
|
this.orderRowChange(data)
|
|
|
},
|
|
},
|
|
|
addShow(){
|
|
addShow(){
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ addRowsShow(){
|
|
|
|
|
+ let oldArr = this.rowsListOld
|
|
|
|
|
+ var newArr = []
|
|
|
|
|
+ var k = 0
|
|
|
|
|
+ for (var i = 0; i < oldArr.length; i++) {
|
|
|
|
|
+ let flag = 0
|
|
|
|
|
+ for (var j=0;j< this.orderInfo.length;j++){
|
|
|
|
|
+ if (this.orderInfo[j].sa_orderitemsid === oldArr[i].sa_orderitemsid && this.orderInfo[j].sa_order_receivableruleid === oldArr[i].sa_order_receivableruleid) {
|
|
|
|
|
+ flag = 1
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (flag === 0){
|
|
|
|
|
+ newArr[k] = oldArr[i]
|
|
|
|
|
+ k ++
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$refs.rows.list = newArr
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ delRows(data){
|
|
|
|
|
+ this.orderInfo.forEach(item=>{
|
|
|
|
|
+ if (data.sa_orderitemsid === item.sa_orderitemsid && data.sa_order_receivableruleid === item.sa_order_receivableruleid){
|
|
|
|
|
+ this.orderInfo.splice(item.index,1)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.$refs.orderRow.list = this.orderInfo
|
|
|
},
|
|
},
|
|
|
/*可选客户*/
|
|
/*可选客户*/
|
|
|
async customerList(){
|
|
async customerList(){
|
|
@@ -195,14 +280,18 @@ export default {
|
|
|
this.sonum = item.sonum
|
|
this.sonum = item.sonum
|
|
|
this.order.show = false
|
|
this.order.show = false
|
|
|
this.orderRow.param.content.sa_orderid = item.sa_orderid
|
|
this.orderRow.param.content.sa_orderid = item.sa_orderid
|
|
|
- this.$refs.orderRow.listData()
|
|
|
|
|
|
|
+ this.visible = true
|
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
|
+ this.$refs.rows.listData()
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- /*可选订单行*/
|
|
|
|
|
- orderRowSelect(item){
|
|
|
|
|
- console.log(item)
|
|
|
|
|
- this.form.orderRow = item
|
|
|
|
|
- this.orderInfo = []
|
|
|
|
|
- this.orderInfo = this.form.orderRow.map(item=>{
|
|
|
|
|
|
|
+ queryListData(list){
|
|
|
|
|
+ this.rowsListOld = list
|
|
|
|
|
+ },
|
|
|
|
|
+ /*选择订单行*/
|
|
|
|
|
+ rowsSelect(item){
|
|
|
|
|
+ this.rowsInfo = item
|
|
|
|
|
+ this.rowsInfo = item.map(item=>{
|
|
|
return {
|
|
return {
|
|
|
"sa_orderitemsid": item.sa_orderitemsid,
|
|
"sa_orderitemsid": item.sa_orderitemsid,
|
|
|
"sa_overdueadjustitemsid": "0",
|
|
"sa_overdueadjustitemsid": "0",
|
|
@@ -212,10 +301,43 @@ export default {
|
|
|
"ownertable": item.ownertable,
|
|
"ownertable": item.ownertable,
|
|
|
"ownerid": item.ownerid,
|
|
"ownerid": item.ownerid,
|
|
|
"amount": item.amount,
|
|
"amount": item.amount,
|
|
|
- "rowindex":item.rowindex
|
|
|
|
|
|
|
+ "rowindex":item.rowindex,
|
|
|
|
|
+ "rowno":item.rowno,
|
|
|
|
|
+ "overdueamount":item.overdueamount,
|
|
|
|
|
+ "overduedays":item.overduedays,
|
|
|
|
|
+ "sa_order_receivableruleid":item.sa_order_receivableruleid
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log(this.rowsInfo,'ordersInfo')
|
|
|
|
|
+ },
|
|
|
|
|
+ /*确定所选订单行*/
|
|
|
|
|
+ rowsData(){
|
|
|
|
|
+ if (this.rowsInfo.length === 0){
|
|
|
|
|
+ this.orderInfo = this.rowsInfo
|
|
|
|
|
+ this.visible = false
|
|
|
|
|
+ this.$refs.orderRow.list = this.orderInfo
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.visible = false
|
|
|
|
|
+ this.orderInfo = this.orderInfo.concat(this.rowsInfo)
|
|
|
|
|
+ this.$refs.orderRow.list = this.orderInfo
|
|
|
|
|
+ }
|
|
|
|
|
+ this.orderInfo = this.$refs.orderRow.list.map(item=>{
|
|
|
|
|
+ return {
|
|
|
|
|
+ "sa_orderitemsid": item.sa_orderitemsid,
|
|
|
|
|
+ "sa_overdueadjustitemsid": "0",
|
|
|
|
|
+ "oldintoaccountdate": item.oldintoaccountdate,
|
|
|
|
|
+ "point": item.point,
|
|
|
|
|
+ "intoaccountdate": item.intoaccountdate,
|
|
|
|
|
+ "ownertable": item.ownertable,
|
|
|
|
|
+ "ownerid": item.ownerid,
|
|
|
|
|
+ "amount": item.amount,
|
|
|
|
|
+ "rowindex":item.rowindex,
|
|
|
|
|
+ "rowno":item.rowno,
|
|
|
|
|
+ "overdueamount":item.overdueamount,
|
|
|
|
|
+ "overduedays":item.overduedays,
|
|
|
|
|
+ "sa_order_receivableruleid":item.sa_order_receivableruleid
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- console.log(this.orderInfo,'orderInfo')
|
|
|
|
|
},
|
|
},
|
|
|
orderRowChange(item){
|
|
orderRowChange(item){
|
|
|
this.orderInfo.forEach(row=>{
|
|
this.orderInfo.forEach(row=>{
|
|
@@ -228,16 +350,18 @@ export default {
|
|
|
onSubmit(){
|
|
onSubmit(){
|
|
|
this.$refs.form.validate(async (valid)=> {
|
|
this.$refs.form.validate(async (valid)=> {
|
|
|
if (!valid) return false
|
|
if (!valid) return false
|
|
|
- console.log(this.orderInfo, '22222')
|
|
|
|
|
let flag = false
|
|
let flag = false
|
|
|
this.orderInfo.forEach(item=>{
|
|
this.orderInfo.forEach(item=>{
|
|
|
if (item.amount && item.intoaccountdate){
|
|
if (item.amount && item.intoaccountdate){
|
|
|
- flag = true
|
|
|
|
|
|
|
+ if (this.isCheck){
|
|
|
|
|
+ flag = false
|
|
|
|
|
+ }else {
|
|
|
|
|
+ flag = true
|
|
|
|
|
+ }
|
|
|
}else {
|
|
}else {
|
|
|
flag = false
|
|
flag = false
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- console.log(flag,'flag')
|
|
|
|
|
if (flag){
|
|
if (flag){
|
|
|
const res = await this.$api.requested({
|
|
const res = await this.$api.requested({
|
|
|
"id": 20240306134804,
|
|
"id": 20240306134804,
|
|
@@ -267,7 +391,11 @@ export default {
|
|
|
this.$message.error(res.msg)
|
|
this.$message.error(res.msg)
|
|
|
}
|
|
}
|
|
|
}else {
|
|
}else {
|
|
|
- this.$message.error('信息未完善')
|
|
|
|
|
|
|
+ if (this.isCheck){
|
|
|
|
|
+ this.$message.error('输入信息不合法')
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.$message.error('信息未完善')
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -278,6 +406,7 @@ export default {
|
|
|
this.customer.tablecols = this.tool.tabelCol(this.$route.name).customerTable.tablecols
|
|
this.customer.tablecols = this.tool.tabelCol(this.$route.name).customerTable.tablecols
|
|
|
this.order.tablecols = this.tool.tabelCol(this.$route.name).orderTable.tablecols
|
|
this.order.tablecols = this.tool.tabelCol(this.$route.name).orderTable.tablecols
|
|
|
this.orderRow.tablecols = this.tool.tabelCol(this.$route.name).orderRowTable.tablecols
|
|
this.orderRow.tablecols = this.tool.tabelCol(this.$route.name).orderRowTable.tablecols
|
|
|
|
|
+ this.tablecols = this.tool.tabelCol(this.$route.name).rowsTable.tablecols
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|