tranManagementWarehouseInOutTask.vue 18 KB

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