visaAgencyfee.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <div class="visaAgencyfee-all">
  3. <div class="visaAgencyfee-head">
  4. <div class="visaAgencyfee-head-title">签证代办</div>
  5. <div class="visaAgencyfee-head-select">
  6. <el-select filterable @change="PostGroupListByCTableAndUserId" style="width:300px" v-model="diid"
  7. placeholder="请选择团组">
  8. <el-option v-for="(item,index) in Options" :label="item.teamName" :value="item.id"
  9. :key="index"></el-option>
  10. </el-select>
  11. <el-button @click="PostVisaFeeAddAndUpdate" type="primary">保存</el-button>
  12. </div>
  13. </div>
  14. <div style="margin:10px 0;color:#606266;">
  15. <span style="font-weight: bold;font-size:15px;">团队名称:</span>
  16. <span style="color:#606266;font-size:14px;">{{ delegationInfo.teamName }}&nbsp;&nbsp;&nbsp;</span>
  17. <span style="font-weight: bold;font-size:15px;">客户:</span>
  18. <span style="color:#606266;font-size:14px;">{{ delegationInfo.clientName }}&nbsp;&nbsp;&nbsp; {{
  19. }}&nbsp;&nbsp;&nbsp;</span>
  20. <span style="font-weight: bold;font-size:15px;">出访国家:</span>
  21. <span style="color:#606266;font-size:14px;">{{ delegationInfo.visitCountry }}&nbsp;&nbsp;&nbsp;</span>
  22. <span style="font-weight: bold;font-size:15px;">起止日期:</span>
  23. <span style="color:#606266;font-size:14px;">{{ delegationInfo.visitStartDate }}—{{
  24. delegationInfo.visitEndDate
  25. }}&nbsp;&nbsp;&nbsp;</span>
  26. <span style="font-weight: bold;font-size:15px;">天数/人数:</span>
  27. <span style="color:#606266;font-size:14px;">{{ delegationInfo.visitDays }}天/{{ delegationInfo.visitPNumber
  28. }}人</span>
  29. </div>
  30. <div class="visaAgencyfee-table">
  31. <el-table border :data="tableData" tooltip-effect="dark" style="width: 100%"
  32. @selection-change="handleSelectionChange">
  33. <el-table-column type="selection" width="55">
  34. <template slot-scope="scope">
  35. <el-checkbox :true-label="1" :false-label="0" v-model="scope.row.isChecked">
  36. </el-checkbox>
  37. </template>
  38. </el-table-column>
  39. <el-table-column prop="country" label="国家" width="180">
  40. <template slot-scope="scope">
  41. <el-input v-model="scope.row.country" placeholder="请输入内容"></el-input>
  42. </template>
  43. </el-table-column>
  44. <el-table-column prop="visaFee" label="公务类型" width="180">
  45. <template slot-scope="scope">
  46. <el-select style="width:100%" filterable
  47. v-model="scope.row.obType" placeholder="请选择团组">
  48. <el-option label="大公务" :value=1 key='1'></el-option>
  49. <el-option label="小公务" :value=2 key='2'></el-option>
  50. <!-- <el-option label="未选择" :value=0 key='0'></el-option> -->
  51. </el-select>
  52. </template>
  53. </el-table-column>
  54. <el-table-column prop="visaFee" label="签证费" width="180">
  55. <template slot-scope="scope">
  56. <el-input-number style="width:100%;" :controls="false" v-model="scope.row.visaFee"
  57. :precision="2"></el-input-number>
  58. </template>
  59. </el-table-column>
  60. <el-table-column prop="agencyFee" label="代办费" width="180">
  61. <template slot-scope="scope">
  62. <el-input-number style="width:100%;" :controls="false" v-model="scope.row.agencyFee"
  63. :precision="2"></el-input-number>
  64. </template>
  65. </el-table-column>
  66. <el-table-column prop="otherFee" label="其他费用" width="180">
  67. <template slot-scope="scope">
  68. <el-input-number style="width:100%;" :controls="false" v-model="scope.row.otherFee"
  69. :precision="2"></el-input-number>
  70. </template>
  71. </el-table-column>
  72. <!-- <el-table-column prop="otherFee" label="备注">
  73. <template slot-scope="scope">
  74. <el-input v-model="scope.row.country" placeholder="请输入内容"></el-input>
  75. </template>
  76. </el-table-column> -->
  77. </el-table>
  78. </div>
  79. </div>
  80. </template>
  81. <script>
  82. export default {
  83. data () {
  84. return {
  85. diid:0,
  86. tableData:[],
  87. tableDatas: [{
  88. id: 0,
  89. isChecked: 0,
  90. country: '',
  91. visaFee: 0,
  92. obType:1,
  93. agencyFee: 0,
  94. otherFee: 0,
  95. }, {
  96. id: 0,
  97. isChecked: 0,
  98. country: '',
  99. visaFee: 0,
  100. obType:1,
  101. agencyFee: 0,
  102. otherFee: 0,
  103. }, {
  104. id: 0,
  105. isChecked: 0,
  106. country: '',
  107. visaFee: 0,
  108. obType:1,
  109. agencyFee: 0,
  110. otherFee: 0,
  111. }, {
  112. id: 0,
  113. isChecked: 0,
  114. country: '',
  115. visaFee: 0,
  116. obType:1,
  117. agencyFee: 0,
  118. otherFee: 0,
  119. }, {
  120. id: 0,
  121. isChecked: 0,
  122. country: '',
  123. visaFee: 0,
  124. obType:1,
  125. agencyFee: 0,
  126. otherFee: 0,
  127. }, {
  128. id: 0,
  129. isChecked: 0,
  130. country: '',
  131. visaFee: 0,
  132. obType:1,
  133. agencyFee: 0,
  134. otherFee: 0,
  135. }],
  136. token:'',
  137. userId:'',
  138. Options:[],
  139. delegationInfo:{},
  140. multipleSelection:[]
  141. }
  142. },
  143. methods:{
  144. //团组下拉框
  145. PostGroupListByCTableAndUserId() {
  146. var url = "/api/Business/PostGroupListByCTableAndUserId"
  147. var that = this
  148. this.$axios({
  149. method: 'post',
  150. url: url,
  151. headers: {
  152. Authorization: 'Bearer ' + that.token
  153. },
  154. data: {
  155. portType: 1,
  156. pageIndex: 1,
  157. pageSize: 10000,
  158. cTable: 80,
  159. userId: that.userId,
  160. }
  161. }).then(function (res) {
  162. if (res.data.code == 200) {
  163. that.Options=res.data.data;
  164. if(that.diid==0){
  165. that.diid=that.Options[0].id;
  166. }
  167. for(var i=0;i<that.Options.length;i++){
  168. if(that.diid==that.Options[i].id){
  169. that.delegationInfo=that.Options[i]
  170. }
  171. }
  172. that.PostVisaFeeList();
  173. }else{
  174. that.$message.error(res.data.msg);
  175. }
  176. }).catch(function (error) {
  177. that.$message.error(error);
  178. });
  179. },
  180. //详细
  181. PostVisaFeeList() {
  182. var url = "/api/Groups/PostVisaFeeList"
  183. var that = this
  184. this.$axios({
  185. method: 'post',
  186. url: url,
  187. headers: {
  188. Authorization: 'Bearer ' + that.token
  189. },
  190. data: {
  191. portType: 1,
  192. diId:that.diid
  193. }
  194. }).then(function (res) {
  195. if (res.data.code == 200) {
  196. if(res.data.data.length>0){
  197. that.tableData=res.data.data;
  198. }else{
  199. console.log(that.tableDatas)
  200. that.tableData = [
  201. {
  202. id: 0,
  203. isChecked: 0,
  204. country: '',
  205. visaFee: 0,
  206. obType:1,
  207. agencyFee: 0,
  208. otherFee: 0,
  209. }, {
  210. id: 0,
  211. isChecked: 0,
  212. country: '',
  213. visaFee: 0,
  214. obType:1,
  215. agencyFee: 0,
  216. otherFee: 0,
  217. }, {
  218. id: 0,
  219. isChecked: 0,
  220. country: '',
  221. visaFee: 0,
  222. obType:1,
  223. agencyFee: 0,
  224. otherFee: 0,
  225. }, {
  226. id: 0,
  227. isChecked: 0,
  228. country: '',
  229. visaFee: 0,
  230. obType:1,
  231. agencyFee: 0,
  232. otherFee: 0,
  233. }, {
  234. id: 0,
  235. isChecked: 0,
  236. country: '',
  237. visaFee: 0,
  238. obType:1,
  239. agencyFee: 0,
  240. otherFee: 0,
  241. }, {
  242. id: 0,
  243. isChecked: 0,
  244. country: '',
  245. visaFee: 0,
  246. obType:1,
  247. agencyFee: 0,
  248. otherFee: 0,
  249. }
  250. ]
  251. var delegationInfos=[]
  252. delegationInfos=[]
  253. delegationInfos=that.delegationInfo.visitCountry.split("|")
  254. for(var k=0;k<delegationInfos.length;k++){
  255. that.tableData[k].country=delegationInfos[k];
  256. that.tableData[k].isChecked=1;
  257. }
  258. }
  259. }else{
  260. that.$message.error(res.data.msg);
  261. }
  262. }).catch(function (error) {
  263. that.$message.error(error);
  264. });
  265. },
  266. //保存
  267. PostVisaFeeAddAndUpdate() {
  268. var newsarr=[];
  269. for(var a=0;a<this.tableData.length;a++){
  270. if(this.tableData[a].country!=""){
  271. newsarr.push(this.tableData[a])
  272. }
  273. }
  274. var url = "/api/Groups/PostVisaFeeAddAndUpdate"
  275. var that = this
  276. this.$axios({
  277. method: 'post',
  278. url: url,
  279. headers: {
  280. Authorization: 'Bearer ' + that.token
  281. },
  282. data: {
  283. portType: 1,
  284. opUserId: that.userId,
  285. diId: that.diid,
  286. visaFeeInfos: newsarr,
  287. }
  288. }).then(function (res) {
  289. if (res.data.code == 200) {
  290. that.$message({
  291. type: 'success',
  292. message: res.data.msg
  293. });
  294. that.PostVisaFeeList();
  295. }else{
  296. that.$message.error(res.data.msg);
  297. }
  298. }).catch(function (error) {
  299. that.$message.error(error);
  300. });
  301. },
  302. handleSelectionChange(val) {
  303. this.multipleSelection = val;
  304. console.log(this.multipleSelection);
  305. }
  306. },
  307. created(){
  308. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  309. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
  310. },
  311. mounted(){
  312. this.PostGroupListByCTableAndUserId();
  313. }
  314. }
  315. </script>
  316. <style>
  317. .visaAgencyfee-all {
  318. background-color: #fff;
  319. padding: 10px;
  320. box-shadow: 0 0 5px #0005;
  321. border-radius: 10px;
  322. min-height: 830px;
  323. }
  324. .visaAgencyfee-head-title{
  325. font-size: 17px;
  326. font-weight: 600;
  327. color: #555;
  328. }
  329. .visaAgencyfee-head-select{
  330. margin-top: 10px;
  331. display: flex;
  332. justify-content: space-between;
  333. }
  334. .visaAgencyfee-table{
  335. margin-top: 10px;
  336. }
  337. </style>