123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407 |
- <template>
- <div>
- <div class="lncomingbill-all">
- <div class="lncomingbill-head">
- <div class="lncomingbill-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 class="lncomingbill-head-li">
- <el-button @click="Saveition()" type="primary">保存数据</el-button>
- <el-button type="primary">生成收款单(四川)</el-button>
- <el-button type="primary">生成收款单(北京)</el-button>
- <el-button type="primary">汇款账单</el-button>
- </div>
- </div>
- <div class="lncomingbill-info">
- <div class="lncomingbill-info-li">
- <label>团 号:</label>
- <span>{{groupInfo.tourCode}}</span>
- </div>
- <div class="lncomingbill-info-li">
- <label>客 户:</label>
- <span>{{groupInfo.clientName}}</span>
- </div>
- <div class="lncomingbill-info-li">
- <label>出访国家:</label>
- <span>{{groupInfo.visitCountry|filter_city}}</span>
- </div>
- <div class="lncomingbill-info-li">
- <label>起止日期:</label>
- <span>{{groupInfo.tontractTime|filter_time}}~{{groupInfo.visitDate|filter_time}}</span>
- </div>
- <div class="lncomingbill-info-li">
- <label>天数/人数:</label>
- <span>{{groupInfo.visitDays}}天/{{groupInfo.visitPNumber}}人</span>
- </div>
- </div>
- <div class="lncomingbill-checked">
- <div class="checked-label">收款账单</div>
- <el-button @click="addition" type="primary">添加一行</el-button>
- </div>
- <div class="lncomingbill-form">
- <el-table
- :border="true"
- ref="multipleTable"
- :data="tableData"
- style="width: 100%;"
- >
- <el-table-column
- prop="addingModeName"
- label="增加方式"
- width="100">
- </el-table-column>
- <el-table-column
- prop="createTime"
- label="时间"
- width="100">
- </el-table-column>
- <el-table-column
- label="费用名称"
- width="240">
- <template slot-scope="scope">
- <el-input v-model="scope.row.priceName"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- label="单 价"
- width="140">
- <template slot-scope="scope">
- <el-input-number :controls="false" :precision="2" class="editNum" v-model="scope.row.price"></el-input-number>
- </template>
- </el-table-column>
- <el-table-column
- label="数 量"
- width="80">
- <template slot-scope="scope">
- <el-input v-model="scope.row.count"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- label="单 位"
- width="90">
- <template slot-scope="scope">
- <el-input v-model="scope.row.unit"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- label="币 种"
- width="100">
- <template slot-scope="scope">
- <el-select filterable v-model="scope.row.currency">
- <el-option
- v-for="item in currencyoptions"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- label="汇 率"
- width="100">
- <template slot-scope="scope">
- <el-input-number :controls="false" :precision="2" v-model="scope.row.rate"></el-input-number>
- </template>
- </el-table-column>
- <el-table-column
- label="应收金额"
- width="120">
- <template slot-scope="scope">
- <div class="sub-box">{{scope.row.itemSumPrice=(scope.row.price*scope.row.count*scope.row.rate).toFixed(2)}}</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="remark"
- label="备注">
- <template slot-scope="scope">
- <el-input v-model="scope.row.remark" placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- prop="name"
- label="操 作"
- width="100">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="danger"
- @click="handleDelete(scope.$index, scope.row,tableData)"><i class="el-icon-delete"></i></el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- userid:'',
- value:"",
- options:[],
- tableData:[
- {
- addingModeName:"",
- createTime:"",
- priceName:"",
- price:"",
- count:"",
- unit:"",
- currency:"",
- rate:"",
- itemSumPrice:"",
- remark:"",
- }
- ],
- currencyoptions:[],
- groupInfo:{},
- }
- },
- methods:{
- //获取团组
- 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)
- that.options=res.data.data.groupNameData;
- that.currencyoptions=res.data.data.currencyData;
- that.typeoptions=res.data.data.remittanceMethodData;
- that.value=res.data.data.groupNameData[0].id;
- that.PostGroupReceivablesInfoByDiId();
- })
- },
- //获取收款账单详情
- PostGroupReceivablesInfoByDiId(){
- var url = "/api/Financial/PostGroupReceivablesInfoByDiId"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + that.userid
- },
- data:{
- portType: 1,
- diId: that.value
- }
- }).then(function (res) {
- console.log(res)
- that.tableData=res.data.data.groupCollectionStatementData
- that.groupInfo=res.data.data.groupInfo
- })
- },
- //切换团组
- changediid(){
- this.PostGroupReceivablesInfoByDiId()
- },
- //添加一行
- addition(){
- var newinif={
- id: 0,
- priceName: "",//费用名称
- price: 0,//费用
- count: 0,//数量
- unit:'',//单位
- itemSumPrice:0,// 单项总和
- rate:1,// 汇率
- currency:836,//币种
- addingWay:0,//添加方式
- remark:""//备注
- }
- var url = "/api/Financial/PostReceivablesSave"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- data:{
- portType: 1,
- diId: that.value,
- userId:that.userid,
- foreignReceivablesInfos:[newinif]
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.$message({
- message: res.data.msg,
- type: 'success'
- });
- console.log(res)
- that.PostGroupReceivablesInfoByDiId()
- }else{
- that.$message.error('添加失败!数据异常');
- }
- })
- },
- //对外收款账单删除
- handleDelete(index, row,rows) {
- this.$confirm('此操作将删除此条数据,是否确认删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- var url = "/api/Financial/PostGroupReceivablesDel"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- data:{
- userId:that.userid,
- id:row.id
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.$message({
- message: res.data.msg,
- type: 'success'
- });
- rows.splice(index, 1);
- }else{
- that.$message.error('删除失败!数据异常');
- }
- })
- })
- },
- //保存收款单
- Saveition(){
- console.log(this.tableData)
- //提取参数
- var arrnew = this.tableData.map((item,index) => {
- return Object.assign({},{
- 'id':item.id,
- 'priceName':item.priceName,
- 'price':item.price,
- 'count':item.count,
- 'unit':item.unit,
- 'itemSumPrice':item.itemSumPrice,
- 'rate':item.rate,
- 'currency':item.currency,
- 'addingWay':item.addingWay,
- 'remark':item.remark,
- })
- })
- console.log(arrnew)
- var Savedecides=true
- for(let g=0;g<arrnew.length;g++){
- if(arrnew[g].count==""||arrnew[g].currency==""||arrnew[g].itemSumPrice==""||arrnew[g].price==""||arrnew[g].priceName==""||arrnew[g].rate==""||arrnew[g].unit==""){
- Savedecides=false
- break
- }
- }
- if(Savedecides==true){
- var url = "/api/Financial/PostReceivablesOperate"
- var that = this
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- data:{
- portType: 1,
- diId: that.value,
- userId:that.userid,
- foreignReceivablesInfos:arrnew
- }
- }).then(function (res) {
- if(res.data.code==200){
- that.$message({
- message: res.data.msg,
- type: 'success'
- });
- console.log(res)
- that.PostGroupReceivablesInfoByDiId()
- }else{
- that.$message.error('保存失败!数据异常');
- }
- })
- }else{
- this.$message.error('请检查数据是否完整!');
- }
- },
- },
- mounted(){
- this.userid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
- this.GetForeignReceivablesDataSources();
-
- },
- filters:{
- filter_time(value){
- return value;
- },
- filter_city(value){
- return value
- }
- },
- }
- </script>
- <style>
- .lncomingbill-all{
- background-color: #fff;
- padding: 10px;
- box-shadow: 0 0 5px #0005;
- border-radius: 10px;
- height: 100%;
- min-height: 840px;
- }
- .lncomingbill-head-li label{
- color: #606266;
- font-size: 15px;
- font-weight: 600;
- }
- .lncomingbill-head{
- display: flex;
- justify-content: space-between;
- }
- .lncomingbill-info{
- display: flex;
- margin-top: 10px;
- }
- .lncomingbill-info-li{
- margin-right: 30px;
- }
- .lncomingbill-info-li label{
- color: #606266;
- font-size: 15px;
- font-weight: 600;
- }
- .lncomingbill-info-li span{
- color: #606266;
- font-size: 14px;
- }
- .lncomingbill-all .el-input-number{
- width: 100%;
- }
- .lncomingbill-checked{
- margin-top: 10px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .lncomingbill-form{
- margin-top: 10px;
- }
- </style>
|