grainPulseDynamic.vue 16 KB

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