tranManagementWarehouseInOutTask.vue 17 KB

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