tranManagementWarehouseInOutTask.vue 17 KB

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