tranManagementWarehouseInOutTask.vue 18 KB

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