tranManagementWarehouseInOutTask.vue 17 KB

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