Browse Source

Merge branch 'master' of http://132.232.92.186:3000/XinXiBu/oa-system

wangh 1 year ago
parent
commit
5e143452a6
3 changed files with 84 additions and 14 deletions
  1. 1 1
      src/components/Finance/Currency.vue
  2. 81 13
      src/components/Finance/Sendack.vue
  3. 2 0
      src/components/home.vue

+ 1 - 1
src/components/Finance/Currency.vue

@@ -99,7 +99,7 @@
                             </div>
                         </div>
                     </el-tab-pane>
-                    <el-tab-pane label="团组增减款项" name="payments">
+                    <el-tab-pane label="其他款项" name="payments">
                         <div class="ipt-inif">
                             <div class="ipt" v-for="(item,index) in paymentsCurrencyArr" :key="index">
                                 <label>{{item.currencyName}}({{item.currencyCode}}):</label>

+ 81 - 13
src/components/Finance/Sendack.vue

@@ -14,7 +14,7 @@
                     </el-select>
                 </div>
                 <div class="sendack-head-li">
-                    <el-button @click="ysSaveition()" type="primary">新增数据</el-button>
+                    <el-button @click="dialogFormVisible=true;" type="primary">新增数据</el-button>
                 </div>
             </div>
             <div class="sendack-info">
@@ -129,7 +129,8 @@
                     </el-form>
                     <div slot="footer" class="dialog-footer">
                     <el-button @click="dialogFormVisible = false">取 消</el-button>
-                    <el-button type="primary" @click="submitForm('form')">确 定</el-button>
+                    <el-button type="primary" @click="submitForm('form','保存')">确 定</el-button>
+                    <el-button type="primary" @click="submitForm('form','修改')">修 改</el-button>
                     </div>
               </el-dialog>
         </div>
@@ -144,8 +145,11 @@ export default {
             options:[],
             groupInfo:{},
             groupsendData:[],
-            dialogFormVisible:true,
+            pageId:0,
+            dialogFormVisible:false,
             form:{
+                id:0,
+                ccpId:0,
                 priceName:'',//费用名称
                 price:0,//费用
                 currencyId:807,//币种Id
@@ -251,7 +255,7 @@ export default {
                 },
                 data:{
                     portType:1,
-                    id: 1540
+                    id: that.value
                 }
             }).then(function (res) {
                 console.log(res)
@@ -274,22 +278,40 @@ export default {
                 },
                 data:{
                     portType:1,
-                    diId: 1540
+                    userId:that.userid,
+                    pageId:that.pageId,
+                    diId: that.value
                 }
             }).then(function (res) {
                 console.log(res)
                 if(res.data.code==200){
-                    that.groupsendData=res.data.data
+                    that.groupsendData=res.data.data.data
                 }else{
                     that.$message.error('获取数据源失败!');
                 }
             })
         },
         //保存修改
