moveWarehouseTask.vue 13 KB

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