CarTouristGuideGrounContent.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. <template>
  2. <div class="car_add">
  3. <div>
  4. <div class="communal-title">
  5. <div>OP费用填写明细</div>
  6. </div>
  7. </div>
  8. <el-skeleton :rows="28" animated :loading="loading">
  9. <div style="display: flex;justify-content: space-between;">
  10. <div style="width: 80%;display: flex;">
  11. <div style="width: 25%;">
  12. <el-select v-model="diId" placeholder="团组选择" clearable filterable style="width: 100%;"
  13. :disabled="true">
  14. <el-option v-for="item in delegationInfoList" :key="item.id" :label="item.teamName"
  15. :value="item.id">
  16. </el-option>
  17. </el-select>
  18. </div>
  19. <div style="width: 25%;">
  20. <el-select v-model="currency" placeholder="币种选择" clearable filterable style="width: 80%;">
  21. <el-option v-for="item in currencyList" :key="item.id"
  22. :label="item.name + '(' + item.remark + ')'" :value="item.id">
  23. </el-option>
  24. </el-select>
  25. </div>
  26. </div>
  27. </div>
  28. <div style="margin:10px 0;color:#606266;font-size:12px;">
  29. <span style="font-weight: bold;font-size:12px;">团队名称:</span>
  30. <span style="color:#606266;">{{ delegationInfo.teamName }}&nbsp;&nbsp;&nbsp;</span>
  31. <span style="font-weight: bold;font-size:12px;">客户:</span>
  32. <span style="color:#606266;font-size:12px;">{{ delegationInfo.clientName }}&nbsp;&nbsp;&nbsp; </span>
  33. <span style="font-weight: bold;font-size:12px;">出访国家:</span>
  34. <span style="color:#606266;font-size:12px;">{{ delegationInfo.visitCountry }}&nbsp;&nbsp;&nbsp;</span>
  35. <span style="font-weight: bold;font-size:12px;">起止日期:</span>
  36. <span style="color:#606266;font-size:12px;">{{ delegationInfo.visitDate }}&nbsp;&nbsp;&nbsp;</span>
  37. <span style="font-weight: bold;font-size:12px;">天数/人数:</span>
  38. <span style="color:#606266;font-size:12px;">{{ delegationInfo.visitDays }}天/{{
  39. delegationInfo.visitPNumber }}人</span>
  40. </div>
  41. <hr style='background-color:#5555; height:1px; border:none;' />
  42. <div>
  43. <template>
  44. <el-table :data="ContentList" border style="width: 100%">
  45. <el-table-column prop="num" label="序 号" width="55">
  46. <template slot-scope="scope">
  47. {{ scope.$index + 1 }}
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="SIdName" label="费用项目" width="100">
  51. <template slot-scope="scope">
  52. <span style="display: none;">{{ scope.row.sId }}</span>{{ scope.row.sIdName }}
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="金额/币种" width="400">
  56. <template slot-scope="scope">
  57. <el-input placeholder="请输入金额" v-model="scope.row.price" clearable style="width:180px;"
  58. @change="PriceChange" />
  59. <el-select v-model="currency" placeholder="币种选择" clearable filterable style="width:120px"
  60. :disabled="true">
  61. <el-option v-for="item in currencyList" :key="item.id" :label="item.name"
  62. :value="item.id">
  63. </el-option>
  64. </el-select>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="费用明细">
  68. <template slot-scope="scope">
  69. <el-input type="textarea" :rows="1" placeholder="费用明细"
  70. v-model="scope.row.priceContent"></el-input>
  71. </template>
  72. </el-table-column>
  73. <!-- <el-table-column label="备注">
  74. <template slot-scope="scope">
  75. <el-input type="textarea" :rows="1" placeholder="备注" v-model="scope.row.remark"></el-input>
  76. </template>
  77. </el-table-column> -->
  78. </el-table>
  79. <hr style='background-color:#5555; height:1px; border:none;' />
  80. <el-form :model="OPContenData" ref="OPContenData" :rules="OPContenDataRules" label-width="100px"
  81. class="demo-ruleForm">
  82. <div style="display: flex;">
  83. <div style="width: 25%;">
  84. <el-form-item label="此次付款百分比:" prop="payPercentage" label-width="160px">
  85. <el-input placeholder="此次付款百分比" v-model="OPContenData.payPercentage">
  86. <template slot="append">%</template>
  87. </el-input>
  88. </el-form-item>
  89. </div>
  90. <div style="width: 25%;">
  91. <el-form-item label="收款方:" prop="payee" label-width="160px">
  92. <el-input placeholder="收款方" v-model="OPContenData.payee">
  93. </el-input>
  94. </el-form-item>
  95. </div>
  96. <div style="width: 25%;">
  97. <el-form-item label="费用表示:" prop="orbitalPrivateTransfer" label-width="160px">
  98. <el-select v-model="OPContenData.orbitalPrivateTransfer" clearable filterable
  99. placeholder="费用标识" style="width: 220px;">
  100. <el-option :key=0 :value="0" label="公转"></el-option>
  101. <el-option :key=1 :value="1" label="私转"></el-option>
  102. </el-select>
  103. </el-form-item>
  104. </div>
  105. <div style="width: 25%;">
  106. <el-form-item label="支付方式:" prop="payDId" label-width="160px">
  107. <el-select v-model="OPContenData.payDId" placeholder="支付方式" clearable filterable
  108. style="width:120px">
  109. <el-option v-for="item in payment" :key="item.id" :label="item.name"
  110. :value="item.id">
  111. </el-option>
  112. </el-select>
  113. </el-form-item>
  114. </div>
  115. </div>
  116. <div style="display: flex;">
  117. <div style="width: 50%;">
  118. <el-form-item label="总金额:" label-width="160px">
  119. <el-input placeholder="金额" v-model="countCost" :disabled="true"
  120. style="width: 120px;"></el-input>
  121. <el-select v-model="currency" placeholder="币种选择" clearable filterable
  122. style="width:120px" :disabled="true">
  123. <el-option v-for="item in currencyList" :key="item.id" :label="item.name"
  124. :value="item.id">
  125. </el-option>
  126. </el-select>
  127. </el-form-item>
  128. </div>
  129. <div style="width: 50%;text-align: right;">
  130. <el-form-item>
  131. <div style="margin-right: 25%;">
  132. <el-button type="primary" @click="addBtn">保存</el-button>
  133. <el-button @click="EscAdd">取消</el-button>
  134. </div>
  135. </el-form-item>
  136. </div>
  137. </div>
  138. </el-form>
  139. </template>
  140. </div>
  141. </el-skeleton>
  142. </div>
  143. </template>
  144. <script>
  145. import { dE } from '@fullcalendar/core/internal-common'
  146. export default {
  147. data() {
  148. return {
  149. token: '',
  150. userId: 0,
  151. id: '',
  152. diId: '',
  153. loading: true,
  154. currency: 836,
  155. countCost: 0,
  156. delegationInfo: {},
  157. delegationInfoList: [],//团组下拉框
  158. currencyList: [],
  159. tableInitialization: [],
  160. payment: [],
  161. IsAuditGM: 0,
  162. ContentList: [],
  163. OPContenData: {
  164. diId: '',
  165. cTGGRId: '',
  166. orbitalPrivateTransfer: 0,
  167. payPercentage: '80',
  168. payee: '',
  169. payDId: '',
  170. currency: '',
  171. OPContentList: [],
  172. CreateUserId: 0
  173. },
  174. OPContenDataRules: {
  175. payPercentage: [
  176. { required: true, message: '请输入付款百分比', trigger: ['blur', 'change'] },
  177. ],
  178. orbitalPrivateTransfer: [
  179. { required: true, message: '请选择费用标识', trigger: ['blur', 'change'] },
  180. ],
  181. payee: [
  182. { required: true, message: '请输入收款方', trigger: ['blur', 'change'] },
  183. ],
  184. payDId: [
  185. { required: true, message: '请选择付款方式', trigger: ['blur', 'change'] },
  186. ]
  187. },
  188. }
  189. },
  190. methods: {
  191. //初始化下拉框
  192. initializeSelect() {
  193. //团组下拉框绑定
  194. var url = "/api/Groups/CarTouristGuideGroundContentInitialize"
  195. var that = this
  196. this.$axios({
  197. method: 'post',
  198. url: url,
  199. headers: {
  200. Authorization: 'Bearer ' + this.token
  201. },
  202. data: {
  203. userId: that.userId,
  204. }
  205. }).then(function (res) {
  206. if (res.data.code == 200) {
  207. debugger
  208. that.delegationInfoList = res.data.data.delegations;
  209. for (let index = 0; index < that.delegationInfoList.length; index++) {
  210. debugger
  211. if (that.delegationInfoList[index].id == that.diId) {
  212. that.delegationInfo = that.delegationInfoList[index];
  213. break;
  214. }
  215. }
  216. that.currencyList = res.data.data.currencyList;
  217. debugger
  218. that.tableInitialization = res.data.data.tableInitialization;
  219. that.tableInitialization.forEach(function (item) {
  220. that.ContentList.push({
  221. id: 0,
  222. sId: item.id,
  223. sIdName: item.name,
  224. price: '0.00',
  225. priceContent: '',
  226. //remark: '',
  227. })
  228. });
  229. that.payment = res.data.data.payment;
  230. that.OpCarTouristGuideGroundContenById()
  231. }
  232. })
  233. },
  234. OpCarTouristGuideGroundContenById() {
  235. var url = "/api/Groups/OpCarTouristGuideGroundContentById"
  236. var that = this
  237. this.$axios({
  238. method: 'post',
  239. url: url,
  240. headers: {
  241. Authorization: 'Bearer ' + this.token
  242. },
  243. data: {
  244. id: that.id
  245. }
  246. }).then(function (res) {
  247. if (res.data.code == 200) {
  248. debugger
  249. var CreditCardPayment = res.data.data.creditCardPayment;
  250. if (CreditCardPayment != null) {
  251. that.OPContenData.payDId = CreditCardPayment.payDId
  252. that.OPContenData.payee = CreditCardPayment.payee
  253. that.currency = CreditCardPayment.paymentCurrency
  254. that.OPContenData.payPercentage = CreditCardPayment.payPercentage
  255. that.countCost = CreditCardPayment.payMoney
  256. that.OPContenData.orbitalPrivateTransfer = CreditCardPayment.orbitalPrivateTransfer
  257. }
  258. var CarTouristsContent = res.data.data.carTouristsContent;
  259. if (CarTouristsContent.length != 0) {
  260. CarTouristsContent.forEach(function (item) {
  261. that.ContentList.forEach(function (item1) {
  262. if (item.sId == item1.sId) {
  263. item1.id = item.id
  264. item1.price = item.price
  265. item1.priceContent = item.priceContent
  266. //item1.remark = item.remark
  267. }
  268. })
  269. })
  270. }
  271. that.loading = false
  272. }
  273. })
  274. },
  275. addBtn() {
  276. if (this.IsAuditGM == 1) {
  277. this.$message.error('已通过审核,不可修改!');
  278. } else {
  279. debugger
  280. if (this.diId == null && this.diId == undefined && this.diId == "") {
  281. this.$message.error("请选择团组名称");
  282. return;
  283. } else {
  284. var that = this
  285. that.$refs.OPContenData.validate((valid) => {
  286. if (valid) {
  287. that.OPContenData.diId = that.diId
  288. that.OPContenData.cTGGRId = that.id
  289. that.OPContenData.currency = that.currency
  290. that.OPContenData.CreateUserId = that.userId
  291. that.ContentList.forEach(function (item) {
  292. that.OPContenData.OPContentList.push({
  293. id: item.id,
  294. sId: item.sId,
  295. price: item.price,
  296. priceContent: item.priceContent,
  297. //remark: item.remark,
  298. })
  299. })
  300. var url = "/api/Groups/OpCarTouristGuideGroundContent"
  301. that.$axios({
  302. method: 'post',
  303. url: url,
  304. headers: {
  305. Authorization: 'Bearer ' + that.token
  306. },
  307. data: that.OPContenData
  308. }).then(function (res) {
  309. if (res.data.code == 200) {
  310. that.$message({
  311. message: res.data.msg,
  312. type: 'success'
  313. });
  314. } else {
  315. that.$message.error(res.data.msg);
  316. }
  317. })
  318. } else {
  319. this.$message.error('请完善信息在保存!');
  320. return false;
  321. }
  322. })
  323. }
  324. }
  325. },
  326. EscAdd() {
  327. this.$router.push({
  328. path: "/home/CarTouristGuideGroundId",
  329. query: {
  330. diId: this.diId
  331. }
  332. })
  333. },
  334. PriceChange() {
  335. var countCost = 0;
  336. this.ContentList.forEach(function (item) {
  337. if (item.price != '') {
  338. countCost += parseFloat(item.price)
  339. }
  340. })
  341. this.countCost = countCost
  342. }
  343. },
  344. mounted() {
  345. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  346. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
  347. this.id = this.$route.query.id
  348. this.diId = parseInt(this.$route.query.diId)
  349. this.initializeSelect();
  350. //this.OpCarTouristGuideGroundContenById();
  351. }
  352. }
  353. </script>
  354. <style>
  355. .communal-list {
  356. background-color: #fff;
  357. padding: 10px;
  358. box-shadow: 0 0 5px #0005;
  359. border-radius: 10px;
  360. }
  361. .car_add .communal-title {
  362. display: flex;
  363. font-size: 17px;
  364. font-weight: 600;
  365. color: #555;
  366. margin-bottom: 20px;
  367. justify-content: space-between;
  368. align-items: center;
  369. }
  370. .appraise-box {
  371. display: flex;
  372. flex-wrap: wrap;
  373. justify-content: space-between;
  374. margin: 50px 0;
  375. }
  376. .appraise-box>div {
  377. width: 30%;
  378. }
  379. .communal-box {
  380. display: flex;
  381. }
  382. .communal-box>button {
  383. margin-left: 10px;
  384. padding: 8px 20px;
  385. }
  386. .car_add {
  387. background-color: #fff;
  388. padding: 20px;
  389. box-shadow: 0 0 5px #0005;
  390. border-radius: 10px;
  391. }
  392. @media screen and (max-width: 1700px) {
  393. .appraise-box>div {
  394. width: 48%;
  395. }
  396. .appraise-box>div el-form-item__content {
  397. width: 260px !important;
  398. }
  399. }
  400. </style>