OpDecreasePayments.vue 42 KB

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