grainPulseDynamic.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. <!--粮脉动态审核-->
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="15">
  5. <template slot="right">
  6. <ws-select v-model="searchTypeText" placeholder="" class="typeselect" @change="selectExamineType"
  7. :value="searchType">
  8. <ws-option v-for="item in searchTypeList" :key="item.value" :label="item.value" :value="item.value"
  9. style="color: #8890b1" />
  10. </ws-select>
  11. <ws-input class='findinput' v-model="searchKeyWord" placeholder="可按账号、发布主体查找" clearable maxlength="500"
  12. @keyup.enter.native="lookUp()" type="input"></ws-input>
  13. <ws-button class="find" type="primary" @click="lookUp()"><img width="16" height="16" style="
  14. vertical-align: text-top;
  15. position: relative;
  16. top: 0px;
  17. left: -8px;
  18. " src="../../../public/img/sousuo.png" alt="" /></ws-button>
  19. <!-- </div> -->
  20. </template>
  21. </BaseHeaderLayout>
  22. <el-table class="wenzi" :data="dynamicsList.records" style="width: 100%" height="calc(100% - 110px)">
  23. <el-table-column type="index" label="序号" width="50">
  24. <template scope="scope">
  25. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  26. <span v-else>{{ scope.$index + 1 }}</span>
  27. </template>
  28. </el-table-column>
  29. <el-table-column prop="userName" label="昵称"> </el-table-column>
  30. <el-table-column prop="phone" label="账号"></el-table-column>
  31. <el-table-column prop="compName" label="发布主体"> </el-table-column>
  32. <el-table-column prop="title" label="标题"> </el-table-column>
  33. <el-table-column prop="updateDate" label="更新时间" width="140">
  34. </el-table-column>
  35. <el-table-column prop="" label="操作" width="180">
  36. <template slot-scope="scope">
  37. <div class="record" @click="nocomplete(scope.row)"
  38. v-hasPermission="`audit.tranMerchant.tranMerchantInfo.view`">
  39. 查看
  40. </div>
  41. <div class="record" @click="deleteclick(scope.row)"
  42. v-hasPermission="`audit.tranMerchant.tranMerchantInfo.view`">
  43. 删除
  44. </div>
  45. </template>
  46. </el-table-column>
  47. <el-table-column prop="address" label="审核">
  48. <!-- class="record"
  49. class="record" -->
  50. <template slot-scope="scope">
  51. <div class="record" v-if="scope.row.statusFlag == 1" @click="rejectList(scope.row)">
  52. 驳回
  53. </div>
  54. <div class="record" v-if="scope.row.statusFlag == 1" @click="adoptList(scope.row)"
  55. v-hasPermission="`audit.tranMerchant.tranMerchantInfo.view`">
  56. 通过
  57. </div>
  58. <template v-else v-hasPermission="`audit.tranMerchant.tranMerchantInfo.view`" slot-scope="scope">
  59. {{ scope.row.status }}
  60. </template>
  61. </template>
  62. </el-table-column>
  63. </el-table>
  64. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  65. :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper"
  66. :total="deptBudgetTotal">
  67. </el-pagination>
  68. <!--动态信息-->
  69. <el-dialog width="40%" title="查看动态信息" :visible.sync="dialogFormVisible" :append-to-body="true">
  70. <el-form class="customer" :model="form">
  71. <el-form-item label="发布主体" :label-width="formLabelWidth">
  72. {{ SettledCompanyDynamicsList.compName }}
  73. </el-form-item>
  74. <el-form-item label="标题" :label-width="formLabelWidth">
  75. {{ SettledCompanyDynamicsList.title }}
  76. </el-form-item>
  77. <el-form-item label="内容" :label-width="formLabelWidth">
  78. {{ SettledCompanyDynamicsList.content }}
  79. </el-form-item>
  80. <el-form-item label="定位" :label-width="formLabelWidth">
  81. {{ SettledCompanyDynamicsList.city }}
  82. </el-form-item>
  83. <el-form-item label="附件" :label-width="formLabelWidth">
  84. <div :key="index" v-for="(item, index) in SettledCompanyDynamicsList.address">
  85. <img style="float:left" v-if="item" :src="item" class="avatar">
  86. </div>
  87. </el-form-item>
  88. </el-form>
  89. <div slot="footer" class="dialog-footer">
  90. <span v-if="SettledCompanyDynamicsList.statusFlag == '1'">
  91. <el-button @click="reject(id)">驳回</el-button>
  92. <el-button @click="adopt(id)">通过</el-button>
  93. </span>
  94. <span v-else-if="SettledCompanyDynamicsList.statusFlag != '1'">
  95. <el-button @click="dialogFormVisible = fase">关闭</el-button>
  96. </span>
  97. </div>
  98. </el-dialog>
  99. </div>
  100. </template>
  101. <script>
  102. import {
  103. dynamicsList,
  104. dynamicsLook,
  105. dynamicsDelete,
  106. dynamicsExamine,
  107. } from '@/model/platformaudit/index'
  108. import Pagination from '@/components/Pagination'
  109. import WsUpload from '@/components/WsUpload'
  110. import {
  111. EventBus
  112. } from 'base-core-lib'
  113. export default {
  114. name: 'viewSpareMoney',
  115. components: {
  116. WsUpload,
  117. Pagination,
  118. },
  119. watch: {
  120. vesselId(val) {
  121. this.getList()
  122. },
  123. isShow(val) {
  124. this.showType = val
  125. },
  126. },
  127. data() {
  128. return {
  129. //弹出框
  130. dialogFormVisible: false,
  131. dialogViewSpareMoney: false,
  132. // 表格显示数据
  133. tableDate: [],
  134. wrapstatus: false,
  135. // 是否显示
  136. showType: true,
  137. // 年
  138. year: '',
  139. currentPage: 1,
  140. pageSize: 10,
  141. deptBudgetTotal: 0,
  142. searchTypeText: '待审核',
  143. searchKeyWord: '',
  144. imgUrl: '',
  145. // 提交类型
  146. submitType: true,
  147. size: 10,
  148. spanArr: [],
  149. searchType: 1,
  150. compId: localStorage.getItem('ws-pf_compId'),
  151. deptCircularPage: {},
  152. dynamicsList: [],
  153. pcFlag: 1,
  154. formLabelWidth: '120px',
  155. form: {},
  156. SettledCompanyDynamicsList: {
  157. compName: '',
  158. title: '',
  159. content: '',
  160. address: '',
  161. city: '',
  162. },
  163. deptBudgetList: {},
  164. searchTypeList: [{
  165. value: '待审核',
  166. type: 1
  167. },
  168. {
  169. value: '已通过',
  170. type: 2
  171. },
  172. {
  173. value: '全部',
  174. type: ''
  175. },
  176. ],
  177. settledCompanyDynamicsInfo: {
  178. id: '',
  179. flag: '',
  180. },
  181. accessoryTFs: false,
  182. }
  183. },
  184. activated() {
  185. this.getList()
  186. this.showType = this.isShow
  187. },
  188. methods: {
  189. getSpanArr(data) {
  190. let that = this
  191. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  192. that.spanArr = []
  193. that.pos = 0
  194. //遍历数据
  195. data.forEach((item, index) => {
  196. //判断是否是第一项
  197. // if (index === 0) {
  198. // this.spanArr.push(1)
  199. // this.pos = 0
  200. // } else {
  201. //不是第一项时,就根据标识去存储
  202. if (data[index].warehouseNumViewList.length > 1) {
  203. // 查找到符合条件的数据时每次要把之前存储的数据+1
  204. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  205. this.spanArr.push(0)
  206. } else {
  207. // 没有符合的数据时,要记住当前的index
  208. this.spanArr.push(1)
  209. this.pos = index
  210. }
  211. // }
  212. })
  213. },
  214. // close(index) {
  215. // this.addressUrls.splice(index, 1)
  216. // },
  217. //删除
  218. deleteclick(row) {
  219. this.$confirm(`动态信息删除后不可恢复,是否确定删除?`, {
  220. confirmButtonText: '确定',
  221. cancelButtonText: '取消',
  222. type: 'warning',
  223. })
  224. .then(() => {
  225. dynamicsDelete({
  226. id: row.id,
  227. })
  228. .toPromise()
  229. .then((response) => {
  230. this.getList()
  231. })
  232. })
  233. .catch(() => {
  234. return false
  235. })
  236. },
  237. //查看//传参
  238. nocomplete(row) {
  239. dynamicsLook({
  240. id: row.id,
  241. })
  242. .toPromise()
  243. .then((response) => {
  244. this.SettledCompanyDynamicsList = response
  245. if (response.address != null) {
  246. this.SettledCompanyDynamicsList.address = response.address.split(',')
  247. }
  248. this.id = response.id
  249. })
  250. this.dialogFormVisible = true
  251. },
  252. //查找
  253. lookUp() {
  254. this.currentPage = 1
  255. this.getList()
  256. },
  257. selectExamineType(e) {
  258. for (var i = 0; i < this.searchTypeList.length; i++) {
  259. if (this.searchTypeList[i].value == e) {
  260. this.searchType = this.searchTypeList[i].type
  261. }
  262. }
  263. this.currentPage = 1
  264. this.getList()
  265. },
  266. //审核通过
  267. adopt(id) {
  268. this.settledCompanyDynamicsInfo.flag = 1
  269. this.settledCompanyDynamicsInfo.id = id
  270. this.$confirm(`确定通过该动态信息?`, '提示', {
  271. confirmButtonText: '通过',
  272. cancelButtonText: '取消',
  273. type: 'warning',
  274. })
  275. .then(() => {
  276. dynamicsExamine(this.settledCompanyDynamicsInfo)
  277. .toPromise()
  278. .then((response) => {
  279. this.$notify.success({
  280. title: '成功',
  281. message: '通过成功',
  282. })
  283. this.dialogFormVisible = false
  284. this.getList()
  285. })
  286. .catch((response) => {
  287. EventBus.$emit('error', response.message)
  288. })
  289. })
  290. .catch(() => {
  291. return false
  292. })
  293. },
  294. //列表审核通过
  295. adoptList(row) {
  296. this.settledCompanyDynamicsInfo.flag = 1
  297. this.settledCompanyDynamicsInfo.id = row.id
  298. this.$confirm(`确定通过该动态信息?`, '提示', {
  299. confirmButtonText: '通过',
  300. cancelButtonText: '取消',
  301. type: 'warning',
  302. })
  303. .then(() => {
  304. dynamicsExamine(this.settledCompanyDynamicsInfo)
  305. .toPromise()
  306. .then((response) => {
  307. this.$notify.success({
  308. title: '成功',
  309. message: '通过成功',
  310. })
  311. this.getList()
  312. })
  313. .catch((response) => {
  314. EventBus.$emit('error', response.message)
  315. })
  316. })
  317. .catch(() => {
  318. return false
  319. })
  320. },
  321. //审核驳回
  322. reject(id) {
  323. this.settledCompanyDynamicsInfo.flag = 2
  324. this.settledCompanyDynamicsInfo.id = id
  325. this.$confirm(`确定驳回该动态信息?`, '提示', {
  326. confirmButtonText: '驳回',
  327. cancelButtonText: '取消',
  328. type: 'warning',
  329. })
  330. .then(() => {
  331. dynamicsExamine(this.settledCompanyDynamicsInfo)
  332. .toPromise()
  333. .then((response) => {
  334. this.$notify.success({
  335. title: '成功',
  336. message: '驳回成功',
  337. })
  338. this.dialogFormVisible = false
  339. this.getList()
  340. })
  341. .catch((response) => {
  342. console.log(response)
  343. EventBus.$emit('error', response.message)
  344. })
  345. })
  346. .catch(() => {
  347. return false
  348. })
  349. },
  350. //列表审核驳回
  351. rejectList(row) {
  352. this.settledCompanyDynamicsInfo.flag = 2
  353. this.settledCompanyDynamicsInfo.id = row.id
  354. this.$confirm(`确定驳回该动态信息?`, '提示', {
  355. confirmButtonText: '驳回',
  356. cancelButtonText: '取消',
  357. type: 'warning',
  358. })
  359. .then(() => {
  360. dynamicsExamine(this.settledCompanyDynamicsInfo)
  361. .toPromise()
  362. .then((response) => {
  363. this.$notify.success({
  364. title: '成功',
  365. message: '驳回成功',
  366. })
  367. this.getList()
  368. })
  369. .catch((response) => {
  370. console.log(response)
  371. EventBus.$emit('error', response.message)
  372. })
  373. })
  374. .catch(() => {
  375. return false
  376. })
  377. },
  378. dateFormat(fmt, date) {
  379. let ret
  380. const opt = {
  381. 'Y+': date.getFullYear().toString(), // 年
  382. 'm+': (date.getMonth() + 1).toString(), // 月
  383. 'd+': date.getDate().toString(), // 日
  384. 'H+': date.getHours().toString(), // 时
  385. // "M+": date.getMinutes().toString(), // 分
  386. // "S+": date.getSeconds().toString() // 秒
  387. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  388. }
  389. for (let k in opt) {
  390. ret = new RegExp('(' + k + ')').exec(fmt)
  391. if (ret) {
  392. fmt = fmt.replace(
  393. ret[1],
  394. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  395. )
  396. }
  397. }
  398. return fmt
  399. },
  400. handleClose() {
  401. this.accessoryTFs = false
  402. },
  403. handleSizeChange(val) {
  404. console.log(`每页 ${val} 条`)
  405. this.pageSize = val
  406. this.getList()
  407. },
  408. handleCurrentChange(val) {
  409. this.currentPage = val
  410. console.log(`当前页: ${val}`)
  411. this.getList()
  412. },
  413. //粮脉动态列表
  414. getList() {
  415. dynamicsList({
  416. searchType: this.searchType,
  417. // phone: this.phone,
  418. pcFlag: this.pcFlag,
  419. currentPage: this.currentPage,
  420. pageSize: this.pageSize,
  421. searchKeyWord: this.searchKeyWord,
  422. })
  423. .toPromise()
  424. .then((response) => {
  425. this.dynamicsList = response
  426. this.deptCircularPage.currentPage = response.current
  427. this.deptCircularPage.pageSize = response.size
  428. this.deptBudgetTotal = response.total
  429. })
  430. },
  431. // 关闭 dialog时 处理文件url 初始化upload组件
  432. handleCloe() {
  433. this.dialogViewSpareMoney = false
  434. },
  435. },
  436. }
  437. </script>
  438. <style lang="scss" scoped>
  439. .container {
  440. width: 100%;
  441. margin: 0 auto;
  442. }
  443. .vertical-text-left {
  444. width: 62px;
  445. text-align: right;
  446. }
  447. .el-button--primary {
  448. background-color: #5878e8;
  449. border-color: #5878e8;
  450. }
  451. .el-button--default {
  452. color: #8890b1;
  453. border-color: #e8eaf1;
  454. }
  455. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  456. width: 30px;
  457. margin-left: 0;
  458. border-top-left-radius: 0px;
  459. border-bottom-left-radius: 0px;
  460. }
  461. /deep/.findValue .el-input__inner {
  462. border-top-right-radius: 0px;
  463. border-bottom-right-radius: 0px;
  464. }
  465. //操作按钮
  466. .record,
  467. .adjustment {
  468. display: inline-block;
  469. color: #5878e8;
  470. padding: 0 4px !important;
  471. position: relative;
  472. font-size: 14px;
  473. }
  474. .record:after {
  475. position: absolute;
  476. content: '';
  477. display: block;
  478. top: 5px;
  479. right: -2px;
  480. width: 1px;
  481. height: 12px;
  482. background: #e9ecf7;
  483. }
  484. //状态样式
  485. .executory,
  486. .inExecution,
  487. .done {
  488. width: 6px;
  489. height: 6px;
  490. display: inline-block;
  491. border-radius: 50%;
  492. position: relative;
  493. top: -1px;
  494. font-size: 14px;
  495. }
  496. .executory {
  497. background: #ff9f24;
  498. }
  499. .inExecution {
  500. background: #5878e8;
  501. }
  502. .done {
  503. background: #50cad4;
  504. }
  505. .putstorage.el-button--default,
  506. .deliverystorage.el-button--default {
  507. border-color: #8890b1;
  508. background-color: #fff;
  509. color: #8890b1;
  510. }
  511. /deep/.el-table td,
  512. /deep/.el-table th.is-leaf {
  513. border-right: 1px solid #e9ecf7;
  514. text-align: center;
  515. }
  516. /deep/.el-table tr td:first-child,
  517. /deep/.el-table tr th.is-leaf:first-child {
  518. border-left: 1px solid #e9ecf7;
  519. }
  520. .el-row {
  521. height: 60px;
  522. }
  523. .base_header_layout .grid-content {
  524. margin-top: 80px;
  525. }
  526. .el-input--small .el-input__inner {
  527. margin-left: 20px;
  528. }
  529. .el-range-editor--small.el-input__inner {
  530. height: 32px;
  531. margin: 0 10px;
  532. }
  533. /deep/.el-pagination {
  534. text-align: center;
  535. white-space: nowrap;
  536. padding: 2px 5px;
  537. color: #303133;
  538. font-weight: 700;
  539. margin-bottom: 20px;
  540. }
  541. .el-select {
  542. width: 30%;
  543. margin-right: 10px;
  544. }
  545. .el-tag+.el-tag {
  546. margin-left: 10px;
  547. }
  548. .button-new-tag {
  549. margin-left: 10px;
  550. height: 32px;
  551. line-height: 30px;
  552. padding-top: 0;
  553. padding-bottom: 0;
  554. }
  555. .input-new-tag {
  556. width: 90px;
  557. margin-left: 10px;
  558. vertical-align: bottom;
  559. }
  560. .customer .el-form-item {
  561. border-bottom: 1px solid #ccc;
  562. }
  563. /deep/.typeselect .el-input__inner {
  564. color: #8890b1;
  565. }
  566. .avatar {
  567. width: 178px;
  568. height: 178px;
  569. display: block;
  570. }
  571. .shade {
  572. background: rgba(0, 0, 0, 0.1);
  573. }
  574. /deep/.base_header_layout .find.el-button--primary {
  575. width: 30px;
  576. border-top-left-radius: 0px;
  577. border-bottom-left-radius: 0px;
  578. }
  579. /deep/.base_header_layout .findinput input {
  580. border-top-right-radius: 0px;
  581. border-bottom-right-radius: 0px;
  582. }
  583. </style>