tranManagementWarehouseInOutTask.vue 17 KB

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