moveWarehouseTask.vue 13 KB

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