tranManagementWarehouseInOutTask.vue 17 KB

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