tranManagementWarehouseInOutTask.vue 16 KB

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