-        submitForm(formName) {
+        submitForm(formName,text) {
             this.$refs[formName].validate((valid) => {
             if (valid) {
-                alert('submit!');
+                var status
+                var id
+                var ccpId
+                for(var i=0;i<this.currencyDatas.length;i++){
+                    if(this.currencyDatas[i].id==this.form.currencyId){
+                        this.form.currencyCode=this.currencyDatas[i].name
+                    }
+                }
+                if(text=='保存'){
+                    status=1
+                    this.PostPaymentRefundAndOtherMoneyAddOrEdit(status)
+                }
+                if(text=='修改'){
+                    status=2
+                    this.PostPaymentRefundAndOtherMoneyAddOrEdit(status)
+                }
+                console.log(this.form)
             } else {
                 console.log('error submit!!');
                 return false;
@@ -297,9 +319,28 @@ export default {
             });
         },
         //保存修改api
-        PostPaymentRefundAndOtherMoneyItemByDiId(){
-            var url = "/api/Financial/PostPaymentRefundAndOtherMoneyItemByDiId"
+        PostPaymentRefundAndOtherMoneyAddOrEdit(status){
+            var url = "/api/Financial/PostPaymentRefundAndOtherMoneyAddOrEdit"
             var that = this
+            var data={
+                    portType:1,
+                    userId:that.userid,
+                    status:status,//1 添加 2 修改
+                    diId:that.value,
+                    id:that.form.id,
+                    ccpId:that.form.ccpId,
+                    priceName:that.form.priceName,
+                    price:that.form.price,
+                    currencyId:that.form.price,
+                    currencyCode:that.form.currencyCode,
+                    payee:that.form.payee,
+                    payDId:that.form.payDId,
+                    orbitalPrivateTransfer:that.form.orbitalPrivateTransfer,
+                    consumptionPatterns:that.form.consumptionPatterns,
+                    payType:that.form.payType,
+                    remark:that.form.remark,
+                }
+                console.log(JSON.stringify(data))
             this.$axios({
                 method: 'post',
                 url: url,
@@ -308,14 +349,31 @@ export default {
                 },
                 data:{
                     portType:1,
-                    diId: 1540
+                    userId:that.userid,
+                    status:status,//1 添加 2 修改
+                    diId:that.value,
+                    id:that.form.id,
+                    ccpId:that.form.ccpId,
+                    priceName:that.form.priceName,
+                    price:that.form.price,
+                    currencyId:that.form.currencyId,
+                    currencyCode:that.form.currencyCode,
+                    payee:that.form.payee,
+                    payDId:that.form.payDId,
+                    orbitalPrivateTransfer:that.form.orbitalPrivateTransfer,
+                    consumptionPatterns:that.form.consumptionPatterns,
+                    payType:that.form.payType,
+                    remark:that.form.remark,
                 }
             }).then(function (res) {
                 console.log(res)
                 if(res.data.code==200){
-                    that.groupsendData=res.data.data
+                    that.$message({
+                        message: res.data.msg,
+                        type: 'success'
+                    });
                 }else{
-                    that.$message.error('获取数据源失败!');
+                    that.$message.error(res.data.msg);
                 }
             })
         },
@@ -330,6 +388,8 @@ export default {
             this.dialogFormVisible=true;
             //初始化数据
             this.form={
+                id:0,
+                ccpId:0,
                 priceName:'',//费用名称
                 price:0,//费用
                 currencyId:807,//币种Id
@@ -358,6 +418,8 @@ export default {
                 console.log(res)
                 if(res.data.code==200){
                     formobject=res.data.data[0];
+                    that.form.id=formobject.id;
+                    that.form.ccpId=formobject.ccpId;
                     that.form.priceName=formobject.priceName;
                     that.form.price=formobject.price;
                     that.form.currencyId=formobject.currencyId;
@@ -404,6 +466,10 @@ export default {
                     }
                 })
             })
+        },
+        changediid(){
+            this.PostShareGroupInfo();
+            this.PostPaymentRefundAndOtherMoneyItemByDiId();
         }
     },
     filters:{
@@ -420,6 +486,8 @@ export default {
     },
     mounted(){
         this.userid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
+        this.pageId=localStorage.getItem('indexs').split('-')[1];//页面id
+        console.log(this.pageId)
         this.GetForeignReceivablesDataSources();
         this.PostPaymentRefundAndOtherMoneyInfoDataSource();
     }

+ 2 - 0
src/components/home.vue

@@ -218,6 +218,7 @@ export default {
     },
     toURLs(val, item) {
       console.log(val)
+      // localStorage.setItem('userinif', JSON.stringify(res.data.data));
       console.log(item)
       localStorage.setItem("indexs", val);
       localStorage.setItem("innhtml", item.pageList[0].pageName);
@@ -226,6 +227,7 @@ export default {
     },
     toURL(val, item) {
       console.log(val)
+      console.log(item)
       localStorage.setItem("indexs", val);
       localStorage.setItem("innhtml", item.pageName);
       this.$router.push({ path: "/home" + item.webUrl });