moveWarehouseTask.vue 14 KB

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