123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731 |
- <template>
- <div>
- <div class="sendack-all">
- <div class="sendack-head">
- <div class="sendack-head-li">
- <label>团组名称:</label>
- <el-select style="width:250px" @change="changediid()" v-model="value" filterable placeholder="请选择">
- <el-option
- v-for="item in options"
- :key="item.id"
- :label="item.groupName"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
- <div v-if="addAuth=1" class="sendack-head-li">
- <el-button @click="addclick()" type="primary">新增数据</el-button>
- </div>
- </div>
- <div class="sendack-info">
- <div class="sendack-info-li">
- <label>团 号:</label>
- <span v-if="this.groupInfo.tourCode!=''">{{groupInfo=={}?'暂无':groupInfo.tourCode==""?'暂无':groupInfo.tourCode}}</span>
- </div>
- <div class="sendack-info-li">
- <label>客 户:</label>
- <span>{{groupInfo=={}?'暂无':groupInfo.clientName==""?'暂无':groupInfo.clientName}}</span>
- </div>
- <div class="sendack-info-li">
- <label>出访国家:</label>
- <span>{{groupInfo=={}?'暂无':groupInfo.visitCountry==""?'暂无':groupInfo.visitCountry}}</span>
- </div>
- <div class="sendack-info-li">
- <label>起止日期:</label>
- <span>{{groupInfo.visitStartDate|filter_time}}~{{groupInfo.visitEndDate|filter_time}}</span>
- </div>
- <div class="sendack-info-li">
- <label>天数/人数:</label>
- <span>{{groupInfo=={}?'暂无':groupInfo.visitDays+'天/'+groupInfo.visitPNumber+'人'}}</span>
- </div>
- </div>
- <template>
- <el-table
- :data="groupsendData"
- border
- style="width: 100%">
- <el-table-column
- type="index"
- label="序 号"
- width="55">
- </el-table-column>
- <el-table-column
- prop="priceName"
- label="费用名称">
- </el-table-column>
- <el-table-column
- width="120"
- label="费用">
- <template slot-scope="scope">
- {{ townum(scope.row.price) }} {{ scope.row.currencyCode }}
- </template>
- </el-table-column>
- <el-table-column
- prop="createUserName"
- label="操作人"
- width="80">
- </el-table-column>
- <el-table-column
- prop="createTime"
- label="操作时间"
- width="165">
- </el-table-column>
- <el-table-column
- prop="auditGMName"
- label="审核人"
- width="80">
- </el-table-column>
- <el-table-column
- prop="auditGMDate"
- label="审核时间"
- width="165">
- </el-table-column>
- <el-table-column
- prop="remark"
- label="备注"
- >
- </el-table-column>
- <el-table-column label="操作" width="160">
- <template slot-scope="scope">
- <el-button
- :disabled="scope.row.isAuditGM==1"
- type="primary"
- size="mini"
- @click="Complete(scope.$index, scope.row)">编辑</el-button>
- <el-button
- :disabled="scope.row.isAuditGM==1"
- type="danger"
- size="mini"
- @click="Delete(scope.$index, scope.row)"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </template>
- <el-dialog class="sendack-dialog" width="900px" title="新增数据" :visible.sync="dialogFormVisible">
- <div class="sendack-info">
- <div class="sendack-info-li">
- <label>团 号:</label>
- <span v-if="this.groupInfo.tourCode!=''">{{groupInfo=={}?'暂无':groupInfo.tourCode==""?'暂无':groupInfo.tourCode}}</span>
- </div>
- <div class="sendack-info-li">
- <label>客 户:</label>
- <span>{{groupInfo=={}?'暂无':groupInfo.clientName==""?'暂无':groupInfo.clientName}}</span>
- </div>
- <div class="sendack-info-li">
- <label>出访国家:</label>
- <span>{{groupInfo=={}?'暂无':groupInfo.visitCountry==""?'暂无':groupInfo.visitCountry}}</span>
- </div>
- <div class="sendack-info-li">
- <label>起止日期:</label>
- <span>{{groupInfo.visitStartDate|filter_time}}~{{groupInfo.visitEndDate|filter_time}}</span>
- </div>
- <div class="sendack-info-li">
- <label>天数/人数:</label>
- <span>{{groupInfo=={}?'暂无':groupInfo.visitDays+'天/'+groupInfo.visitPNumber+'人'}}</span>
- </div>
- </div>
- <el-form :model="form" :rules="rules" ref="form">
- <div style="display: flex;flex-wrap:wrap;">
- <el-form-item label="费用名称" prop="priceName" :label-width="formLabelWidth">
- <el-input v-model="form.priceName" autocomplete="off"></el-input>
- </el-form-item>
- <el-form-item label="费用金额" prop="price" :label-width="formLabelWidth">
- <el-input-number class="fyjeinput" :controls="false" :precision="2" v-model="form.price"></el-input-number>
- <el-select filterable class="fyjeselect" v-model="form.currencyId" placeholder="请选择币种">
- <el-option v-for="(item,index) in currencyDatas" :key="index" :label="item.currencyCode" :value="item.currencyId">
- <span>{{item.currencyCode}}</span>
- <span>{{item.currencyName}}</span>
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="收款方" prop="payee" :label-width="formLabelWidth">
- <el-input v-model="form.payee" autocomplete="off"></el-input>
- </el-form-item>
- <el-form-item label="支付方式" prop="payDId" :label-width="formLabelWidth">
- <el-select v-model="form.payDId" placeholder="请选择活动区域">
- <el-option v-for="(item,index) in payTypeDatas" :key="index" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="费用标识" prop="orbitalPrivateTransfer" :label-width="formLabelWidth">
- <el-select v-model="form.orbitalPrivateTransfer" placeholder="请选择活动区域">
- <el-option v-for="(item,index) in orbitalPrivateTransferDatas" :key="index" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="消费方式" prop="consumptionPatterns" :label-width="formLabelWidth">
- <el-input v-model="form.consumptionPatterns" autocomplete="off"></el-input>
- </el-form-item>
- <el-form-item label="费用类型" prop="payType" :label-width="formLabelWidth">
- <el-select v-model="form.payType" placeholder="请选择活动区域">
- <el-option v-for="(item,index) in priceTypeDatas" :key="index" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- </div>
- <el-form-item style="width:97%" label="备 注" :label-width="formLabelWidth">
- <el-input style="width:100%" :rows="4" type="textarea" v-model="form.remark" autocomplete="off"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible = false">取 消</el-button>
- <el-button v-if="identify" type="primary" @click="submitForm('form','保存')">确 定</el-button>
- <el-button v-if="revise" type="primary" @click="submitForm('form','修改')">修 改</el-button>
- </div>
- </el-dialog>
- </div>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- cTable:0,
- addAuth:1,
- userid:'',
- value:'',
- options:[],
- groupInfo:{},
- groupsendData:[],
- pageId:0,
- dialogFormVisible:false,
- form:{
- id:0,
- ccpId:0,
- priceName:'',//费用名称
- price:0,//费用
- currencyId:0,//币种Id
- currencyCode:'',//币种Code
- payee:'',//收款方
- payDId:72,//支付方式Id
- orbitalPrivateTransfer:0,//费用标识
- consumptionPatterns:'',//消费方式
- payType:0,//费用类型 0 其他 1 退多付款
- remark:'',//备注
- },
- rules: {
- priceName: [
- { required: true, message: '请输入费用名称', trigger: 'blur' },
- ],
- price: [
- { required: true, message: '请填写完此项', trigger: 'blur' }
- ],
- payee: [
- { required: true, message: '请填写完此项', trigger: 'blur' }
- ],
- payDId: [
- { required: true, message: '请选择', trigger: 'change' }
- ],
- orbitalPrivateTransfer: [
- { required: true, message: '请选择', trigger: 'change' }
- ],
- consumptionPatterns: [
- { required: true, message: '请填写完此项', trigger: 'blur' }
- ],
- payType: [
- { required: true, message: '请选择', trigger: 'change' }
- ]
- },
- formLabelWidth:'100px',
- currencyDatas:[],
- payTypeDatas:[],
- priceTypeDatas:[],
- orbitalPrivateTransferDatas:[],
- identify:false,
- revise:false,
- }
- },
- methods:{
- //保留两位小数
- townum(val){
- return val.toFixed(2)
- },
- filteryear(val){
- let gstime=val.visitDate.split(' ')[0]
- return gstime;
- },
- //获取团组
- GetForeignReceivablesDataSources(){
- var url = "/api/Financial/GetForeignReceivablesDataSources"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.userid
- },
- }).then(function (res) {
- console.log(res)
- if(res.data.code==200){
- that.options=res.data.data.groupNameData;
- that.value=res.data.data.groupNameData[0].id;
- that.PostShareGroupInfo();
- setTimeout(function(){
- that.PostPaymentRefundAndOtherMoneyItemByDiId();
- },100)
- setTimeout(function(){
- that.PostGroupTeamRateByDiIdAndCTableId();
- },500)
- // that.PostGroupTeamRateByDiIdAndCTableId();
- // that.PostPaymentRefundAndOtherMoneyItemByDiId();
- // setTimeout(that.PostPaymentRefundAndOtherMoneyItemByDiId(),500)
- // setTimeout(that.PostGroupTeamRateByDiIdAndCTableId(),10000)
- }else{
- that.$message.error(res.data.msg);
- }
- })
- },
- //获取数据源
- PostPaymentRefundAndOtherMoneyInfoDataSource(){
- var url = "/api/Financial/PostPaymentRefundAndOtherMoneyInfoDataSource"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.userid
- },
- data:{
- portType: 1
- }
- }).then(function (res) {
- console.log(res)
- if(res.data.code==200){
- that.payTypeDatas=res.data.data.payTypeDatas;
- that.priceTypeDatas=res.data.data.priceTypeDatas;
- that.orbitalPrivateTransferDatas=res.data.data.orbitalPrivateTransferDatas;
- }else{
- that.$message.error(res.data.msg);
- }
- })
- },
- //获取Ctable
- PostPageLinkCTable(){
- var url = "/api/Business/PostPageLinkCTable"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.userid
- },
- data:{
- pageId: that.pageId,
- }
- }).then(function (res) {
- console.log(res)
- if(res.data.code==200){
- that.cTable=res.data.data.cTable
- }else{
- that.$message.error(res.data.msg);
- }
- })
- },
- //获取币种数据源
- PostGroupTeamRateByDiIdAndCTableId(){
- var url = "/api/Business/PostGroupTeamRateByDiIdAndCTableId"
- var that = this
- var data={
- portType: 1,
- diId: that.value,
- cTable:that.cTable
- }
- console.log(JSON.stringify(data))
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.userid
- },
- data:{
- portType: 1,
- diId: that.value,
- cTable:that.cTable
- }
- }).then(function (res) {
- console.log(res)
- if(res.data.code==200){
- that.currencyDatas=res.data.data.teamRates;
- if(res.data.data.teamRates.length==0){
- that.$notify({
- title: '警告',
- message: '此团组其他款项未设置币种及汇率,请前往团组汇率设置!',
- type: 'warning',
- duration:0
- });
- }
- that.form.currencyId=res.data.data.teamRates[0].currencyId
- }else{
- that.$message.error(res.data.msg);
- }
- })
- },
- //获取团组详情
- PostShareGroupInfo(){
- var url = "/api/Business/PostShareGroupInfo"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.userid
- },
- data:{
- portType:1,
- id: that.value
- }
- }).then(function (res) {
- console.log(res)
- if(res.data.code==200){
- that.groupInfo=res.data.data;
- }else{
- that.$message.error(res.data.msg);
- }
- })
- },
- //获取团组收款退还与其他款项
- PostPaymentRefundAndOtherMoneyItemByDiId(){
- var url = "/api/Financial/PostPaymentRefundAndOtherMoneyItemByDiId"
- var that = this
- var data={
- portType:1,
- userId:that.userid,
- pageId:that.pageId,
- diId: that.value
- }
- console.log(JSON.stringify(data))
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.userid
- },
- data:{
- portType:1,
- 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.data;
- that.addAuth=res.data.data.pageFuncAuth.addAuth;
- }else{
- that.$message.error(res.data.msg);
- }
- })
- },
- //保存修改
- submitForm(formName,text) {
- console.log(this.form.currencyId)
- console.log(this.currencyDatas)
- this.$refs[formName].validate((valid) => {
- if (valid) {
- var status
- for(var i=0;i<this.currencyDatas.length;i++){
- if(this.currencyDatas[i].currencyId==this.form.currencyId){
- this.form.currencyCode=this.currencyDatas[i].currencyCode
- }
- }
- 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;
- }
- });
- },
- //保存修改api
- PostPaymentRefundAndOtherMoneyAddOrEdit(status){
- var url = "/api/Financial/PostPaymentRefundAndOtherMoneyAddOrEdit"
- var that = this
- var data={
- portType:1,
- pageId:Number(that.pageId),
- 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,
- }
- console.log(JSON.stringify(data))
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.userid
- },
- data:{
- portType:1,
- pageId:that.pageId,
- 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.$message({
- message: res.data.msg,
- type: 'success'
- });
- that.dialogFormVisible=false
- that.PostPaymentRefundAndOtherMoneyItemByDiId()
- }else{
- that.$message.error(res.data.msg);
- }
- })
- },
- //编辑
- Complete(index,row){
- if (this.$refs.form){
- this.$nextTick(() => {
- this.$refs['form'].clearValidate();
- })
- }
- this.identify=false;
- this.revise=true;
- //弹框
- this.dialogFormVisible=true;
- //初始化数据
- this.form={
- id:0,
- ccpId:0,
- priceName:'',//费用名称
- price:0,//费用
- currencyId:0,//币种Id
- currencyCode:'',//币种Code
- payee:'',//收款方
- payDId:72,//支付方式Id
- orbitalPrivateTransfer:0,//费用标识
- consumptionPatterns:'',//消费方式
- payType:0,//费用类型 0 其他 1 退多付款
- remark:'',//备注
- }
- var formobject={}
- var url = "/api/Financial/PostPaymentRefundAndOtherMoneyInfo"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.userid
- },
- data:{
- portType:1,
- id: row.id,
- }
- }).then(function (res) {
- console.log(res)
- if(res.data.code==200){
- formobject=res.data.data;
- 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;
- that.form.payee=formobject.payee;
- that.form.payDId=formobject.payDId;
- that.form.orbitalPrivateTransfer=formobject.orbitalPrivateTransfer;
- that.form.consumptionPatterns=formobject.consumptionPatterns;
- that.form.payType=formobject.payType;
- that.form.remark=formobject.remark;
- }else{
- that.$message.error('获取数据源失败!');
- }
- })
- },
- //表格保留两位小数
- rounding(row,column) {
- return parseFloat(row[column.property]).toFixed(2)
- },
- //删除
- Delete(index,row){
- this.$confirm('此操作将删除此条数据,是否确认删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- var url = "/api/Financial/PostPaymentRefundAndOtherMoneyDel"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.userid
- },
- data:{
- portType:1,
- userId:that.userid,
- pageId:that.pageId,
- id: row.id
- }
- }).then(function (res) {
- console.log(res)
- if(res.data.code==200){
- that.$message({
- message: res.data.msg,
- type: 'success'
- });
- that.PostPaymentRefundAndOtherMoneyItemByDiId()
- }else{
- that.$notify({
- title: '警告',
- message: res.data.msg,
- type: 'warning',
- duration:0
- });
- // that.$message.error(res.data.msg);
- }
- })
- })
- },
- //新增
- addclick(){
- this.revise=false;
- this.identify=true;
- this.form={
- id:0,
- ccpId:0,
- priceName:'',//费用名称
- price:0,//费用
- currencyId:0,//币种Id
- currencyCode:'',//币种Code
- payee:'',//收款方
- payDId:72,//支付方式Id
- orbitalPrivateTransfer:0,//费用标识
- consumptionPatterns:'',//消费方式
- payType:0,//费用类型 0 其他 1 退多付款
- remark:'',//备注
- }
- this.dialogFormVisible=true;
- this.PostGroupTeamRateByDiIdAndCTableId()
- },
- changediid(){
- console.log(this.value)
- this.PostShareGroupInfo();
- this.PostPaymentRefundAndOtherMoneyItemByDiId();
- }
- },
- filters:{
- filter_time(value){
- if(value){
- return value.split(' ')[0];
- }
- return value
-
- },
- filter_city(value){
- return value
- }
- },
- mounted(){
- this.userid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
- this.pageId=Number(localStorage.getItem('indexs').split('-')[1]);//页面id
- console.log(this.pageId)
- this.PostPageLinkCTable();
- this.GetForeignReceivablesDataSources();
- // setTimeout(this.PostPaymentRefundAndOtherMoneyInfoDataSource(),500)
- this.PostPaymentRefundAndOtherMoneyInfoDataSource();
- // setTimeout(this.PostGroupTeamRateByDiIdAndCTableId(), 3000);
- // this.PostGroupTeamRateByDiIdAndCTableId();
- }
- }
- </script>
- <style>
- .sendack-all{
- background-color: #fff;
- padding: 10px;
- box-shadow: 0 0 5px #0005;
- border-radius: 10px;
- height: 100%;
- min-height: 840px;
- }
- .sendack-head-li label{
- color: #606266;
- font-size: 15px;
- font-weight: 600;
- }
- .sendack-head{
- display: flex;
- justify-content: space-between;
- }
- .sendack-info{
- display: flex;
- margin-top: 10px;
- margin-bottom: 10px;
- }
- .sendack-info-li{
- margin-right: 30px;
- }
- .sendack-info-li label{
- color: #606266;
- font-size: 15px;
- font-weight: 600;
- }
- .sendack-info-li span{
- color: #606266;
- font-size: 14px;
- }
- .sendack-all .el-form-item{
- width: 50%;
- }
- .sendack-all .el-form-item input{
- width: 300px;
- }
- .sendack-all .fyjeinput{
- width: 148px;
- }
- .sendack-all .fyjeinput input{
- width: 100%;
- }
- .sendack-all .sendack-dialog .fyjeselect{
- width: 148px;
- }
- .sendack-all .fyjeselect input{
- width: 100%;
- }
- .sendack-all .el-dialog__body{
- padding-top: 10px;
- }
- .el-dialog__body .sendack-info{
- margin-left: 25px;
- margin-bottom: 20px;
- flex-wrap: wrap;
- }
- .el-dialog__body .sendack-info-li{
- margin-bottom: 10px;
- }
- .sendack-dialog .el-select{
- width: 300px;
- }
- </style>
|