移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

approvalList13.vue 6.7 KiB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="$router.back(-1)"
  8. @click-right="goAdd()"
  9. >
  10. <template #title>
  11. <p style="font-weight: bold;">重大事项</p>
  12. </template>
  13. <template #right>
  14. <van-icon name="add" size="18"/>
  15. </template>
  16. </van-nav-bar>
  17. <van-list
  18. v-model="loading"
  19. :finished="finished"
  20. finished-text="没有更多了"
  21. @load="getList"
  22. >
  23. <van-swipe-cell v-for="(item,index) in applicationList" :key="index">
  24. <van-cell :title="item.eventName" :value="item.auditStatus" center :to="{name:'approvalDetail13', query: {id:item.id}}">
  25. <template #icon>
  26. <van-icon name="../../../../../static/images/onlineHome/icon_yn3.png" size="30" color="#539FFD" style="margin-right: 10px;" />
  27. </template>
  28. <template #label>
  29. <p>{{item.eventTime}}</p>
  30. </template>
  31. </van-cell>
  32. <template #right>
  33. <van-row>
  34. <van-col>
  35. <van-button v-if="item.auditStatus=='草稿'||item.auditStatus=='驳回'" square text="修改" type="info" :to="{name:'approvalModify13', query: {id:item.id}}" class="delete-button" />
  36. </van-col>
  37. <van-col>
  38. <van-button v-if="item.auditStatus=='草稿'||item.auditStatus=='驳回'" color="#FFA63E" square text="提交" type="info" @click="onSubmit(item.id)" class="delete-button" />
  39. </van-col>
  40. <van-col>
  41. <van-button v-if="item.auditStatus=='草稿'||item.auditStatus=='驳回'" square text="删除" type="danger" @click="deleteList(item.id,index)" class="delete-button" />
  42. </van-col>
  43. <van-col>
  44. <van-button v-if="item.auditStatus=='草稿'||item.auditStatus=='驳回'" square text="附件" style="background-color: rgb(98,173,102,0.2);color: #62AD66;" @click="openLoader(item.id,index)" class="delete-button" />
  45. </van-col>
  46. </van-row>
  47. </template>
  48. </van-swipe-cell>
  49. </van-list>
  50. <van-popup v-model="show" lock-scroll closeable position="top" :style="{ height: '30%' }" >
  51. <div style="padding: 0 13% 0 5%;">
  52. <van-divider>附件</van-divider>
  53. <van-uploader v-model="fileList" :after-read="afterRead" @delete="deleteFile1" multiple />
  54. </div>
  55. </van-popup>
  56. </div>
  57. </template>
  58. <script>
  59. import { delMajorevent , customSubmitMajorevent , delTransfer , listMajorevent } from "@/api/onlineHome/bankAgriculture/paymentApproval";
  60. import {attachmentList, commonAttach, systemAttachment} from "@/api/sunVillage_info/fixedAssets";
  61. import request from "@/utils/request";
  62. export default {
  63. name: "approvalList3",
  64. data() {
  65. return {
  66. applicationList:[],
  67. auditStatusOptions:[],
  68. loading: false,
  69. finished: false,
  70. queryParams:{
  71. pageNum:1,
  72. pageSize:10,
  73. transferType:"3",
  74. },
  75. show: false,
  76. fileList:[],
  77. uploadFiles1:[],
  78. projectId:'',
  79. projectIndex:''
  80. };
  81. },
  82. created() {
  83. this.getDicts("audit_status").then((response) => {
  84. this.auditStatusOptions = response.data;
  85. });
  86. },
  87. methods: {
  88. goAdd(){
  89. window.location = 'approvalAdd13';
  90. },
  91. getList(){
  92. setTimeout(() => {
  93. listMajorevent(this.queryParams).then(response => {
  94. console.log(response)
  95. for (var i = 0; i < response.rows.length; i++) {
  96. response.rows[i].auditStatus = this.selectDictLabel(this.auditStatusOptions, response.rows[i].auditStatus);
  97. this.applicationList.push(response.rows[i]);
  98. }
  99. if(this.applicationList.length >= response.total){
  100. this.finished = true;
  101. return;
  102. }else{
  103. this.loading = false;
  104. this.queryParams.pageNum += 1 ;
  105. }
  106. });
  107. }, 1000);
  108. },
  109. openLoader(id,index){
  110. this.show = true;
  111. this.projectId = id;
  112. this.projectIndex = index;
  113. this.fileList = [];
  114. let oData1= {
  115. tableId: id,
  116. tableName: "t_yinnong_transfer",
  117. bizPath: "transfer",
  118. fileType: '',
  119. }
  120. attachmentList(oData1).then(res => {
  121. res.rows.map(r => {
  122. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  123. this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  124. })
  125. })
  126. },
  127. deleteList(id,index){
  128. this.$dialog.confirm({
  129. message: '您确认删除草稿?',
  130. })
  131. .then(() => {
  132. // on confirm
  133. this.applicationList.splice(index,1)
  134. delMajorevent(id).then(res => {
  135. if(res.code = 200){
  136. this.$toast.success('删除成功');
  137. }
  138. });
  139. })
  140. .catch(() => {
  141. // on cancel
  142. });
  143. },
  144. onSubmit(id){
  145. this.$dialog.confirm({
  146. message: '您确认提交草稿?',
  147. })
  148. .then(() => {
  149. customSubmitMajorevent(id).then(res => {
  150. this.$toast.success('提交成功');
  151. setTimeout(function(){
  152. history.go(0)
  153. },2000)
  154. })
  155. })
  156. .catch(() => {
  157. // on cancel
  158. });
  159. },
  160. afterRead(file) {
  161. // 此时可以自行将文件上传至服务器
  162. this.uploadFiles1.push(file.file);
  163. let params1 = new FormData();
  164. params1.append("tableId", this.projectId);
  165. params1.append("tableName", "t_yinnong_transfer");
  166. params1.append("bizPath", "transfer");
  167. params1.append("fileType", 'bookkeeping_type');
  168. params1.append("file", file.file);
  169. commonAttach(params1).then((r1) => {
  170. this.$notify({ type: 'success', message: '上传成功' });
  171. })
  172. },
  173. deleteFile1(file){
  174. console.log(file)
  175. systemAttachment(file.id).then(res => {
  176. this.$notify({ type: 'success', message: '删除成功' });
  177. })
  178. },
  179. },
  180. }
  181. </script>
  182. <style scoped lang="scss">
  183. .app-container {
  184. padding: 0.2rem 3%;
  185. }
  186. /deep/.van-cell__title{
  187. flex: 0.7;
  188. }
  189. /deep/.van-cell__title span{
  190. font-family: Arial;
  191. font-size: 0.4rem;
  192. font-weight: normal;
  193. }
  194. /deep/.van-cell__label span{
  195. color: #1D6FE9;
  196. font-weight: bold;
  197. i{
  198. font-size: 0.2rem;
  199. }
  200. }
  201. /deep/.van-cell__value{
  202. flex: 0.3;
  203. color: #1D6FE9;
  204. font-weight: bold;
  205. }
  206. /deep/.van-swipe-cell{
  207. margin-bottom: 0.2rem;
  208. border-radius: 0.2rem;
  209. overflow: hidden;
  210. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  211. }
  212. /deep/van-ellipsis{
  213. font-weight: bold;
  214. }
  215. .van-row{
  216. height: 100%;
  217. }
  218. .van-col{
  219. height: 100%;
  220. }
  221. .delete-button {
  222. height: 100%;
  223. }
  224. </style>