OpDecreasePayments.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. <template>
  2. <div class="car_add" v-loading.fullscreen.lock="fullscreenLoading">
  3. <div>
  4. <div class="communal-title">
  5. <div>{{ title }}</div>
  6. </div>
  7. </div>
  8. <hr style='background-color:#5555; height:1px; border:none;margin: 10px 0;' />
  9. <div>
  10. <el-form :model="delegationInfo" label-width="100px" class="demo-ruleForm">
  11. <div style="display: flex;flex-wrap: wrap;">
  12. <div style="width: 394px;">
  13. <el-form-item label="团组名称:" label-width="160px">
  14. <el-select v-model="DiIdSelect" clearable filterable placeholder="团组选择"
  15. @change="DecreasePaymentsChange" :disabled="isShow" style="width: 100%;">
  16. <el-option v-for="item in delegationInfoList" :key="item.id" :label="item.teamName"
  17. :value="item.id">
  18. </el-option>
  19. </el-select>
  20. </el-form-item>
  21. </div>
  22. <div style="width: 394px;">
  23. <el-form-item label="团 号:" prop="tourCode" label-width="160px">
  24. <el-input placeholder="团号" v-model="delegationInfo.tourCode" :disabled="true">
  25. </el-input>
  26. </el-form-item>
  27. </div>
  28. <div style="width: 394px;">
  29. <el-form-item label="客户:" prop="clientName" label-width="160px">
  30. <el-input placeholder="客户" v-model="delegationInfo.clientName" :disabled="true">
  31. </el-input>
  32. </el-form-item>
  33. </div>
  34. <div style="width: 394px;">
  35. <el-form-item label="出访国家:" prop="visitCountry" label-width="160px">
  36. <el-input placeholder="出访国家" v-model="delegationInfo.visitCountry" :disabled="true">
  37. </el-input>
  38. </el-form-item>
  39. </div>
  40. </div>
  41. </el-form>
  42. <el-form :model="DecreasePaymentsData" ref="DecreasePaymentsData" :rules="DecreasePaymentsRules"
  43. label-width="100px" class="demo-ruleForm">
  44. <div style="display:flex ;flex-wrap: wrap;">
  45. <!-- <div style="width: 394px;">
  46. <el-form-item label="团组类型:" prop="clientName" label-width="160px">
  47. <el-input placeholder="团组类型" v-model="delegationInfo.clientName" :disabled="true">
  48. </el-input>
  49. </el-form-item>
  50. </div> -->
  51. <div style="width: 394px;">
  52. <el-form-item label="费用名称:" prop="priceName" label-width="160px">
  53. <el-input placeholder="费用名称" v-model="DecreasePaymentsData.priceName">
  54. </el-input>
  55. </el-form-item>
  56. </div>
  57. <div style="width: 394px;">
  58. <el-form-item label="费用单价:" prop="currency" label-width="160px">
  59. <el-input-number @blur="Sumup" style="width:56%" :precision="2" placeholder="费用金额" v-model="DecreasePaymentsData.price" :controls='false'>
  60. </el-input-number>
  61. <!-- <el-input placeholder="费用单价" v-model="DecreasePaymentsData.price" style="width: 56%;">
  62. </el-input> -->
  63. <el-select v-model="DecreasePaymentsData.currency" style="width: 40%;">
  64. <el-option v-for="item in rateList" :key="item.currencyId" :label="item.currencyCode"
  65. :value="item.currencyId"></el-option>
  66. </el-select>
  67. </el-form-item>
  68. </div>
  69. <div style="width: 394px;">
  70. <el-form-item label="数量:" prop="quantity" label-width="160px">
  71. <el-input-number @blur="Sumup" style="width:100%" :precision="2" placeholder="数量" v-model="DecreasePaymentsData.quantity" :controls='false'>
  72. </el-input-number>
  73. <!-- <el-input placeholder="数量" v-model="DecreasePaymentsData.payee">
  74. </el-input> -->
  75. </el-form-item>
  76. </div>
  77. <div style="width: 394px;">
  78. <el-form-item label="供应商全称:" prop="supplierName" label-width="160px">
  79. <!-- <el-input placeholder="供应商全称" v-model="DecreasePaymentsData.supplierName">
  80. </el-input> -->
  81. <el-autocomplete
  82. style="width: 100%;"
  83. v-model="DecreasePaymentsData.supplierName"
  84. :fetch-suggestions="querySearchAsync"
  85. placeholder="供应商全称"
  86. @select="handleSelect"
  87. ></el-autocomplete>
  88. </el-form-item>
  89. </div>
  90. <div v-if="eventspd" style="width: 394px;">
  91. <el-form-item label="供应商类型:" prop="supplierTypeId" label-width="160px">
  92. <el-select v-model="DecreasePaymentsData.supplierTypeId" placeholder="供应商类型"
  93. style="width: 100%;">
  94. <el-option v-for="(item,index) in suppliertype" :key="index" :label="item.name" :value="item.id"></el-option>
  95. </el-select>
  96. </el-form-item>
  97. </div>
  98. <div style="width: 394px;">
  99. <el-form-item label="供应商地区:" prop="supplierArea" label-width="160px">
  100. <el-select v-model="DecreasePaymentsData.supplierArea" placeholder="供应商地区"
  101. style="width: 100%;">
  102. <el-option v-for="(item,index) in supplierRegion" :key="index" :label="item.name" :value="item.id"></el-option>
  103. </el-select>
  104. </el-form-item>
  105. </div>
  106. <div style="width: 394px;">
  107. <el-form-item label="社交账号:" prop="supplierSocialAccount" label-width="160px">
  108. <el-input placeholder="社交账号" v-model="DecreasePaymentsData.supplierSocialAccount">
  109. </el-input>
  110. </el-form-item>
  111. </div>
  112. <div style="width: 394px;">
  113. <el-form-item label="供应商地址:" prop="supplierAddress" label-width="160px">
  114. <el-input placeholder="供应商地址" v-model="DecreasePaymentsData.supplierAddress">
  115. </el-input>
  116. </el-form-item>
  117. </div>
  118. <div style="width: 394px;">
  119. <el-form-item label="邮箱:" prop="supplierEmail" label-width="160px">
  120. <el-input placeholder="邮箱" v-model="DecreasePaymentsData.supplierEmail">
  121. </el-input>
  122. </el-form-item>
  123. </div>
  124. <div style="width: 394px;">
  125. <el-form-item label="联系人:" prop="supplierContact" label-width="160px">
  126. <el-input placeholder="联系人" v-model="DecreasePaymentsData.supplierContact">
  127. </el-input>
  128. </el-form-item>
  129. </div>
  130. <div style="width: 394px;">
  131. <el-form-item label="联系电话:" prop="supplierContactNumber" label-width="160px">
  132. <el-input placeholder="联系电话" v-model="DecreasePaymentsData.supplierContactNumber">
  133. </el-input>
  134. </el-form-item>
  135. </div>
  136. <div style="width: 394px;">
  137. <el-form-item label="费用标识:" prop="orbitalPrivateTransfer" label-width="160px">
  138. <el-select v-model="DecreasePaymentsData.orbitalPrivateTransfer" placeholder="费用标识"
  139. style="width: 100%;">
  140. <el-option key="0" label="公转" :value=0>
  141. </el-option>
  142. <el-option key="1" label="私转" :value=1>
  143. </el-option>
  144. </el-select>
  145. </el-form-item>
  146. </div>
  147. <div style="width: 394px;">
  148. <el-form-item label="费用总价:" label-width="160px">
  149. <el-input-number disabled style="width:56%" :precision="2" placeholder="费用总价" v-model="DecreasePaymentsData.feeTotal" :controls='false'>
  150. </el-input-number>
  151. <el-select disabled v-model="DecreasePaymentsData.currency" style="width: 40%;">
  152. <el-option v-for="item in rateList" :key="item.currencyId" :label="item.currencyCode"
  153. :value="item.currencyId"></el-option>
  154. </el-select>
  155. </el-form-item>
  156. </div>
  157. <div style="width: 394px;">
  158. <el-form-item label="支付方式:" prop="payDId" label-width="160px">
  159. <el-select v-model="DecreasePaymentsData.payDId" placeholder="支付方式" style="width: 100%;">
  160. <el-option v-for="item in payment" :key="item.id" :label="item.name" :value="item.id">
  161. </el-option>
  162. </el-select>
  163. </el-form-item>
  164. </div>
  165. <div style="width: 394px;">
  166. <el-form-item label="开户行:" label-width="160px">
  167. <el-input placeholder="开户行" v-model="DecreasePaymentsData.otherBankName">
  168. </el-input>
  169. </el-form-item>
  170. </div>
  171. <div style="width: 394px;">
  172. <el-form-item label="银行卡号:" label-width="160px">
  173. <el-input placeholder="银行卡号" v-model="DecreasePaymentsData.otherSideNo">
  174. </el-input>
  175. </el-form-item>
  176. </div>
  177. <div style="width: 394px;">
  178. <el-form-item label="对方姓名:" label-width="160px">
  179. <el-input placeholder="对方姓名" v-model="DecreasePaymentsData.otherSideName">
  180. </el-input>
  181. </el-form-item>
  182. </div>
  183. <div v-if="Switchwifi" style="width: 394px;">
  184. <el-form-item label="wifi平台OTA订单号:" prop="otaOrderNo" label-width="160px">
  185. <el-input placeholder="wifi平台OTA订单号" v-model="DecreasePaymentsData.otaOrderNo">
  186. </el-input>
  187. </el-form-item>
  188. </div>
  189. </div>
  190. <div style="display: flex;">
  191. <div>
  192. <el-form-item label="附件:" prop="fileUrl" label-width="160px">
  193. <el-upload :file-list="uploadFiles" ref="upload" :on-success="upLoadSuccess"
  194. :on-error="upLoadError" :before-remove="beforeRemove" :on-change="onChange" :limit="1"
  195. :on-exceed="exceed" :action="uploadURL" :headers="headers" :auto-upload="false">
  196. <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
  197. <!-- <el-button style="margin-left: 10px;" size="small" type="success"
  198. @click="submitUpload">上传到服务器</el-button> -->
  199. </el-upload>
  200. </el-form-item>
  201. </div>
  202. </div>
  203. <div style="display: flex;">
  204. <div style="width: 100%;">
  205. <el-form-item label="备 注:" prop="remark" label-width="160px">
  206. <el-input type="textarea" :rows="5" placeholder="备注"
  207. v-model="DecreasePaymentsData.remark"></el-input>
  208. </el-form-item>
  209. </div>
  210. </div>
  211. <el-form-item>
  212. <div style="text-align: right;">
  213. <el-button type="primary" @click="addBtn">保存</el-button>
  214. <!-- <router-link to='/home/DecreasePayments'> -->
  215. <el-button @click="quxiao">取消</el-button>
  216. <!-- </router-link> -->
  217. </div>
  218. </el-form-item>
  219. </el-form>
  220. </div>
  221. </div>
  222. </template>
  223. <script>
  224. import { Decimal } from 'decimal.js'
  225. import {debounce} from '../../store/statice'
  226. export default {
  227. data() {
  228. return {
  229. projectName: "",
  230. uploadURL: "http://132.232.92.186:8888/api/Groups/UploadProject",
  231. uploadFiles: [],//上传的文件列表
  232. DelfileName: "",
  233. title: "新增其他款项",
  234. token: '',
  235. userId: 0,
  236. id: '',
  237. DiId: '',
  238. isShow: false,
  239. DiIdSelect: '',
  240. delegationInfo: {},
  241. delegationInfoList: [],//团组下拉框
  242. payment: [],//支付方式下拉框
  243. DecreasePaymentsData: {
  244. status: 0,//操作状态 1 添加 2 修改
  245. payDId: 72,//支付方式
  246. orbitalPrivateTransfer: 0,//费用表示
  247. supplierName: "",//收款方
  248. id: 0,//编号
  249. diId: 0,//团组外键编号
  250. priceName: "",//费用名称
  251. price: 0,//费用金额
  252. supplierContact:"",//联系人
  253. supplierContactNumber:"",//联系电话
  254. currency: '',//费用币种
  255. filePath: "",//附件地址
  256. createUserId: 0,//创建者Id
  257. remark: "",//备注
  258. supplierArea:1,//供应商地区
  259. supplierTypeId:'',//供应商类型
  260. quantity:0,//数量
  261. feeTotal:0,//总计
  262. supplierSocialAccount:'',//社交账号
  263. supplierAddress:'',//供应商地址
  264. supplierEmail:'',//邮箱
  265. otherBankName:'',//开户行
  266. otherSideNo:'',//银行卡号
  267. otherSideName:'',//对方姓名
  268. otaOrderNo:'',//wifi平台OTA订单号
  269. },
  270. IsAuditGM: 0,
  271. Decrease: {},
  272. CreditCard: {},
  273. headers: {
  274. Authorization: JSON.parse(localStorage.getItem('userinif')).token,
  275. TypeName: "A"
  276. },
  277. DecreasePaymentsRules: {
  278. currency: [
  279. { required: true, message: '请选择币种', trigger: 'change' },
  280. ],
  281. priceName: [
  282. { required: true, message: '请输入费用名称', trigger: 'change' },
  283. ],
  284. supplierName: [
  285. { required: true, message: '请输入供应商全称', trigger: 'change' },
  286. ],
  287. orbitalPrivateTransfer: [
  288. { required: true, message: '请选择费用标识', trigger: 'change' },
  289. ],
  290. payDId: [
  291. { required: true, message: '请选择支付方式', trigger: 'change' }
  292. ],
  293. quantity: [
  294. { required: true, message: '请输入数量', trigger: 'blur' }
  295. ],
  296. supplierContact: [
  297. { required: true, message: '请输入', trigger: 'blur' }
  298. ],
  299. supplierContactNumber: [
  300. { required: true, message: '请输入联系人电话', trigger: 'blur' }
  301. ],
  302. supplierTypeId: [
  303. { required: true, message: '请选择供应商类型', trigger: 'change' }
  304. ],
  305. supplierArea: [
  306. { required: true, message: '请选择供应商地区', trigger: 'change' }
  307. ],
  308. supplierSocialAccount: [
  309. { required: true, message: '请输入', trigger: 'blur' }
  310. ],
  311. supplierAddress: [
  312. { required: true, message: '请输入', trigger: 'blur' }
  313. ],
  314. supplierEmail: [
  315. { required: true, message: '请输入', trigger: 'blur' }
  316. ],
  317. otaOrderNo: [
  318. { required: true, message: '请输入', trigger: 'blur' }
  319. ],
  320. },
  321. rateList: [],
  322. suppliertype:[],
  323. supplierRegion:[],
  324. eventspd:true,
  325. fullscreenLoading:false,
  326. queryArr : [],
  327. Switchwifi:false,
  328. }
  329. },
  330. watch:{
  331. 'DecreasePaymentsData.priceName'(newVal,oldVal){
  332. if(newVal.toLowerCase().includes('wifi')){
  333. // console.log(newVal.toLowerCase(),this.Switchwifi)
  334. this.Switchwifi=true;
  335. }else{
  336. this.Switchwifi=false;
  337. }
  338. },
  339. },
  340. methods: {
  341. //团组下拉框
  342. AirTicketResSelect() {
  343. var url = "/api/Groups/DecreasePaymentsSelect"
  344. var that = this
  345. this.$axios({
  346. method: 'post',
  347. url: url,
  348. headers: {
  349. Authorization: 'Bearer ' + this.token
  350. },
  351. data: {
  352. userId: that.userId,
  353. CTId: 98
  354. }
  355. }).then(function (res) {
  356. if (res.data.code == 200) {
  357. that.delegationInfoList = res.data.data.groupName;
  358. that.DiIdSelect = parseInt(that.DiId)
  359. for (let index = 0; index < that.delegationInfoList.length; index++) {
  360. if (that.delegationInfoList[index].id == that.DiIdSelect) {
  361. that.delegationInfo = that.delegationInfoList[index];
  362. if(res.data.data.groupName[index].teamDid==302||res.data.data.groupName[index].teamDid==691||res.data.data.groupName[index].teamDid==762||res.data.data.groupName[index].teamDid==1047){
  363. that.eventspd=true
  364. }else{
  365. that.eventspd=false
  366. }
  367. console.log(that.eventspd);
  368. break;
  369. }
  370. }
  371. that.payment = res.data.data.payment;
  372. that.suppliertype = res.data.data.supplier;
  373. that.supplierRegion = res.data.data.supplierArea;
  374. }
  375. })
  376. },
  377. QueryDecreasePaymentsById() {
  378. var url = "/api/Groups/QueryDecreasePaymentsById"
  379. var that = this
  380. this.$axios({
  381. method: 'post',
  382. url: url,
  383. headers: {
  384. Authorization: 'Bearer ' + this.token
  385. },
  386. data: {
  387. Id: that.id
  388. }
  389. }).then(function (res) {
  390. if (res.data.code == 200) {
  391. that.Decrease = res.data.data
  392. that.DecreasePaymentsData.payDId = that.Decrease.payDId
  393. that.DecreasePaymentsData.orbitalPrivateTransfer = that.Decrease.orbitalPrivateTransfer
  394. that.DecreasePaymentsData.supplierName = that.Decrease.supplierName
  395. that.DecreasePaymentsData.id = that.Decrease.id
  396. that.DecreasePaymentsData.supplierArea = that.Decrease.supplierArea
  397. that.DecreasePaymentsData.supplierTypeId = that.Decrease.supplierTypeId
  398. that.DecreasePaymentsData.supplierContact = that.Decrease.supplierContact
  399. that.DecreasePaymentsData.supplierContactNumber = that.Decrease.supplierContactNumber
  400. that.DecreasePaymentsData.quantity = that.Decrease.quantity
  401. that.DecreasePaymentsData.feeTotal = that.Decrease.feeTotal
  402. that.DecreasePaymentsData.diId = that.Decrease.diId
  403. that.DecreasePaymentsData.priceName = that.Decrease.priceName
  404. that.DecreasePaymentsData.price = that.Decrease.price
  405. that.DecreasePaymentsData.currency = that.Decrease.currency
  406. that.DecreasePaymentsData.filePath = that.Decrease.filePath
  407. that.projectName = that.Decrease.filePath
  408. that.DecreasePaymentsData.remark = that.Decrease.remark
  409. that.DecreasePaymentsData.supplierSocialAccount = that.Decrease.supplierSocialAccount
  410. that.DecreasePaymentsData.supplierAddress = that.Decrease.supplierAddress
  411. that.DecreasePaymentsData.supplierEmail = that.Decrease.supplierEmail
  412. that.DecreasePaymentsData.otherBankName = that.Decrease.otherBankName
  413. that.DecreasePaymentsData.otherSideNo = that.Decrease.otherSideNo
  414. that.DecreasePaymentsData.otherSideName = that.Decrease.otherSideName
  415. that.DecreasePaymentsData.otaOrderNo = that.Decrease.otaOrderNo
  416. that.IsAuditGM = that.Decrease.isAuditGM
  417. if (that.Decrease.filePath != null && that.Decrease.filePath != undefined && that.Decrease.filePath != "") {
  418. that.uploadFiles.push({
  419. name: that.Decrease.filePath,
  420. url: 'http://132.232.92.186:24/Office/GrpFile/团组增减款项相关文件/',
  421. })
  422. }
  423. }
  424. })
  425. },
  426. //点击保存事件
  427. addBtn:debounce(function() {
  428. console.log(this.IsAuditGM);
  429. this.DecreasePaymentsData.supplierTypeId=this.eventspd?this.DecreasePaymentsData.supplierTypeId:0;
  430. this.fullscreenLoading=true;
  431. if (this.IsAuditGM == 1) {
  432. this.fullscreenLoading=false;
  433. this.$message.error('已通过审核,不可修改!');
  434. } else {
  435. if (this.DiId == null && this.DiId == undefined && this.DiId == "") {
  436. this.fullscreenLoading=false;
  437. this.$message.error("请选择团组名称");
  438. return;
  439. }
  440. const that = this;
  441. that.$refs.DecreasePaymentsData.validate((valid) => {
  442. if (valid) {
  443. if (that.DecreasePaymentsData.filePath == that.projectName) {
  444. if (that.DelfileName != null && that.DelfileName != "" && that.DelfileName != undefined) {
  445. that.$axios({
  446. method: 'post',
  447. url: "/api/Groups/DelFile",
  448. headers: {
  449. Authorization: 'Bearer ' + that.token
  450. },
  451. data: {
  452. fileName: that.DelfileName,
  453. id: that.id
  454. }
  455. }).then(function (res) {
  456. if (res.data.code == 200) {
  457. }
  458. })
  459. }
  460. that.DecreasePaymentsData.filePath = that.projectName
  461. that.DecreasePaymentsData.diId = that.DiIdSelect;
  462. that.DecreasePaymentsData.createUserId = that.userId;
  463. that.DecreasePaymentsData.otaOrderNo=this.Switchwifi?that.DecreasePaymentsData.otaOrderNo:'';
  464. var url = "/api/Groups/OpDecreasePayments"
  465. that.$axios({
  466. method: 'post',
  467. url: url,
  468. headers: {
  469. Authorization: 'Bearer ' + that.token
  470. },
  471. data: that.DecreasePaymentsData
  472. }).then(function (res) {
  473. if (res.data.code == 200) {
  474. that.$message({
  475. message: res.data.msg,
  476. type: 'success'
  477. });
  478. setTimeout(() => {
  479. that.fullscreenLoading=false;
  480. that.quxiao()
  481. }, 1000);
  482. } else {
  483. that.fullscreenLoading=false;
  484. that.$message.error(res.data.msg);
  485. }
  486. })
  487. } else {
  488. if (that.DelfileName != null && that.DelfileName != "" && that.DelfileName != undefined) {
  489. that.$axios({
  490. method: 'post',
  491. url: "/api/Groups/DelFile",
  492. headers: {
  493. Authorization: 'Bearer ' + that.token
  494. },
  495. data: {
  496. fileName: that.DelfileName,
  497. id: that.id
  498. }
  499. }).then(function (res) {
  500. if (res.data.code == 200) {
  501. }
  502. })
  503. }
  504. if (that.projectName != "" && that.projectName != null && that.projectName != undefined) {
  505. that.$refs.upload.submit();//上传文件到服务器
  506. } else {
  507. that.DecreasePaymentsData.filePath = that.projectName
  508. that.DecreasePaymentsData.diId = that.DiIdSelect;
  509. that.DecreasePaymentsData.createUserId = that.userId;
  510. that.DecreasePaymentsData.otaOrderNo=this.Switchwifi?that.DecreasePaymentsData.otaOrderNo:'';
  511. var url = "/api/Groups/OpDecreasePayments"
  512. that.$axios({
  513. method: 'post',
  514. url: url,
  515. headers: {
  516. Authorization: 'Bearer ' + that.token
  517. },
  518. data: that.DecreasePaymentsData
  519. }).then(function (res) {
  520. if (res.data.code == 200) {
  521. that.$message({
  522. message: res.data.msg,
  523. type: 'success'
  524. });
  525. that.loading = true;
  526. setTimeout(() => {
  527. that.fullscreenLoading=false;
  528. that.$router.push('/home/DecreasePayments')
  529. }, 1000);
  530. } else {
  531. that.fullscreenLoading=false;
  532. that.$message.error(res.data.msg);
  533. }
  534. })
  535. }
  536. }
  537. } else {
  538. this.fullscreenLoading=false;
  539. this.$message.error('请完善信息在保存!');
  540. return false;
  541. }
  542. })
  543. }
  544. // 此时必填完成,做保存后的业务操作
  545. },1000,true),
  546. //取消
  547. quxiao(){
  548. this.$router.push({
  549. path: "/home/DecreasePayments",
  550. query: {
  551. DiId: this.DiIdSelect,
  552. }
  553. })
  554. },
  555. //计算总价
  556. Sumup(){
  557. this.DecreasePaymentsData.feeTotal=new Decimal(this.DecreasePaymentsData.price*this.DecreasePaymentsData.quantity).toFixed(2);
  558. },
  559. DecreasePaymentsChange() {
  560. this.QueryRate();
  561. for (let index = 0; index < this.delegationInfoList.length; index++) {
  562. if (this.delegationInfoList[index].id == parseInt(this.DiIdSelect)) {
  563. this.delegationInfo = this.delegationInfoList[index];
  564. if(this.delegationInfo.teamDid==302||this.delegationInfo.teamDid==691||this.delegationInfo.teamDid==762||this.delegationInfo.teamDid==1047){
  565. this.eventspd=true
  566. }else{
  567. this.eventspd=false
  568. }
  569. break;
  570. }
  571. }
  572. },
  573. //上传
  574. // 文件超出限制
  575. exceed(files, fileList) {
  576. this.$message.warning(
  577. `当前限制选择 1个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length
  578. } 个文件,请取消要替换的文件`
  579. );
  580. },
  581. //文件上传成功时的钩子
  582. upLoadSuccess(response, file, fileList) {
  583. if (response.code == 200) {
  584. var that = this;
  585. that.$axios({
  586. method: 'post',
  587. url: "/api/Groups/DelFile",
  588. headers: {
  589. Authorization: 'Bearer ' + that.token,
  590. TypeName: "A"
  591. },
  592. data: {
  593. fileName: that.DelfileName,
  594. id: that.id
  595. }
  596. }).then(function (res) {
  597. if (res.data.code == 200) {
  598. }
  599. })
  600. that.DecreasePaymentsData.filePath = response.data
  601. that.DecreasePaymentsData.diId = that.DiIdSelect;
  602. that.DecreasePaymentsData.createUserId = that.userId;
  603. that.DecreasePaymentsData.otaOrderNo=this.Switchwifi?that.DecreasePaymentsData.otaOrderNo:'';
  604. var url = "/api/Groups/OpDecreasePayments"
  605. that.$axios({
  606. method: 'post',
  607. url: url,
  608. headers: {
  609. Authorization: 'Bearer ' + that.token
  610. },
  611. data: that.DecreasePaymentsData
  612. }).then(function (res) {
  613. if (res.data.code == 200) {
  614. that.$message({
  615. message: res.data.msg,
  616. type: 'success'
  617. });
  618. that.loading = true;
  619. setTimeout(() => {
  620. that.$router.push('/home/DecreasePayments')
  621. }, 3000);
  622. } else {
  623. that.$message.error(res.data.msg);
  624. }
  625. })
  626. } else {
  627. that.$message.error(res.data.msg);
  628. }
  629. },
  630. //文件上传失败时的钩子
  631. upLoadError(response, file, fileList) {
  632. console.log("项目添加失败");
  633. },
  634. beforeRemove(file, fileList) {
  635. console.log(file.name)
  636. let id1 = this.uploadFiles.findIndex(item => {
  637. if (item.name == file.name) {
  638. return true
  639. }
  640. })
  641. this.uploadFiles.splice(id1, 1)
  642. this.projectName = ""
  643. this.DelfileName = file.name
  644. },
  645. onChange(file, fileList) {
  646. this.projectName = file.name
  647. },
  648. QueryRate() {
  649. var url = "/api/Business/PostGroupTeamRateByDiIdAndCTableId"
  650. var that = this
  651. this.$axios({
  652. method: 'post',
  653. url: url,
  654. headers: {
  655. Authorization: 'Bearer ' + that.token
  656. },
  657. data: {
  658. "portType": 1,
  659. "diId": this.DiIdSelect ? this.DiIdSelect : this.DiId,
  660. "cTable": 98
  661. }
  662. }).then(function (res) {
  663. if (res.data.code == 200) {
  664. //汇率
  665. console.log("汇率--", res.data.data);
  666. that.rateList = res.data.data.teamRates;
  667. }
  668. })
  669. },
  670. handleSelect(item){
  671. //console.log('handleSelect',item);
  672. var id = item.id;
  673. var that = this;
  674. try {
  675. this.queryArr.forEach((item)=>{
  676. if(item.id==id){
  677. that.DecreasePaymentsData.supplierAddress = item.supplierAddress;
  678. that.DecreasePaymentsData.supplierArea = item.supplierArea;
  679. that.DecreasePaymentsData.supplierContact = item.supplierContact;
  680. that.DecreasePaymentsData.supplierContactNumber = item.supplierContactNumber;
  681. that.DecreasePaymentsData.supplierEmail = item.supplierEmail;
  682. that.DecreasePaymentsData.supplierName = item.supplierName;
  683. that.DecreasePaymentsData.supplierSocialAccount = item.supplierSocialAccount;
  684. that.DecreasePaymentsData.supplierTypeId = item.supplierTypeId;
  685. throw new Error('stop');
  686. }
  687. })
  688. } catch (error) {
  689. if(error.message == 'stop'){
  690. return;
  691. }else{
  692. console.error(error.message);
  693. }
  694. }
  695. },
  696. querySearchAsync(queryString, cb) {
  697. var url = "/api/Groups/QueryAssociateSupplier"
  698. var that = this
  699. this.$axios({
  700. method: 'post',
  701. url: url,
  702. headers: {
  703. Authorization: 'Bearer ' + that.token
  704. },
  705. data: {
  706. "param": queryString
  707. }
  708. }).then(function (res) {
  709. if (res.data.code == 200) {
  710. cb(res.data.data.map(x=>{return{
  711. value: x.supplierName,
  712. id: x.id
  713. }}));
  714. that.queryArr = res.data.data;
  715. }
  716. })
  717. }
  718. },
  719. mounted() {
  720. this.DiId = JSON.parse(this.$route.query.DiId);
  721. this.QueryRate();
  722. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  723. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
  724. this.AirTicketResSelect();
  725. this.id = this.$route.query.id
  726. if (this.id != null && this.id != undefined && this.id != 0) {
  727. this.QueryDecreasePaymentsById();
  728. this.title = "修改其他款项";
  729. this.DecreasePaymentsData.status = 2
  730. this.isShow = true
  731. } else {
  732. this.DecreasePaymentsData.status = 1
  733. this.title = "新增其他款项"
  734. this.isShow = false
  735. }
  736. }
  737. }
  738. </script>
  739. <style>
  740. .communal-list {
  741. background-color: #fff;
  742. padding: 10px;
  743. box-shadow: 0 0 5px #0005;
  744. border-radius: 10px;
  745. }
  746. .car_add .communal-title {
  747. display: flex;
  748. font-size: 17px;
  749. font-weight: 600;
  750. color: #555;
  751. margin-bottom: 20px;
  752. justify-content: space-between;
  753. align-items: center;
  754. }
  755. .appraise-box {
  756. display: flex;
  757. flex-wrap: wrap;
  758. justify-content: space-between;
  759. margin: 50px 0;
  760. }
  761. .appraise-box>div {
  762. width: 30%;
  763. }
  764. .communal-box {
  765. display: flex;
  766. }
  767. .communal-box>button {
  768. margin-left: 10px;
  769. padding: 8px 20px;
  770. }
  771. .car_add {
  772. background-color: #fff;
  773. padding: 20px;
  774. box-shadow: 0 0 5px #0005;
  775. border-radius: 10px;
  776. min-height: 810px;
  777. }
  778. @media screen and (max-width: 1700px) {
  779. .appraise-box>div {
  780. width: 48%;
  781. }
  782. .appraise-box>div el-form-item__content {
  783. width: 260px !important;
  784. }
  785. }
  786. </style>