warehouseManagementList.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989
  1. <!--仓库管理-->
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="15">
  5. <template slot="left">
  6. <ws-button type="primary" @click="handleAdd()"
  7. v-hasPermission="
  8. `warehouseManagement.warehouse.warehouseInfo.add`
  9. "
  10. ><img
  11. width="11"
  12. height="11"
  13. style="position: relative; top: 1px"
  14. src="../../../public/img/header-add.png"
  15. alt=""
  16. />
  17. 添加</ws-button
  18. >
  19. <ws-button v-hasPermission="
  20. `warehouseManagement.warehouse.warehouseInfo.view`
  21. " @click="handleLook()">查看</ws-button>
  22. <ws-button v-hasPermission="
  23. `warehouseManagement.warehouse.warehouseInfo.edit`
  24. " @click="handleEdit()">编辑</ws-button>
  25. <ws-button v-hasPermission="
  26. `warehouseManagement.warehouse.warehouseInfo.delete`
  27. " @click="handleDelete()">删除</ws-button>
  28. <ws-button v-if='list.length>0'
  29. @click="handlTask()">任务</ws-button>
  30. <ws-button @click="outData(1)">导出</ws-button>
  31. <ws-button @click="outData(2)">打印</ws-button>
  32. </template>
  33. <template slot="left">
  34. <div >
  35. <el-radio-group
  36. v-model="warehouseType"
  37. @change="changeradio"
  38. size="small"
  39. >
  40. <el-radio-button label="1">常用仓库</el-radio-button>
  41. <el-radio-button label="2">临时仓库</el-radio-button>
  42. </el-radio-group>
  43. </div>
  44. </template>
  45. <template slot="right">
  46. <ws-input
  47. v-model="warehouseName"
  48. placeholder="请输入仓库名"
  49. clearable
  50. maxlength="500"
  51. type="input"
  52. class="findValue"
  53. ></ws-input>
  54. <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
  55. <ws-button class="find" type="primary" @click="find()"
  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. /></ws-button>
  68. </template>
  69. </BaseHeaderLayout>
  70. <div v-show="this.warehouseType == '1'" class="main_css">
  71. <el-table
  72. class="wenzi"
  73. :data="warehouseList"
  74. style="width: 100%; margin-top: 20px"
  75. height="100%"
  76. >
  77. <el-table-column prop="warehouseName" label="仓库名" >
  78. </el-table-column>
  79. <el-table-column prop="binNumber" label="仓位编号" >
  80. </el-table-column>
  81. <el-table-column prop="capacity" label="容量(吨)">
  82. <template slot-scope="scope">
  83. <div
  84. v-if="scope.row.capacity != 'null' && scope.row.capacity != null"
  85. >
  86. {{ scope.row.capacity }}
  87. </div>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="品种">
  91. <template slot-scope="scope">
  92. <div
  93. style="height: 24px"
  94. v-for="(item, i) in scope.row.warehouseNumViewList"
  95. >
  96. {{ item.goodsName }}
  97. </div>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="入库量(吨)">
  101. <template slot-scope="scope">
  102. <div
  103. style="height: 24px"
  104. v-for="(item, i) in scope.row.warehouseNumViewList"
  105. >
  106. {{item.inNetWeight}}
  107. </div>
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="出库量(吨)">
  111. <template slot-scope="scope">
  112. <div
  113. style="height: 24px"
  114. v-for="(item, i) in scope.row.warehouseNumViewList"
  115. >
  116. {{ item.outNetWeight }}
  117. </div>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="应余量(吨)">
  121. <template slot-scope="scope">
  122. <div
  123. style="height: 24px"
  124. v-for="(item, i) in scope.row.warehouseNumViewList"
  125. >
  126. {{ item.storage }}
  127. </div>
  128. </template>
  129. </el-table-column>
  130. <el-table-column prop="seller" label="入库" width="300">
  131. <template slot-scope="scope">
  132. <ws-button v-hasPermission="
  133. `warehouseManagement.warehouse.warehouseInfo.in`
  134. " class="putstorage" @click="warehousing1(scope.row)">
  135. 毛检
  136. </ws-button>
  137. <ws-button v-hasPermission="
  138. `warehouseManagement.warehouse.warehouseInfo.in`
  139. " class="putstorage" @click="nocomplete1(scope.row)">
  140. 皮检
  141. </ws-button>
  142. <!-- <ws-button v-hasPermission="
  143. `warehouseManagement.warehouse.warehouseInfo.view`
  144. " class="completed" @click="nocomplete(scope.row)">
  145. 待皮检({{ scope.row.number }})
  146. </ws-button> -->
  147. </template>
  148. </el-table-column>
  149. <el-table-column prop="seller" label="出库" width="300">
  150. <template slot-scope="scope">
  151. <ws-button v-hasPermission="
  152. `warehouseManagement.warehouse.warehouseInfo.out`
  153. " class="deliverystorage" @click="delivery1(scope.row)">
  154. 皮检
  155. </ws-button>
  156. <ws-button v-hasPermission="
  157. `warehouseManagement.warehouse.warehouseInfo.out`
  158. " class="deliverystorage" @click="nocomplete1(scope.row)">
  159. 毛检
  160. </ws-button>
  161. <!-- <ws-button v-hasPermission="
  162. `warehouseManagement.warehouse.warehouseInfo.view`
  163. " class="completed" @click="nocomplete(scope.row)">
  164. 待毛检({{ scope.row.number }})
  165. </ws-button> -->
  166. </template>
  167. </el-table-column>
  168. <el-table-column prop="address" label="操作" width="200">
  169. <template slot-scope="scope">
  170. <div class="record" v-hasPermission="
  171. `warehouseManagement.warehouse.warehouseInfo.view`
  172. " @click="record(scope.row)">记录</div>
  173. <div class="adjustment" v-hasPermission="
  174. `warehouseManagement.warehouse.warehouseInfo.view`
  175. " @click="loss(scope.row)">盘损</div>
  176. <div class="adjustment" v-hasPermission="
  177. `warehouseManagement.warehouse.warehouseInfo.view`
  178. " @click="mintor(scope.row)">监控</div>
  179. </template>
  180. </el-table-column>
  181. </el-table>
  182. </div>
  183. <div v-show="this.warehouseType == '2'">
  184. <el-table
  185. class="wenzi"
  186. :data="warehouseList"
  187. style="width: 100%; margin-top: 20px"
  188. height="780"
  189. >
  190. <el-table-column type="index" label="序号" width="80">
  191. <template scope="scope">
  192. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  193. <span v-else>{{ scope.$index + 1 }}</span>
  194. </template>
  195. </el-table-column>
  196. <el-table-column prop="warehouseName" label="仓库名" width="80">
  197. </el-table-column>
  198. <el-table-column prop="address" label="临时仓库地址">
  199. <template slot-scope="scope">
  200. <div
  201. v-if="scope.row.address != 'null' && scope.row.address != null"
  202. >
  203. {{ scope.row.address }}
  204. </div>
  205. </template>
  206. </el-table-column>
  207. <el-table-column label="入库量(吨)">
  208. <template slot-scope="scope">
  209. <div
  210. style="height: 24px"
  211. v-for="(item, i) in scope.row.warehouseNumViewList"
  212. >
  213. {{ item.goodsName}}({{item.inNetWeight == null ? 0 : item.inNetWeight}})
  214. </div>
  215. </template>
  216. </el-table-column>
  217. <el-table-column label="出库量(吨)">
  218. <template slot-scope="scope">
  219. <div
  220. style="height: 24px"
  221. v-for="(item, i) in scope.row.warehouseNumViewList"
  222. >
  223. {{ item.goodsName}}({{item.outNetWeight == null ? 0:item.outNetWeight}})
  224. </div>
  225. </template>
  226. </el-table-column>
  227. <el-table-column label="应余量(吨)">
  228. <template slot-scope="scope">
  229. <div
  230. style="height: 24px"
  231. v-for="(item, i) in scope.row.warehouseNumViewList"
  232. >{{ item.goodsName}}
  233. ({{ item.surplus}})
  234. {{item.storage }}
  235. </div>
  236. </template>
  237. </el-table-column>
  238. <el-table-column prop="seller" label="出入库" width="300">
  239. <template slot-scope="scope">
  240. <ws-button class="completed" @click="nocomplete(scope.row)">
  241. 待完成({{ scope.row.number }})
  242. </ws-button>
  243. <ws-button class="putstorage" @click="warehousing(scope.row)">
  244. 入库
  245. </ws-button>
  246. <ws-button
  247. class="deliverystorage"
  248. v-if="scope.row.clearStatusFlag != 3"
  249. @click="delivery(scope.row)"
  250. >
  251. 出库
  252. </ws-button>
  253. </template>
  254. </el-table-column>
  255. <el-table-column prop="address" label="操作" width="200">
  256. <template slot-scope="scope">
  257. <div class="record" @click="record(scope.row)">记录</div>
  258. <div
  259. class="adjustment"
  260. v-if="scope.row.clearStatusFlag == 1"
  261. @click="clearance(scope.row)"
  262. >
  263. 清仓
  264. </div>
  265. <div class="adjustment" v-if="scope.row.clearStatusFlag == 3">
  266. 已清仓
  267. </div>
  268. </template>
  269. </el-table-column>
  270. </el-table>
  271. </div>
  272. <div class="mask" v-show="isShowPrintType"></div>
  273. <div class="print-type" v-show="isShowPrintType">
  274. <div class="print-type-content">
  275. <div class="print-type-title">{{headerText}}</div>
  276. <div class="print-type-checkbox">
  277. <el-form ref="form" label-width="110px">
  278. <el-form-item label="类型" v-if="headerText == '打印记录'">
  279. <el-radio-group v-model="parameter.radio" >
  280. <el-radio :label="1">入库记录</el-radio>
  281. <el-radio :label="2">出库记录</el-radio>
  282. </el-radio-group>
  283. </el-form-item>
  284. <el-form-item label="起始日期">
  285. <el-date-picker type="date" placeholder="请选择起始日期" v-model="parameter.startDate"></el-date-picker>
  286. </el-form-item>
  287. <el-form-item label="截止日期">
  288. <el-date-picker type="date" placeholder="请选择截止日期" v-model="parameter.endDate" ></el-date-picker>
  289. </el-form-item>
  290. <!--仓库名称-->
  291. <el-form-item label="仓库名称" span="1" prop="warehouseName" >
  292. <el-select
  293. v-model="parameter.warehouseName"
  294. placeholder="请选择仓库名称"
  295. >
  296. <el-option
  297. v-for="item in packtypeList"
  298. :key="item.constKey"
  299. :label="item.warehouseName"
  300. :value="item.warehouseName"
  301. />
  302. </el-select>
  303. </el-form-item>
  304. <el-form-item label="增量比例(%)" v-if="headerText == '打印记录'">
  305. <el-input placeholder="请输入增量比例" v-model="parameter.proportion" clearable class="proportion_css"></el-input>
  306. </el-form-item>
  307. </el-form>
  308. </div>
  309. </div>
  310. <div class="bottom-btn">
  311. <el-button @click="submitClick()" >确定</el-button>
  312. <!-- <el-button @click="submitClick()" v-if="headerText == '打印记录'">确定</el-button> -->
  313. <el-button @click="isShowPrintType = false">取消</el-button>
  314. </div>
  315. </div>
  316. </div>
  317. </template>
  318. <script>
  319. import {
  320. getList,
  321. getwarehousetask,
  322. export1,
  323. editstatus,
  324. billoperatehis,
  325. getsponsible,
  326. clearancee,
  327. xiala,
  328. postExport
  329. } from '@/model/warehouse/index'
  330. import { downloadFile } from '@/utils/batchDown'
  331. import Pagination from '@/components/Pagination'
  332. import WsUpload from '@/components/WsUpload'
  333. // import { EventBus } from 'base-core-lib'
  334. import {dayjs,EventBus} from 'base-core-lib'
  335. export default {
  336. name: 'viewSpareMoney',
  337. components: {
  338. WsUpload,
  339. Pagination,
  340. },
  341. watch: {
  342. vesselId(val) {
  343. this.getList()
  344. },
  345. isShow(val) {
  346. this.showType = val
  347. },
  348. },
  349. data() {
  350. return {
  351. //弹出框
  352. dialogViewSpareMoney: false,
  353. dialogApproveFormVisible: false,
  354. // 船舶类型
  355. monetaryKey: null,
  356. // 表格显示数据
  357. tableDate: [],
  358. list:[],
  359. // 是否显示
  360. showType: true,
  361. // 年
  362. year: '',
  363. searchType: 1,
  364. searchTypeText: '未完成',
  365. searchKeyWord: '',
  366. contractType: 2,
  367. warehouseType: '1',
  368. // 提交类型
  369. submitType: true,
  370. size: 10,
  371. spanArr: [],
  372. warehouseName: '',
  373. compId: localStorage.getItem('ws-pf_compId'),
  374. deptCircularPage: {},
  375. warehouseList: [],
  376. deptBudgetList: {},
  377. historyList: [],
  378. deptBudgetTotal: 0,
  379. pickerBeginDateBefore: {
  380. disabledDate: (time) => {
  381. return time.getTime() > Date.now()
  382. },
  383. },
  384. accessoryTFs: false,
  385. isShowPrintType:false,//打印
  386. headerText:"",
  387. packtypeList:[],//仓库列表
  388. parameter:{},
  389. date: {
  390. year: dayjs().format('YYYY'),
  391. month: dayjs().format('MM'),
  392. },
  393. }
  394. },
  395. activated() {
  396. this.getList()
  397. this.showType = this.isShow
  398. },
  399. methods: {
  400. //导出、打印
  401. outData(index){
  402. if(index == 1){
  403. this.headerText = "导出入库记录"
  404. }else if(index == 2){
  405. this.headerText = "打印记录"
  406. }
  407. // 获取仓库
  408. xiala({
  409. compId: localStorage.getItem('ws-pf_compId'),
  410. warehouseType: this.warehouseType,
  411. })
  412. .toPromise()
  413. .then((response) => {
  414. this.packtypeList = response
  415. })
  416. this.isShowPrintType = true
  417. },
  418. async submitClick(){
  419. if(this.headerText = "导出入库记录"){
  420. const {
  421. data
  422. } = await postExport(this.parameter, {}, {
  423. responseType: 'blob'
  424. }).toPromise()
  425. debugger
  426. downloadFile({
  427. res: data,
  428. fileName: `${
  429. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  430. }导出记录`,
  431. type: 'xls',
  432. })
  433. }else if(this.headerText = "打印记录"){
  434. window.open('../../../../../static/warehousePrint.html')
  435. console.log(this.parameter)
  436. }
  437. },
  438. //清仓
  439. clearance(row) {
  440. console.log(row.outNumber)
  441. if (row.outNumber > 0) {
  442. this.$confirm(`你还有未完善的出库记录,请完善提交后再进行操作`, {
  443. cancelButtonText: '关闭',
  444. })
  445. .then(() => {})
  446. .catch(() => {
  447. return false
  448. })
  449. } else {
  450. this.$confirm(
  451. `清仓操作代表库存已清零,清仓后不可进行出库操作,是否确定清仓`,
  452. {
  453. confirmButtonText: '确定',
  454. cancelButtonText: '取消',
  455. type: 'warning',
  456. }
  457. )
  458. .then(() => {
  459. clearancee({ id: row.warehouseId })
  460. .toPromise()
  461. .then((response) => {
  462. this.$notify.success({
  463. title: '成功',
  464. message: '状态清仓成功',
  465. })
  466. this.getList()
  467. })
  468. .catch((response) => {})
  469. })
  470. .catch(() => {
  471. return false
  472. })
  473. }
  474. },
  475. //出库
  476. delivery(item) {
  477. this.$router.push({
  478. path: 'warehouseManagementDelivery',
  479. query: {
  480. baseId: item.warehouseId,
  481. positionId: item.binNumberId,
  482. warehouseName: item.warehouseName,
  483. binNumber: item.binNumber,
  484. capacity: item.capacity,
  485. warehouseType: this.warehouseType,
  486. warehouseId: item.warehouseId,
  487. },
  488. })
  489. },
  490. //入库
  491. warehousing(item) {
  492. var free = 0
  493. for (var i = 0; i < item.warehouseNumViewList.length; i++) {
  494. free += Number(item.warehouseNumViewList[i].storage)
  495. }
  496. this.$router.push({
  497. path: 'warehouseManagementPut',
  498. query: {
  499. baseId: item.warehouseId,
  500. positionId: item.binNumberId,
  501. warehouseName: item.warehouseName,
  502. binNumber: item.binNumber,
  503. capacity: item.capacity - free,
  504. id: item.id,
  505. warehouseType: this.warehouseType,
  506. createType: item.createType,
  507. },
  508. })
  509. },
  510. //毛检
  511. warehousing1(item) {
  512. var free = 0
  513. for (var i = 0; i < item.warehouseNumViewList.length; i++) {
  514. free += Number(item.warehouseNumViewList[i].storage)
  515. }
  516. this.$router.push({
  517. path: 'warehouseManagementGross',
  518. query: {
  519. baseId: item.warehouseId,
  520. positionId: item.binNumberId,
  521. warehouseName: item.warehouseName,
  522. binNumber: item.binNumber,
  523. capacity: item.capacity - free,
  524. id: item.id,
  525. warehouseType: this.warehouseType,
  526. createType: item.createType,
  527. information:'毛重检斤',
  528. allowEdit:item.allowEdit
  529. },
  530. })
  531. },
  532. //皮检
  533. delivery1(item) {
  534. this.$router.push({
  535. path: 'warehouseManagementTare',
  536. query: {
  537. baseId: item.warehouseId,
  538. positionId: item.binNumberId,
  539. warehouseName: item.warehouseName,
  540. binNumber: item.binNumber,
  541. capacity: item.capacity,
  542. warehouseType: this.warehouseType,
  543. warehouseId: item.warehouseId,
  544. information:'皮重检斤',
  545. allowEdit:item.allowEdit
  546. },
  547. })
  548. },
  549. getSpanArr(data) {
  550. let that = this
  551. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  552. that.spanArr = []
  553. that.pos = 0
  554. //遍历数据
  555. data.forEach((item, index) => {
  556. //判断是否是第一项
  557. // if (index === 0) {
  558. // this.spanArr.push(1)
  559. // this.pos = 0
  560. // } else {
  561. //不是第一项时,就根据标识去存储
  562. if (data[index].warehouseNumViewList.length > 1) {
  563. // 查找到符合条件的数据时每次要把之前存储的数据+1
  564. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  565. this.spanArr.push(0)
  566. } else {
  567. // 没有符合的数据时,要记住当前的index
  568. this.spanArr.push(1)
  569. this.pos = index
  570. }
  571. // }
  572. })
  573. },
  574. //待完成//传参
  575. nocomplete(row) {
  576. if (row.number > 0) {
  577. this.$router.push({
  578. path: 'warehouseManagementNoComplete',
  579. query: {
  580. baseId: row.warehouseId,
  581. positionId: row.binNumberId,
  582. warehouseName: row.warehouseName,
  583. binNumber: row.binNumber,
  584. warehouseType: this.warehouseType,
  585. createType: row.createType,
  586. },
  587. })
  588. }
  589. },
  590. //检斤待完成
  591. nocomplete1(row) {
  592. this.$router.push({
  593. path: 'warehouseManagementNoWeight',
  594. query: {
  595. baseId: row.warehouseId,
  596. positionId: row.binNumberId,
  597. warehouseName: row.warehouseName,
  598. binNumber: row.binNumber,
  599. warehouseType: this.warehouseType,
  600. createType: row.createType,
  601. },
  602. })
  603. },
  604. //记录
  605. record(item) {
  606. this.$router.push({
  607. name: 'warehouseManagementRecord',
  608. query: {
  609. baseId: item.warehouseId,
  610. positionId: item.binNumberId,
  611. warehouseName: item.warehouseName,
  612. remark: item.remark,
  613. binNumber: item.binNumber,
  614. capacity: item.capacity,
  615. warehouseType: this.warehouseType,
  616. },
  617. })
  618. },
  619. //盘损
  620. loss(item) {
  621. this.$router.push({
  622. path: 'warehouseManagementIoss',
  623. query: {
  624. baseId: item.warehouseId,
  625. positionId: item.binNumberId,
  626. warehouseName: item.warehouseName,
  627. binNumber: item.binNumber,
  628. },
  629. })
  630. },
  631. mintor(){
  632. this.$router.push({ path: 'warehouseManagementMintor' })
  633. },
  634. changeradio(e) {
  635. this.getList()
  636. },
  637. //查看
  638. handleLook() {
  639. this.$router.push({ path: 'warehouseManagementLook' })
  640. },
  641. //添加
  642. handleAdd() {
  643. this.$router.push({ path: 'warehouseManagementAdd' })
  644. },
  645. //编辑
  646. handleEdit() {
  647. this.$router.push({ path: 'warehouseManagementEdit' })
  648. },
  649. handleDelete() {
  650. this.$router.push({ path: 'warehouseManagementDelete' })
  651. },
  652. //任务
  653. handlTask(){
  654. var arr=[]
  655. console.log(this.list)
  656. for (let i = 0; i < this.list.length; i++) {
  657. arr.push(this.list[i].warehouseName)
  658. }
  659. this.$router.push({ path: 'tranManagementWarehouseInOutTask',query:{stringList:arr,warehouseBaseInfoList:JSON.stringify(this.list)} })
  660. // this.$router.push({ path: 'tranManagementWarehouseInOutTask',query:{warehouseBaseInfoList:JSON.stringify(this.list)} })
  661. },
  662. dateFormat(fmt, date) {
  663. let ret
  664. const opt = {
  665. 'Y+': date.getFullYear().toString(), // 年
  666. 'm+': (date.getMonth() + 1).toString(), // 月
  667. 'd+': date.getDate().toString(), // 日
  668. 'H+': date.getHours().toString(), // 时
  669. // "M+": date.getMinutes().toString(), // 分
  670. // "S+": date.getSeconds().toString() // 秒
  671. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  672. }
  673. for (let k in opt) {
  674. ret = new RegExp('(' + k + ')').exec(fmt)
  675. if (ret) {
  676. fmt = fmt.replace(
  677. ret[1],
  678. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  679. )
  680. }
  681. }
  682. return fmt
  683. },
  684. handleClose() {
  685. this.accessoryTFs = false
  686. },
  687. handleSizeChange(val) {
  688. console.log(`每页 ${val} 条`)
  689. this.pageSize = val
  690. this.getList()
  691. },
  692. handleCurrentChange(val) {
  693. this.currentPage = val
  694. console.log(`当前页: ${val}`)
  695. this.getList()
  696. },
  697. getList() {
  698. getList({
  699. compId: localStorage.getItem('ws-pf_compId'),
  700. warehouseName: this.warehouseName,
  701. warehouseType: this.warehouseType,
  702. })
  703. .toPromise()
  704. .then((response) => {
  705. for (let i = 0; i <response.length; i++) {
  706. if(response[i].warehouseNumViewList){
  707. for (let q = 0; q < response[i].warehouseNumViewList.length; q++) {
  708. console.log(response[i].warehouseNumViewList[q])
  709. if(response[i].warehouseNumViewList[q].inNetWeight){
  710. response[i].warehouseNumViewList[q].inNetWeight=Number(response[i].warehouseNumViewList[q].inNetWeight).toFixed(3)
  711. }
  712. if(response[i].warehouseNumViewList[q].outNetWeight){
  713. response[i].warehouseNumViewList[q].outNetWeight=Number(response[i].warehouseNumViewList[q].outNetWeight).toFixed(3)
  714. }
  715. if(response[i].warehouseNumViewList[q].storage){
  716. response[i].warehouseNumViewList[q].storage=Number(response[i].warehouseNumViewList[q].storage).toFixed(3)
  717. }
  718. if(response[i].warehouseNumViewList[q].inNetWeight&&response[i].warehouseNumViewList[q].outNetWeight){
  719. response[i].warehouseNumViewList[q].surplus =(response[i].warehouseNumViewList[q].inNetWeight-response[i].warehouseNumViewList[q].outNetWeight).toFixed(3)
  720. }else if(response[i].warehouseNumViewList[q].inNetWeight){
  721. response[i].warehouseNumViewList[q].surplus=response[i].warehouseNumViewList[q].inNetWeight
  722. }
  723. }
  724. }
  725. }
  726. this.warehouseList = response
  727. })
  728. getsponsible({
  729. compId: localStorage.getItem('ws-pf_compId')
  730. }).toPromise()
  731. .then((response) => {
  732. this.list=response
  733. // console.log(response)
  734. })
  735. },
  736. editClick(row) {
  737. var status = ''
  738. if (row.status == '待执行' || row.status == '已完成') {
  739. status = '执行中'
  740. } else if (row.status == '执行中') {
  741. status = '已完成'
  742. }
  743. //cancelButtonClass: "btn-custom-cancel"
  744. this.$confirm(`是否将状态改为${status}`, {
  745. confirmButtonText: '确定',
  746. cancelButtonText: '取消',
  747. type: 'warning',
  748. })
  749. .then(() => {
  750. editstatus({ id: row.id })
  751. .toPromise()
  752. .then((response) => {
  753. this.$notify.success({
  754. title: '成功',
  755. message: '状态修改成功',
  756. })
  757. this.getList()
  758. })
  759. .catch((response) => {
  760. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  761. })
  762. })
  763. .catch(() => {
  764. return false
  765. })
  766. },
  767. selecttaskType(e) {
  768. for (var i = 0; i < this.taskTypeList.length; i++) {
  769. if (this.taskTypeList[i].value == e) {
  770. this.searchType = this.taskTypeList[i].type
  771. }
  772. }
  773. },
  774. fujian(row) {
  775. if (
  776. row.receiveAttachmentPath === null ||
  777. row.receiveAttachmentPath === ''
  778. ) {
  779. EventBus.$emit(
  780. 'warning',
  781. this.$t('system.noticeCircular.NoInformation')
  782. )
  783. } else {
  784. this.accessoryTFs = true
  785. }
  786. this.appendixIdss = row.receiveAttachmentPath
  787. },
  788. handleExamine(row) {
  789. this.$router.push({
  790. name: 'salesContractExamine',
  791. query: { id: row.id },
  792. })
  793. },
  794. // 关闭 dialog时 处理文件url 初始化upload组件
  795. handleCloe() {
  796. this.dialogViewSpareMoney = false
  797. },
  798. history(row) {
  799. billoperatehis({ id: row.id })
  800. .toPromise()
  801. .then((response) => {
  802. this.historyList = response
  803. })
  804. },
  805. find() {
  806. this.currentPage = 1
  807. this.getList()
  808. },
  809. // async exportlist() {
  810. // const { data } = await postExport(
  811. // this.parameter,
  812. // {},
  813. // { responseType: 'blob' }
  814. // ).toPromise()
  815. // downloadFile({
  816. // res: data,
  817. // fileName: `${
  818. // this.date.year + (this.date.month ? `-${this.date.month}` : '')
  819. // }_采购合同1`,
  820. // type: 'xls',
  821. // })
  822. // },
  823. },
  824. }
  825. </script>
  826. <style lang="scss" scoped>
  827. .connert {
  828. width: 90%;
  829. margin: 0 auto;
  830. }
  831. .vertical-text-left {
  832. width: 62px;
  833. text-align: right;
  834. }
  835. .el-button--primary {
  836. background-color: #5878e8;
  837. border-color: #5878e8;
  838. }
  839. .el-button--default {
  840. color: #8890b1;
  841. border-color: #e8eaf1;
  842. }
  843. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  844. width: 30px;
  845. margin-left: 0;
  846. border-top-left-radius: 0px;
  847. border-bottom-left-radius: 0px;
  848. }
  849. /deep/.findValue .el-input__inner {
  850. border-top-right-radius: 0px;
  851. border-bottom-right-radius: 0px;
  852. }
  853. .completed.el-button--default {
  854. border-color: #5878e8;
  855. background-color: #f6f7fc;
  856. color: #5878e8;
  857. }
  858. .putstorage.el-button--default,
  859. .deliverystorage.el-button--default {
  860. border-color: #8890b1;
  861. background-color: #fff;
  862. color: #8890b1;
  863. }
  864. /deep/.el-table td,
  865. /deep/.el-table th.is-leaf {
  866. border-right: 1px solid #e9ecf7;
  867. text-align: center;
  868. }
  869. /deep/.el-table tr td:first-child,
  870. /deep/.el-table tr th.is-leaf:first-child {
  871. border-left: 1px solid #e9ecf7;
  872. }
  873. /deep/.el-table .el-table__header .cell,
  874. /deep/.el-table .el-table__body .cell {
  875. -webkit-line-clamp: 10;
  876. max-height: 400px;
  877. }
  878. .record,
  879. .adjustment {
  880. display: inline-block;
  881. color: #5878e8;
  882. padding: 0 4px !important;
  883. position: relative;
  884. }
  885. .record:after {
  886. position: absolute;
  887. content: '';
  888. display: block;
  889. top: 5px;
  890. right: -2px;
  891. width: 1px;
  892. height: 12px;
  893. background: #e9ecf7;
  894. }
  895. /deep/.el-radio-button:first-child .el-radio-button__inner {
  896. margin-left: 10px;
  897. }
  898. //分页
  899. .el-pagination {
  900. text-align: center;
  901. white-space: nowrap;
  902. padding: 2px 5px;
  903. color: #303133;
  904. font-weight: 700;
  905. margin-bottom: 20px;
  906. }
  907. .main_css{
  908. height: calc(100vh - 124px);
  909. }
  910. //打印弹窗
  911. .mask {
  912. background: black;
  913. width: 100vw;
  914. height: 100vh;
  915. position: fixed;
  916. top: 0;
  917. z-index: 99;
  918. opacity: 0.3;
  919. }
  920. .count{
  921. text-align: center;
  922. margin-bottom: 10px;
  923. }
  924. .print-type {
  925. position: absolute;
  926. top: 0;
  927. bottom: 0;
  928. left: 0;
  929. right: 0;
  930. margin: auto;
  931. width: 340px;
  932. height: 400px;
  933. background: white;
  934. border-radius: 10px;
  935. z-index: 999;
  936. .bottom-btn{
  937. text-align: center;
  938. }
  939. }
  940. .print-type-title {
  941. text-align: center;
  942. font-size: 18px;
  943. // margin: 20px;
  944. margin: 20px 20px 10px;
  945. }
  946. .print-type-checkbox {
  947. padding-left: 20px;
  948. .el-date-editor.el-input{
  949. width: 85% !important;
  950. }
  951. .proportion_css{
  952. width: 85%;
  953. }
  954. }
  955. .page2-content {
  956. border: 1px solid #d8dce6;
  957. margin-top: 20px;
  958. padding: 10px;
  959. box-sizing: border-box;
  960. text-align: center;
  961. border-radius: 4px;
  962. padding-bottom: 20px;
  963. }
  964. </style>