tranManagementWarehouseInOutTask.vue 17 KB

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