moveWarehouseTask.vue 13 KB

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