tranManagementWarehouseInOutTask.vue 17 KB

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