tranManagementWarehouseInOutTask.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  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. width="17"
  182. height="18"
  183. style="vertical-align: text-top; position: relative; top: -1px"
  184. src="../../../public/img/edit.png"
  185. @click="editClick(scope.row)"
  186. alt
  187. />
  188. </template>
  189. </el-table-column>
  190. <el-table-column
  191. prop="establishDate"
  192. class="table_td"
  193. label="创建时间"
  194. ></el-table-column>
  195. <el-table-column prop="seller" label="操作" width="300">
  196. <template slot-scope="scope">
  197. <span class="corles"
  198. @click="nocomplete(scope.row)"
  199. v-hasPermission="
  200. `warehouseManagement.warehouse.warehouseInfoTask.View`
  201. "
  202. >查看</span
  203. >
  204. <el-divider
  205. direction="vertical"
  206. v-if="scope.row.taskStatus == '待审核'"
  207. ></el-divider>
  208. <span class="corles"
  209. v-hasPermission="
  210. `warehouseManagement.warehouse.warehouseInfoTask.audit`
  211. "
  212. v-if="scope.row.taskStatus == '待审核'"
  213. @click="audit(scope.row)"
  214. >审核</span
  215. >
  216. <el-divider
  217. direction="vertical"
  218. class="divider"
  219. v-if="
  220. scope.row.taskStatus == '执行中' ||
  221. scope.row.taskStatus == '已驳回'
  222. "
  223. ></el-divider>
  224. <span class="corles"
  225. v-hasPermission="
  226. `warehouseManagement.warehouse.warehouseInfoTask.edit`
  227. "
  228. v-if="
  229. scope.row.taskStatus == '执行中' ||
  230. scope.row.taskStatus == '已驳回'
  231. "
  232. @click="delivery(scope.row)"
  233. >编辑</span
  234. >
  235. <el-divider
  236. direction="vertical"
  237. v-if="scope.row.taskId == null"
  238. ></el-divider>
  239. <span class="corles"
  240. v-hasPermission="
  241. `warehouseManagement.warehouse.warehouseInfoTask.delete`
  242. "
  243. v-if="scope.row.taskId == null"
  244. @click="deleteclick(scope.row)"
  245. >删除</span
  246. >
  247. </template>
  248. </el-table-column>
  249. </el-table>
  250. <el-pagination
  251. @size-change="handleSizeChange"
  252. @current-change="handleCurrentChange"
  253. :current-page="currentPage"
  254. :page-size="pageSize"
  255. layout="total, sizes, prev, pager, next, jumper"
  256. :total="deptBudgetTotal"
  257. ></el-pagination>
  258. </div>
  259. </div>
  260. </template>
  261. <script>
  262. import { getoreditoutput, outdelete, movestates } from '@/model/tasksport/index'
  263. import { downloadFile } from '@/utils/batchDown'
  264. import Pagination from '@/components/Pagination'
  265. import WsUpload from '@/components/WsUpload'
  266. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  267. export default {
  268. name: 'viewSpareMoney',
  269. components: {
  270. WsUpload,
  271. Pagination,
  272. },
  273. watch: {
  274. vesselId(val) {
  275. this.getList()
  276. },
  277. isShow(val) {
  278. this.showType = val
  279. },
  280. },
  281. data() {
  282. return {
  283. //弹出框
  284. dialogViewSpareMoney: false,
  285. dialogApproveFormVisible: false,
  286. // 船舶类型
  287. monetaryKey: null,
  288. // 表格显示数据
  289. tableDate: [],
  290. // 是否显示
  291. showType: true,
  292. // 年
  293. year: '',
  294. gainList: [],
  295. currentPage: 1,
  296. primary: '1',
  297. pageSize: 10,
  298. searchType: 1,
  299. searchTypeText: '待审核',
  300. searchKeyWord: '',
  301. contractType: 2,
  302. taskTypeList: [
  303. { value: '待审核', type: 1 },
  304. { value: '执行中', type: 3 },
  305. { value: '已驳回', type: 2 },
  306. { value: '已完成', type: 4 },
  307. { value: '全部任务', type: '' },
  308. ],
  309. // 提交类型
  310. submitType: true,
  311. size: 10,
  312. spanArr: [],
  313. warehouseName: '',
  314. deptBudgetTotal: 0,
  315. compId: sessionStorage.getItem('ws-pf_compId'),
  316. deptCircularPage: {},
  317. historyList: [],
  318. pickerBeginDateBefore: {
  319. disabledDate: (time) => {
  320. return time.getTime() > Date.now()
  321. },
  322. },
  323. accessoryTFs: false,
  324. }
  325. },
  326. activated() {
  327. this.getList()
  328. this.showType = this.isShow
  329. },
  330. mounted() {
  331. this.getList()
  332. this.showType = this.isShow
  333. },
  334. methods: {
  335. //添加
  336. handleAdd() {
  337. this.$router.push({ path: 'tranManagementWarehouseInOutTaskAdd' })
  338. },
  339. //查找
  340. lookUp() {
  341. this.currentPage = 1
  342. this.getList()
  343. },
  344. deleteclick(row) {
  345. var text = ''
  346. if (
  347. (row.taskTypeKey == 3 && row.inOutType == '移库出库') ||
  348. (row.taskTypeKey == 4 && row.inOutType == '销售出库')
  349. ) {
  350. text = '相同任务编号的任务将一并删除且不可恢复,是否确定删除?'
  351. } else {
  352. text = `任务删除后不可恢复,是否确定删除?`
  353. }
  354. //cancelButtonClass: "btn-custom-cancel"
  355. this.$confirm(text, {
  356. confirmButtonText: '确定',
  357. cancelButtonText: '取消',
  358. type: 'warning',
  359. })
  360. .then(() => {
  361. outdelete({
  362. id: row.id,
  363. relevanceId: row.relevanceId,
  364. inOutFlag: row.inOutFlag,
  365. })
  366. .toPromise()
  367. .then((response) => {
  368. this.getList()
  369. })
  370. })
  371. .catch(() => {
  372. return false
  373. })
  374. },
  375. getList() {
  376. getoreditoutput({
  377. compId: sessionStorage.getItem('ws-pf_compId'),
  378. currentPage: this.currentPage,
  379. pageSize: this.pageSize,
  380. searchType: this.searchType,
  381. searchKeyWord: this.searchKeyWord,
  382. })
  383. .toPromise()
  384. .then((response) => {
  385. this.gainList = response
  386. this.currentPage = response.current
  387. this.pageSize = response.size
  388. this.deptBudgetTotal = response.total
  389. })
  390. },
  391. //编辑
  392. delivery(item) {
  393. this.$router.push({
  394. path: 'tranManagementWarehouseInOutTaskEdit',
  395. query: {
  396. relevanceId: item.relevanceId,
  397. },
  398. })
  399. },
  400. audit(item) {
  401. this.$router.push({
  402. path: 'tranManagementWarehouseInOutTaskaudit',
  403. query: {
  404. relevanceId: item.relevanceId,
  405. taskId: item.taskId,
  406. },
  407. })
  408. },
  409. getSpanArr(data) {
  410. let that = this
  411. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  412. that.spanArr = []
  413. that.pos = 0
  414. //遍历数据
  415. data.forEach((item, index) => {
  416. //判断是否是第一项
  417. // if (index === 0) {
  418. // this.spanArr.push(1)
  419. // this.pos = 0
  420. // } else {
  421. //不是第一项时,就根据标识去存储
  422. if (data[index].warehouseNumViewList.length > 1) {
  423. // 查找到符合条件的数据时每次要把之前存储的数据+1
  424. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  425. this.spanArr.push(0)
  426. } else {
  427. // 没有符合的数据时,要记住当前的index
  428. this.spanArr.push(1)
  429. this.pos = index
  430. }
  431. // }
  432. })
  433. },
  434. //查看//传参
  435. nocomplete(row) {
  436. this.$router.push({
  437. path: 'inOutWarehouseTaskEdit',
  438. query: {
  439. relevanceId: row.relevanceId,
  440. },
  441. })
  442. },
  443. dateFormat(fmt, date) {
  444. let ret
  445. const opt = {
  446. 'Y+': date.getFullYear().toString(), // 年
  447. 'm+': (date.getMonth() + 1).toString(), // 月
  448. 'd+': date.getDate().toString(), // 日
  449. 'H+': date.getHours().toString(), // 时
  450. // "M+": date.getMinutes().toString(), // 分
  451. // "S+": date.getSeconds().toString() // 秒
  452. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  453. }
  454. for (let k in opt) {
  455. ret = new RegExp('(' + k + ')').exec(fmt)
  456. if (ret) {
  457. fmt = fmt.replace(
  458. ret[1],
  459. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  460. )
  461. }
  462. }
  463. return fmt
  464. },
  465. handleClose() {
  466. this.accessoryTFs = false
  467. },
  468. handleSizeChange(val) {
  469. console.log(`每页 ${val} 条`)
  470. this.pageSize = val
  471. this.getList()
  472. },
  473. handleCurrentChange(val) {
  474. this.currentPage = val
  475. console.log(`当前页: ${val}`)
  476. this.getList()
  477. },
  478. editClick(row) {
  479. var status = ''
  480. if (row.taskStatus == '待审核' || row.taskStatus == '已完成') {
  481. status = '执行中'
  482. } else if (row.taskStatus == '执行中') {
  483. status = '已完成'
  484. }
  485. //cancelButtonClass: "btn-custom-cancel"
  486. this.$confirm(`是否将状态改为${status}`, {
  487. confirmButtonText: '确定',
  488. cancelButtonText: '取消',
  489. type: 'warning',
  490. })
  491. .then(() => {
  492. movestates({ id: row.id })
  493. .toPromise()
  494. .then((response) => {
  495. this.$notify.success({
  496. title: '成功',
  497. message: '状态修改成功',
  498. })
  499. this.getList()
  500. })
  501. .catch((response) => {
  502. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  503. })
  504. })
  505. .catch(() => {
  506. return false
  507. })
  508. },
  509. selecttaskType(e) {
  510. for (var i = 0; i < this.taskTypeList.length; i++) {
  511. if (this.taskTypeList[i].value == e) {
  512. this.searchType = this.taskTypeList[i].type
  513. }
  514. }
  515. },
  516. handleExamine(row) {
  517. this.$router.push({
  518. name: 'salesContractExamine',
  519. query: { id: row.id },
  520. })
  521. },
  522. // 关闭 dialog时 处理文件url 初始化upload组件
  523. handleCloe() {
  524. this.dialogViewSpareMoney = false
  525. },
  526. history(row) {
  527. billoperatehis({ id: row.id })
  528. .toPromise()
  529. .then((response) => {
  530. this.historyList = response
  531. })
  532. },
  533. find() {
  534. this.currentPage = 1
  535. this.getList()
  536. },
  537. },
  538. }
  539. </script>
  540. <style lang="scss" scoped>
  541. .vertical-text-left {
  542. width: 62px;
  543. text-align: right;
  544. }
  545. .el-button--primary {
  546. background-color: #5878e8;
  547. border-color: #5878e8;
  548. }
  549. .el-button--default {
  550. color: #8890b1;
  551. border-color: #e8eaf1;
  552. }
  553. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  554. width: 30px;
  555. margin-left: 0;
  556. border-top-left-radius: 0px;
  557. border-bottom-left-radius: 0px;
  558. }
  559. /deep/.findValue .el-input__inner {
  560. border-top-right-radius: 0px;
  561. border-bottom-right-radius: 0px;
  562. }
  563. .completed.el-button--default {
  564. border-color: #5878e8;
  565. background-color: #f6f7fc;
  566. color: #5878e8;
  567. }
  568. .putstorage.el-button--default,
  569. .deliverystorage.el-button--default {
  570. border-color: #8890b1;
  571. background-color: #fff;
  572. color: #8890b1;
  573. }
  574. /deep/.el-table td,
  575. /deep/.el-table th.is-leaf {
  576. border-right: 1px solid #e9ecf7;
  577. text-align: center;
  578. }
  579. /deep/.el-table tr td:first-child,
  580. /deep/.el-table tr th.is-leaf:first-child {
  581. border-left: 1px solid #e9ecf7;
  582. }
  583. .el-row {
  584. height: 50px;
  585. }
  586. .findValue {
  587. width: 0%;
  588. margin-left: 25%;
  589. }
  590. .search {
  591. margin-left: -250px;
  592. }
  593. .Value {
  594. width: 300px;
  595. margin-left: 766px;
  596. }
  597. .el-pagination {
  598. text-align: center;
  599. }
  600. .winseaview-main {
  601. background: #e8ecf6;
  602. box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
  603. }
  604. .spans {
  605. display: table-caption;
  606. width: 17px;
  607. line-height: 19px;
  608. }
  609. //执行样式
  610. .executory,
  611. .inExecution,
  612. .done {
  613. width: 6px;
  614. height: 6px;
  615. display: inline-block;
  616. border-radius: 50%;
  617. position: relative;
  618. top: -1px;
  619. font-size: 14px;
  620. }
  621. .executory {
  622. background: #ff9f24;
  623. }
  624. .inExecution {
  625. background: #5878e8;
  626. }
  627. .done {
  628. background: #50cad4;
  629. }
  630. .el-select {
  631. width: 30%;
  632. margin-right: 10px;
  633. }
  634. /deep/.typeselect .el-input__inner {
  635. color: #8890b1;
  636. }
  637. .corles{
  638. color: #5878E8;
  639. font-size: 14px;
  640. }
  641. </style>