tranManagementWarehouseInOutTask.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. <!--出入库任务-->
  2. <template>
  3. <div class="container">
  4. <BaseHeaderLayout :leftSpan="12">
  5. <template slot="left">
  6. <ws-button
  7. type="primary"
  8. @click="handleAdd()"
  9. v-hasPermission="
  10. `warehouseManagement.warehouse.warehouseInfoTask.add`
  11. "
  12. >
  13. <img
  14. width="13"
  15. height="13"
  16. style="
  17. vertical-align: text-top;
  18. position: relative;
  19. top: 2px;
  20. left: -4px;
  21. "
  22. src="../../../public/img/header-add.png"
  23. alt
  24. />添加
  25. </ws-button>
  26. </template>
  27. <template slot="right">
  28. <span style="width: 70px; display: inline-block; color: #8890b1"
  29. >状态:</span
  30. >
  31. <ws-select
  32. v-model="searchTypeText"
  33. placeholder
  34. class="typeselect"
  35. @change="selecttaskType"
  36. :value="searchType"
  37. >
  38. <ws-option
  39. v-for="item in taskTypeList"
  40. :key="item.value"
  41. :label="item.value"
  42. :value="item.value"
  43. style="color: #8890b1"
  44. />
  45. </ws-select>
  46. <ws-input
  47. v-model="searchKeyWord"
  48. placeholder="可按合同编号或任务编号查找"
  49. clearable
  50. maxlength="500"
  51. type="input"
  52. ></ws-input>
  53. <ws-button class="find" type="primary" @click="lookUp()">
  54. <img
  55. width="16"
  56. height="16"
  57. style="
  58. vertical-align: text-top;
  59. position: relative;
  60. top: 0px;
  61. left: -7px;
  62. "
  63. src="../../../public/img/sousuo.png"
  64. alt
  65. />
  66. </ws-button>
  67. </template>
  68. </BaseHeaderLayout>
  69. <div class="navv">
  70. <el-table
  71. class="wenzi"
  72. :data="gainList.records"
  73. style="width: 100%"
  74. height="780"
  75. >
  76. <el-table-column type="index" label="序号">
  77. <template scope="scope">
  78. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  79. <span v-else>{{ scope.$index + 1 }}</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column prop="inOutTaskNo" label="任务编号"></el-table-column>
  83. <el-table-column prop="contractNo" label="合同编号" width="80">
  84. <!-- <template scope="scope">
  85. <div
  86. v-if="
  87. scope.row.inOutType == '移库入库' ||
  88. scope.row.inOutType == '移库出库'
  89. "
  90. >
  91. {{ scope.row.moveTaskNo }}
  92. </div>
  93. <div
  94. v-if="
  95. scope.row.inOutType != '移库入库' ||
  96. scope.row.inOutType != '移库出库'
  97. "
  98. >
  99. {{ scope.row.contractNo }}
  100. </div>
  101. </template> -->
  102. </el-table-column>
  103. <el-table-column
  104. prop="warehouseName"
  105. class="table_td"
  106. label="库房名"
  107. ></el-table-column>
  108. <el-table-column
  109. prop="inOutType"
  110. class="table_td"
  111. label="出入库类型"
  112. ></el-table-column>
  113. <el-table-column
  114. prop="goodsName"
  115. class="table_td"
  116. label="货名"
  117. ></el-table-column>
  118. <el-table-column
  119. prop="weight"
  120. class="table_td"
  121. label="重量(吨)"
  122. ></el-table-column>
  123. <el-table-column
  124. prop="predictDate"
  125. class="table_td"
  126. label="预计日期"
  127. ></el-table-column>
  128. <el-table-column
  129. prop="publisher"
  130. class="table_td"
  131. label="经办人"
  132. >
  133. <template slot-scope="scope">
  134. <template>
  135. <span v-if="!scope.row.editstatus" slot="reference">
  136. {{ scope.row.publisher }}
  137. </span>
  138. <el-select
  139. class='staff'
  140. v-if="scope.row.editstatus"
  141. v-model="scope.row.publisher"
  142. placeholder="请选择经办人"
  143. filterable
  144. clearable
  145. @change="(event)=>{selectstaff(event, scope.row)}"
  146. >
  147. <el-option
  148. v-for="item in options"
  149. :key="item.value"
  150. :label="item.staffName"
  151. :value="item.staffName"
  152. />
  153. </el-select>
  154. </template>
  155. <img
  156. v-if="!scope.row.editstatus"
  157. width="17"
  158. height="18"
  159. style="vertical-align: text-top; position: relative; top: -1px"
  160. src="../../../public/img/edit.png"
  161. @click="editClick1(scope.row)"
  162. alt
  163. />
  164. <i v-if="scope.row.editstatus" @click='checkstaff' class="el-icon-check"></i>
  165. </template></el-table-column>
  166. <el-table-column prop="taskStatus" label="状态">
  167. <template slot-scope="scope">
  168. <template>
  169. <span slot="reference">
  170. <span
  171. v-if="scope.row.taskStatus == '执行中'"
  172. class="inExecution"
  173. ></span>
  174. <span
  175. v-if="scope.row.taskStatus == '已完成'"
  176. class="done"
  177. ></span>
  178. {{ scope.row.taskStatus }}
  179. </span>
  180. </template>
  181. <img
  182. v-if="scope.row.taskStatus == '执行中'"
  183. width="17"
  184. height="18"
  185. style="vertical-align: text-top; position: relative; top: -1px"
  186. src="../../../public/img/edit.png"
  187. @click="editClick(scope.row)"
  188. alt
  189. />
  190. </template>
  191. </el-table-column>
  192. <el-table-column
  193. prop="establishDate"
  194. class="table_td"
  195. label="创建时间"
  196. ></el-table-column>
  197. <el-table-column prop="seller" label="操作" width="300">
  198. <template slot-scope="scope">
  199. <span
  200. class="corles"
  201. @click="nocomplete(scope.row)"
  202. >查看</span
  203. >
  204. </template>
  205. </el-table-column>
  206. </el-table>
  207. <el-pagination
  208. @size-change="handleSizeChange"
  209. @current-change="handleCurrentChange"
  210. :current-page="currentPage"
  211. :page-size="pageSize"
  212. layout="total, sizes, prev, pager, next, jumper"
  213. :total="deptBudgetTotal"
  214. ></el-pagination>
  215. </div>
  216. </div>
  217. </template>
  218. <script>
  219. import {
  220. getwarehousetask,
  221. postcheckorupdate,
  222. getstaff
  223. } from '@/model/warehouse/index'
  224. import { getoreditoutput, outdelete, movestates } from '@/model/tasksport/index'
  225. import { downloadFile } from '@/utils/batchDown'
  226. import Pagination from '@/components/Pagination'
  227. import WsUpload from '@/components/WsUpload'
  228. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  229. export default {
  230. name: 'viewSpareMoney',
  231. components: {
  232. WsUpload,
  233. Pagination,
  234. },
  235. watch: {
  236. vesselId(val) {
  237. this.getList()
  238. },
  239. isShow(val) {
  240. this.showType = val
  241. },
  242. },
  243. data() {
  244. return {
  245. //弹出框
  246. dialogViewSpareMoney: false,
  247. dialogApproveFormVisible: false,
  248. // 船舶类型
  249. monetaryKey: null,
  250. id:'',
  251. staff:'',
  252. tableDate: [],
  253. options:[],
  254. staffList:[],
  255. // 是否显示
  256. showType: true,
  257. // 年
  258. year: '',
  259. gainList: [],
  260. currentPage: 1,
  261. primary: '1',
  262. pageSize: 10,
  263. searchType: 3,
  264. searchTypeText: '执行中',
  265. searchKeyWord: '',
  266. contractType: 2,
  267. publisherList:[],
  268. taskTypeList: [
  269. { value: '执行中', type: 3 },
  270. { value: '已完成', type: 4 }
  271. ],
  272. // 提交类型
  273. submitType: true,
  274. size: 10,
  275. spanArr: [],
  276. warehouseName: '',
  277. deptBudgetTotal: 0,
  278. compId: sessionStorage.getItem('ws-pf_compId'),
  279. deptCircularPage: {},
  280. historyList: [],
  281. pickerBeginDateBefore: {
  282. disabledDate: (time) => {
  283. return time.getTime() > Date.now()
  284. },
  285. },
  286. accessoryTFs: false,
  287. }
  288. },
  289. activated() {
  290. this.getList()
  291. this.showType = this.isShow
  292. },
  293. methods: {
  294. dataFilter(val) {
  295. // console.log(val,"名")
  296. this.deptBudgetList.staffList = val
  297. if (val) {
  298. //val存在
  299. this.options = this.staffList.filter(item => {
  300. if (
  301. !!~item.staffName.indexOf(val) ||
  302. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  303. ) {
  304. return true
  305. }
  306. })
  307. } else {
  308. //val为空时,还原数组
  309. this.options = this.staffList
  310. }
  311. },
  312. checkstaff(){
  313. postcheckorupdate({id:this.id,publisher:this.staff}).toPromise()
  314. .then((response) => {
  315. this.$notify.success({
  316. title: '成功',
  317. message: '经办人修改成功',
  318. })
  319. this.getList()
  320. })
  321. },
  322. selectstaff(e,item) {
  323. this.id=item.id
  324. this.staff=e
  325. console.log(e,item)
  326. },
  327. //添加
  328. handleAdd() {
  329. this.$router.push({ path: 'tranManagementWarehouseInOuttaskAdd' })
  330. },
  331. //查找
  332. lookUp() {
  333. this.currentPage = 1
  334. this.getList()
  335. },
  336. deleteclick(row) {
  337. var text = ''
  338. if (
  339. (row.taskTypeKey == 3 && row.inOutType == '移库出库') ||
  340. (row.taskTypeKey == 4 && row.inOutType == '销售出库') ||
  341. (row.taskTypeKey == 4 && row.inOutType == '退库')
  342. ) {
  343. text = '相同任务编号的任务将一并删除且不可恢复,是否确定删除?'
  344. } else {
  345. text = `任务删除后不可恢复,是否确定删除?`
  346. }
  347. //cancelButtonClass: "btn-custom-cancel"
  348. this.$confirm(text, {
  349. confirmButtonText: '确定',
  350. cancelButtonText: '取消',
  351. type: 'warning',
  352. })
  353. .then(() => {
  354. outdelete({
  355. id: row.id,
  356. relevanceId: row.relevanceId,
  357. inOutFlag: row.inOutFlag,
  358. })
  359. .toPromise()
  360. .then((response) => {
  361. this.getList()
  362. })
  363. })
  364. .catch(() => {
  365. return false
  366. })
  367. },
  368. getList() {
  369. console.log(this.$route)
  370. getwarehousetask({
  371. compId: sessionStorage.getItem('ws-pf_compId'),
  372. currentPage: this.currentPage,
  373. pageSize: this.pageSize,
  374. searchType: this.searchType,
  375. searchKeyWord: this.searchKeyWord,
  376. stringList:this.$route.query.stringList.toString()
  377. })
  378. .toPromise()
  379. .then((response) => {
  380. for (let i = 0; i < response.records.length; i++) {
  381. response.records[i].editstatus=false
  382. }
  383. this.gainList = response
  384. this.currentPage = response.current
  385. this.pageSize = response.size
  386. this.deptBudgetTotal = response.total
  387. })
  388. },
  389. //编辑
  390. delivery(item) {
  391. this.$router.push({
  392. path: 'tranManagementWarehouseInOuttaskedit',
  393. query: {
  394. relevanceId: item.relevanceId,
  395. inOutFlag: item.inOutFlag
  396. },
  397. })
  398. },
  399. audit(item) {
  400. this.$router.push({
  401. path: 'tranManagementWarehouseInOuttaskaudit',
  402. query: {
  403. relevanceId: item.relevanceId,
  404. taskId: item.taskId,
  405. businessKey: item.id,
  406. workflowId: item.workflowId,
  407. },
  408. })
  409. },
  410. getSpanArr(data) {
  411. let that = this
  412. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  413. that.spanArr = []
  414. that.pos = 0
  415. //遍历数据
  416. data.forEach((item, index) => {
  417. //判断是否是第一项
  418. // if (index === 0) {
  419. // this.spanArr.push(1)
  420. // this.pos = 0
  421. // } else {
  422. //不是第一项时,就根据标识去存储
  423. if (data[index].warehouseNumViewList.length > 1) {
  424. // 查找到符合条件的数据时每次要把之前存储的数据+1
  425. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  426. this.spanArr.push(0)
  427. } else {
  428. // 没有符合的数据时,要记住当前的index
  429. this.spanArr.push(1)
  430. this.pos = index
  431. }
  432. // }
  433. })
  434. },
  435. //查看//传参
  436. nocomplete(row) {
  437. this.$router.push({
  438. path: 'warehouseManagementPutOutLook',
  439. query: {
  440. relevanceId: row.relevanceId,
  441. businessKey: row.id,
  442. workflowId: row.workflowId,
  443. },
  444. })
  445. },
  446. dateFormat(fmt, date) {
  447. let ret
  448. const opt = {
  449. 'Y+': date.getFullYear().toString(), // 年
  450. 'm+': (date.getMonth() + 1).toString(), // 月
  451. 'd+': date.getDate().toString(), // 日
  452. 'H+': date.getHours().toString(), // 时
  453. // "M+": date.getMinutes().toString(), // 分
  454. // "S+": date.getSeconds().toString() // 秒
  455. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  456. }
  457. for (let k in opt) {
  458. ret = new RegExp('(' + k + ')').exec(fmt)
  459. if (ret) {
  460. fmt = fmt.replace(
  461. ret[1],
  462. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  463. )
  464. }
  465. }
  466. return fmt
  467. },
  468. handleClose() {
  469. this.accessoryTFs = false
  470. },
  471. handleSizeChange(val) {
  472. console.log(`每页 ${val} 条`)
  473. this.pageSize = val
  474. this.getList()
  475. },
  476. handleCurrentChange(val) {
  477. this.currentPage = val
  478. console.log(`当前页: ${val}`)
  479. this.getList()
  480. },
  481. editClick(row) {
  482. var status = ''
  483. if (row.taskStatus == '待审核' || row.taskStatus == '已完成') {
  484. status = '执行中'
  485. } else if (row.taskStatus == '执行中') {
  486. status = '已完成'
  487. }
  488. //cancelButtonClass: "btn-custom-cancel"
  489. this.$confirm(`是否将状态改为${status}`, {
  490. confirmButtonText: '确定',
  491. cancelButtonText: '取消',
  492. type: 'warning',
  493. })
  494. .then(() => {
  495. movestates({ id: row.id })
  496. .toPromise()
  497. .then((response) => {
  498. this.$notify.success({
  499. title: '成功',
  500. message: '状态修改成功',
  501. })
  502. this.getList()
  503. })
  504. .catch((response) => {
  505. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  506. })
  507. })
  508. .catch(() => {
  509. return false
  510. })
  511. },
  512. editClick1(row) {
  513. console.log(row)
  514. row.editstatus=true
  515. var arr=JSON.parse(this.$route.query.warehouseBaseInfoList)
  516. for (let i = 0; i < arr.length; i++) {
  517. if(arr[i].warehouseName==row.warehouseName){
  518. console.log(arr[i])
  519. getstaff({
  520. compId: sessionStorage.getItem('ws-pf_compId'),
  521. warehouseId: arr[i].id
  522. })
  523. .toPromise()
  524. .then(response => {
  525. this.options = response
  526. this.staffList = response
  527. // this.agent = response
  528. })
  529. }
  530. }
  531. },
  532. selecttaskType(e) {
  533. for (var i = 0; i < this.taskTypeList.length; i++) {
  534. if (this.taskTypeList[i].value == e) {
  535. this.searchType = this.taskTypeList[i].type
  536. }
  537. }
  538. this.currentPage=1,
  539. this.getList()
  540. },
  541. handleExamine(row) {
  542. this.$router.push({
  543. name: 'salesContractExamine',
  544. query: { id: row.id },
  545. })
  546. },
  547. // 关闭 dialog时 处理文件url 初始化upload组件
  548. handleCloe() {
  549. this.dialogViewSpareMoney = false
  550. },
  551. history(row) {
  552. billoperatehis({ id: row.id })
  553. .toPromise()
  554. .then((response) => {
  555. this.historyList = response
  556. })
  557. },
  558. find() {
  559. this.currentPage = 1
  560. this.getList()
  561. },
  562. },
  563. }
  564. </script>
  565. <style lang="scss" scoped>
  566. .vertical-text-left {
  567. width: 62px;
  568. text-align: right;
  569. }
  570. .el-button--primary {
  571. background-color: #5878e8;
  572. border-color: #5878e8;
  573. }
  574. .el-button--default {
  575. color: #8890b1;
  576. border-color: #e8eaf1;
  577. }
  578. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  579. width: 30px;
  580. margin-left: 0;
  581. border-top-left-radius: 0px;
  582. border-bottom-left-radius: 0px;
  583. }
  584. /deep/.findValue .el-input__inner {
  585. border-top-right-radius: 0px;
  586. border-bottom-right-radius: 0px;
  587. }
  588. .completed.el-button--default {
  589. border-color: #5878e8;
  590. background-color: #f6f7fc;
  591. color: #5878e8;
  592. }
  593. .putstorage.el-button--default,
  594. .deliverystorage.el-button--default {
  595. border-color: #8890b1;
  596. background-color: #fff;
  597. color: #8890b1;
  598. }
  599. /deep/.el-table td,
  600. /deep/.el-table th.is-leaf {
  601. border-right: 1px solid #e9ecf7;
  602. text-align: center;
  603. }
  604. /deep/.el-table tr td:first-child,
  605. /deep/.el-table tr th.is-leaf:first-child {
  606. border-left: 1px solid #e9ecf7;
  607. }
  608. .el-row {
  609. height: 50px;
  610. }
  611. .findValue {
  612. width: 0%;
  613. margin-left: 25%;
  614. }
  615. .search {
  616. margin-left: -250px;
  617. }
  618. .Value {
  619. width: 300px;
  620. margin-left: 766px;
  621. }
  622. .el-pagination {
  623. text-align: center;
  624. }
  625. .winseaview-main {
  626. background: #e8ecf6;
  627. box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
  628. }
  629. .spans {
  630. display: table-caption;
  631. width: 17px;
  632. line-height: 19px;
  633. }
  634. //执行样式
  635. .executory,
  636. .inExecution,
  637. .done {
  638. width: 6px;
  639. height: 6px;
  640. display: inline-block;
  641. border-radius: 50%;
  642. position: relative;
  643. top: -1px;
  644. font-size: 14px;
  645. }
  646. .executory {
  647. background: #ff9f24;
  648. }
  649. .inExecution {
  650. background: #5878e8;
  651. }
  652. .done {
  653. background: #50cad4;
  654. }
  655. .el-select {
  656. width: 30%;
  657. margin-right: 10px;
  658. }
  659. .el-select.staff{
  660. width:85%;
  661. display:inline-block;
  662. margin-right:2px;
  663. }
  664. /deep/.typeselect .el-input__inner {
  665. color: #8890b1;
  666. }
  667. .corles {
  668. color: #5878e8;
  669. font-size: 14px;
  670. }
  671. </style>