moveWarehouseTask.vue 14 KB

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