|
|
@@ -0,0 +1,129 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" size="small" @click="addShow(dialogVisible = true)" v-if="data.status === '新建'">新增</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" style="margin-bottom: 0 !important;">
|
|
|
+ <tableTemplate :checkbox="true" ref="orderRow" :param="param" :layout="tablecols" height="calc(100vh - 245px)" :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>
|
|
|
+ </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: "addOrderRows",
|
|
|
+ props:['data'],
|
|
|
+ components:{tableTemplate},
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ dialogVisible:false,
|
|
|
+ show:false,
|
|
|
+ loading:false,
|
|
|
+ tablecols:[],
|
|
|
+ param:{
|
|
|
+ "id": 20240319155104,
|
|
|
+ "content": {
|
|
|
+ "sa_orderid": "",
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ form:[],
|
|
|
+ orderInfo:[]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ addShow(){
|
|
|
+ this.param.content.sa_orderid = this.data.sa_orderid
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.$refs.orderRow.listData()
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ orderRowChange(item){
|
|
|
+ this.orderInfo.forEach(row=>{
|
|
|
+ if (row.rowindex === item.rowindex){
|
|
|
+ row.amount = item.amount
|
|
|
+ row.intoaccountdate = item.intoaccountdate
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /*可选订单行*/
|
|
|
+ orderRowSelect(item){
|
|
|
+ console.log(item)
|
|
|
+ this.form = item
|
|
|
+ this.orderInfo = []
|
|
|
+ this.orderInfo = this.form.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')
|
|
|
+ },
|
|
|
+ async onSubmit(){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20240319154904",
|
|
|
+ "content": {
|
|
|
+ "sa_overdueadjustid": this.$route.query.id,
|
|
|
+ "overdueadjustitems": this.orderInfo
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.form = []
|
|
|
+ this.orderInfo = []
|
|
|
+ this.$emit('addSuccess')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onClose(){}
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.tablecols = this.tool.tabelCol(this.$route.name).orderRowTable.tablecols
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|