tranManagementWarehouseInOutTask.vue 17 KB

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