tranManagementWarehouseInOutTask.vue 18 KB

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