grainPulseDynamic.vue 17 KB

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