|
@@ -0,0 +1,252 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-button size="small" type="primary" @click="addShow(dialogVisible = true)">新建</el-button>
|
|
|
|
|
+ <el-drawer
|
|
|
|
|
+ title="新建应收账款逾期调整单"
|
|
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
|
|
+ size="75%"
|
|
|
|
|
+ direction="rtl"
|
|
|
|
|
+ :show-close="false"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ @close="onClose(dialogVisible = false)">
|
|
|
|
|
+ <div class="drawer__panel">
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-form :model="form" :rules="rules" ref="form" label-width="90px" label-position="right" size="mini">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="客户:" prop="sys_enterpriseid">
|
|
|
|
|
+ <el-popover
|
|
|
|
|
+ placement="bottom"
|
|
|
|
|
+ width="700"
|
|
|
|
|
+ trigger="click"
|
|
|
|
|
+ v-model="customer.show"
|
|
|
|
|
+ @show="customerList">
|
|
|
|
|
+ <tableTemplate ref="customer" :param="customer.param" :layout="customer.tablecols" height="280px" :custom="true" :width="true" @rowClick="customerSelect">
|
|
|
|
|
+ <template v-slot:customcol="scope">
|
|
|
|
|
+ <p>{{scope.column.data[scope.column.columnname]}}</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </tableTemplate>
|
|
|
|
|
+ <el-input slot="reference" :readonly="true" v-model="enterprisename" autocomplete="off" placeholder="请选择客户" ></el-input>
|
|
|
|
|
+ </el-popover>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="订单:" prop="sa_orderid">
|
|
|
|
|
+ <el-popover
|
|
|
|
|
+ placement="bottom"
|
|
|
|
|
+ width="700"
|
|
|
|
|
+ trigger="click"
|
|
|
|
|
+ v-model="order.show"
|
|
|
|
|
+ @show="orderList">
|
|
|
|
|
+ <tableTemplate ref="order" :param="order.param" :layout="order.tablecols" height="280px" :custom="true" :width="true" @rowClick="orderSelect">
|
|
|
|
|
+ <template v-slot:customcol="scope">
|
|
|
|
|
+ <p>{{scope.column.data[scope.column.columnname]}}</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </tableTemplate>
|
|
|
|
|
+ <el-input slot="reference" :readonly="true" v-model="sonum" autocomplete="off" placeholder="请选择客户" ></el-input>
|
|
|
|
|
+ </el-popover>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="订单行" prop="orderRow">
|
|
|
|
|
+ <tableTemplate :checkbox="true" ref="orderRow" :param="orderRow.param" :layout="orderRow.tablecols" height="280px" :custom="true" :width="true" @selectionChange="orderRowSelect">
|
|
|
|
|
+ <template v-slot:customcol="scope">
|
|
|
|
|
+ <div v-if="scope.column.columnname === 'amount'">
|
|
|
|
|
+ <el-input v-model="scope.column.data.amount" autocomplete="off" placeholder="请输入" @change="orderRowChange(scope.column.data)"></el-input>
|
|
|
|
|
+ </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"
|
|
|
|
|
+ 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-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="fixed__btn__panel">
|
|
|
|
|
+ <el-button size="small" @click="dialogVisible = false" class="normal-btn-width">取 消</el-button>
|
|
|
|
|
+ <el-button size="small" type="primary" @click="onSubmit" :loading="loading" class="normal-btn-width">确 定</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-drawer>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import tableTemplate from '@/template/tableTemplate/index'
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: "add",
|
|
|
|
|
+ components:{tableTemplate},
|
|
|
|
|
+ data(){
|
|
|
|
|
+ return {
|
|
|
|
|
+ dialogVisible:false,
|
|
|
|
|
+ enterprisename:'',
|
|
|
|
|
+ sonum:'',
|
|
|
|
|
+ customer:{
|
|
|
|
|
+ show:false,
|
|
|
|
|
+ tablecols:[],
|
|
|
|
|
+ param:{
|
|
|
|
|
+ "id": 20240320140704,
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "pageSize": 20,
|
|
|
|
|
+ "pageNumber": 1,
|
|
|
|
|
+ "where": {
|
|
|
|
|
+ "condition": "",
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ order:{
|
|
|
|
|
+ show:false,
|
|
|
|
|
+ param:{
|
|
|
|
|
+ "id": 20240306135104,
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "pageNumber": 1,
|
|
|
|
|
+ "pageSize": 20,
|
|
|
|
|
+ "sys_enterpriseid": '',
|
|
|
|
|
+ "where": {
|
|
|
|
|
+ "condition": ""
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ orderRow:{
|
|
|
|
|
+ show:false,
|
|
|
|
|
+ param:{
|
|
|
|
|
+ "id": 20240319155104,
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "sa_orderid": "",
|
|
|
|
|
+ "pageNumber": 1,
|
|
|
|
|
+ "pageSize": 20,
|
|
|
|
|
+ "where": {
|
|
|
|
|
+ "condition": ""
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ form:{
|
|
|
|
|
+ "sys_enterpriseid": "",
|
|
|
|
|
+ "sa_overdueadjustid": 0,
|
|
|
|
|
+ "sa_orderid": '',
|
|
|
|
|
+ "orderRow":[]
|
|
|
|
|
+ },
|
|
|
|
|
+ rules:{
|
|
|
|
|
+ sys_enterpriseid:[
|
|
|
|
|
+ { required: true, message: '请选择客户', trigger: 'change'},
|
|
|
|
|
+ ],
|
|
|
|
|
+ sa_orderid:[
|
|
|
|
|
+ { required: true, message: '请选择订单', trigger: 'change'},
|
|
|
|
|
+ ],
|
|
|
|
|
+ orderRow:[
|
|
|
|
|
+ { required: true, message: '请选择订单行', trigger: 'change'},
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ orderInfo:[],
|
|
|
|
|
+ loading:false
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods:{
|
|
|
|
|
+ addShow(){
|
|
|
|
|
+ },
|
|
|
|
|
+ /*可选客户*/
|
|
|
|
|
+ async customerList(){
|
|
|
|
|
+ this.$refs.customer.listData()
|
|
|
|
|
+ },
|
|
|
|
|
+ customerSelect(item){
|
|
|
|
|
+ this.form.sys_enterpriseid = item.sys_enterpriseid
|
|
|
|
|
+ this.enterprisename = item.enterprisename
|
|
|
|
|
+ this.customer.show = false
|
|
|
|
|
+ },
|
|
|
|
|
+ /*可选订单*/
|
|
|
|
|
+ orderList(){
|
|
|
|
|
+ this.order.param.content.sys_enterpriseid = this.form.sys_enterpriseid
|
|
|
|
|
+ this.$refs.order.listData()
|
|
|
|
|
+ },
|
|
|
|
|
+ orderSelect(item){
|
|
|
|
|
+ this.form.sa_orderid = item.sa_orderid
|
|
|
|
|
+ this.sonum = item.sonum
|
|
|
|
|
+ this.order.show = false
|
|
|
|
|
+ this.orderRow.param.content.sa_orderid = item.sa_orderid
|
|
|
|
|
+ this.$refs.orderRow.listData()
|
|
|
|
|
+ },
|
|
|
|
|
+ /*可选订单行*/
|
|
|
|
|
+ orderRowSelect(item){
|
|
|
|
|
+ console.log(item)
|
|
|
|
|
+ this.form.orderRow = item
|
|
|
|
|
+ this.orderInfo = []
|
|
|
|
|
+ this.orderInfo = this.form.orderRow.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
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log(this.orderInfo,'orderInfo')
|
|
|
|
|
+ },
|
|
|
|
|
+ orderRowChange(item){
|
|
|
|
|
+ this.orderInfo.forEach(row=>{
|
|
|
|
|
+ if (row.rowindex === item.rowindex){
|
|
|
|
|
+ row.amount = item.amount
|
|
|
|
|
+ row.intoaccountdate = item.intoaccountdate
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ onSubmit(){
|
|
|
|
|
+ this.$refs.form.validate(async (valid)=>{
|
|
|
|
|
+ if (!valid) return false
|
|
|
|
|
+ const res = await this.$api.requested({
|
|
|
|
|
+ "id": 20240306134804,
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "sys_enterpriseid": this.form.sys_enterpriseid,
|
|
|
|
|
+ "sa_overdueadjustid": 0,
|
|
|
|
|
+ "sa_orderid": this.form.sa_orderid
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ if (res.code != 0){
|
|
|
|
|
+ const res1 = await this.$api.requested({
|
|
|
|
|
+ "id": "20240319154904",
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "sa_overdueadjustid": res.data.sa_overdueadjustid,
|
|
|
|
|
+ "overdueadjustitems": this.orderInfo
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.tool.showMessage(res1,()=>{
|
|
|
|
|
+ this.$refs.form.resetFields()
|
|
|
|
|
+ this.orderInfo = []
|
|
|
|
|
+ this.enterprisename = ''
|
|
|
|
|
+ this.sonum = ''
|
|
|
|
|
+ this.$store.dispatch('changeDetailDrawer',true)
|
|
|
|
|
+ this.$router.push({path:'/overdueAdjustmentDetail',query:{id:res.data.sa_overdueadjustid,rowindex:res.data.rowindex}})
|
|
|
|
|
+ })
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.$message.error(res.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ onClose(){}
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.customer.tablecols = this.tool.tabelCol(this.$route.name).customerTable.tablecols
|
|
|
|
|
+ this.order.tablecols = this.tool.tabelCol(this.$route.name).orderTable.tablecols
|
|
|
|
|
+ this.orderRow.tablecols = this.tool.tabelCol(this.$route.name).orderRowTable.tablecols
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped>
|
|
|
|
|
+
|
|
|
|
|
+</style>
|