tranManagementWarehouseInOutTask.vue 18 KB

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