tranManagementWarehouseInOutTask.vue 18 KB

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