purchaseClosingCashierList.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976
  1. //采购平仓报表
  2. <template>
  3. <div class="container">
  4. <el-scrollbar style="height:100%">
  5. <el-row>
  6. <el-col style='padding-left:15px;' :span="16">
  7. <ws-button :type="searchType==1?'primary':''" @click="handlestatus(1)">待审核</ws-button>
  8. <ws-button :type="searchType==2?'primary':''" @click="handlestatus(2)">待结算</ws-button>
  9. <ws-button :type="searchType==3?'primary':''" @click="handlestatus(3)">已结算</ws-button>
  10. <ws-button :type="searchType==''?'primary':''" @click="handlestatus('')">全部</ws-button>
  11. <ws-button type="primary" v-hasPermission="
  12. `report.procurementCloseReport.view`
  13. " @click="handlepass()">通过</ws-button>
  14. <ws-button type="primary" v-hasPermission="
  15. `report.procurementCloseReport.view`
  16. " @click="handlereject()">驳回</ws-button>
  17. <ws-button type="primary" v-hasPermission="
  18. `report.procurementCloseReport.payment`
  19. " @click="handlepayment()">付款</ws-button>
  20. <ws-button type="primary" v-hasPermission="
  21. `report.procurementCloseReport.recive`
  22. " @click="handlecollect()">收款</ws-button>
  23. </el-col>
  24. <el-col style='text-align:right;line-height:60px;padding-right:10px;' :span="8">
  25. <ws-select
  26. v-model="contractNo"
  27. placeholder="请选择合同"
  28. clearable
  29. @change='contractchange'
  30. maxlength="500"
  31. type="input"
  32. class="findValue"
  33. >
  34. <ws-option
  35. key=""
  36. label="全部合同"
  37. value=""
  38. />
  39. <ws-option
  40. v-if='item.reportStatus'
  41. v-for="item in contractNoList"
  42. :key="item.constKey"
  43. :label="item.contractNo+'('+item.reportStatus+')'"
  44. :value="item.contractNo"
  45. />
  46. <ws-option
  47. v-if='!item.reportStatus'
  48. v-for="item in contractNoList"
  49. :key="item.constKey"
  50. :label="item.contractNo"
  51. :value="item.contractNo"
  52. />
  53. </ws-select>
  54. </el-col>
  55. </el-row>
  56. <el-table
  57. class="wenzi"
  58. :data="warehouseList.records"
  59. style="width: 100%; margin-top: 20px"
  60. ref="warehouseList"
  61. border
  62. :summary-method="getSummaries"
  63. show-summary
  64. @row-click="handleRowClick"
  65. @selection-change="handleSelectionChange"
  66. >
  67. <el-table-column :selectable='selectInit' type="selection" width="55"></el-table-column>
  68. <el-table-column type="index" label="序号" width="50"></el-table-column>
  69. <el-table-column class="table_td" prop="contractNo" label="合同编号"></el-table-column>
  70. <el-table-column class="table_td" prop="closePositionDate" label="平仓日期"></el-table-column>
  71. <el-table-column width='100' class="table_td" prop="closingQuantity" label="平仓数量(吨)"></el-table-column>
  72. <el-table-column width='120' class="table_td" prop="transactionPrice" label="成交价格(元/吨)"></el-table-column>
  73. <el-table-column width='120' class="table_td" prop="closeRate" label="平仓价格(元/吨)"></el-table-column>
  74. <el-table-column width='100' class="table_td" prop="basisPrice" label="基差(元/吨)"></el-table-column>
  75. <el-table-column width='100' class="table_td" prop="amountIngPayable" label="应付金额(元)"></el-table-column>
  76. <el-table-column width='100' class="table_td" prop="amountEdPayable" label="已付金额(元)"></el-table-column>
  77. <el-table-column width='100' class="table_td" prop="amountNotPayable" label="未付金额(元)"></el-table-column>
  78. <el-table-column class="table_td" prop="paymentDate" label="付款日期"></el-table-column>
  79. <el-table-column width='100' class="table_td" prop="collectionIngPayable" label="应收金额(元)"></el-table-column>
  80. <el-table-column width='100' class="table_td" prop="collectionEdPayable" label="已收金额(元)"></el-table-column>
  81. <el-table-column width='100' class="table_td" prop="collectionNotPayable" label="未收金额(元)"></el-table-column>
  82. <el-table-column class="table_td" prop="collectionDate" label="收款日期"></el-table-column>
  83. <el-table-column class="table_td" prop="customerName" label="客户"></el-table-column>
  84. <el-table-column class="table_td" prop="warehouseName" label="库点"></el-table-column>
  85. <el-table-column prop="status" label="状态">
  86. <template slot-scope="scope">
  87. <span v-if='scope.row.approveStatus!=null'>{{ scope.row.approveStatus }}</span>
  88. <span v-else>{{ scope.row.status }}</span>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <!-- 页数 -->
  93. <el-pagination
  94. @size-change="handleSizeChange"
  95. @current-change="handleCurrentChange"
  96. :current-page="currentPage"
  97. :page-size="pageSize"
  98. layout="total, sizes, prev, pager, next, jumper"
  99. :total="deptBudgetTotal"
  100. ></el-pagination>
  101. </el-scrollbar>
  102. <el-dialog
  103. width="25%"
  104. title="付款"
  105. :visible.sync="dialogFormVisible1"
  106. :append-to-body="true"
  107. >
  108. <el-form :model="form">
  109. <el-form-item label="未付金额(元)" :label-width="formLabelWidth">
  110. <el-input v-model="allmoney" autocomplete="off" class="deal"></el-input>
  111. </el-form-item>
  112. <el-form-item label="本次付款金额(元)" :label-width="formLabelWidth">
  113. <el-input
  114. v-model="money"
  115. autocomplete="off"
  116. placeholder="请输入付款金额"
  117. class="deal"
  118. ></el-input>
  119. </el-form-item>
  120. <el-form-item
  121. label="付款日期"
  122. prop="submissionDate"
  123. :label-width="formLabelWidth"
  124. class="deal"
  125. >
  126. <ws-date-picker
  127. v-model="paymentDate"
  128. type="date"
  129. placeholder="请选择付款日期"
  130. value-format="yyyy-MM-dd"
  131. class="deal"
  132. />
  133. </el-form-item>
  134. <el-form-item label="上传付款截图" :label-width="formLabelWidth">
  135. <el-upload
  136. action="https://www.zthymaoyi.com/upload/admin"
  137. list-type="picture-card"
  138. :on-success="handlePictureCardPreview"
  139. :on-remove="handleRemove"
  140. class="photo2"
  141. >
  142. <i class="el-icon-plus"></i>
  143. </el-upload>
  144. <el-dialog :visible.sync="dialogVisible">
  145. <img width="100%" :src="paymentScreenshot" alt="">
  146. </el-dialog>
  147. </el-form-item>
  148. </el-form>
  149. <div slot="footer" class="dialog-footer">
  150. <el-button @click="dialogFormVisible1 = false">取 消</el-button>
  151. <el-button type="primary" @click="payment">确 定</el-button>
  152. </div>
  153. </el-dialog>
  154. <!-- 收款 -->
  155. <el-dialog
  156. width="25%"
  157. title="收款"
  158. :visible.sync="dialogFormVisible2"
  159. :append-to-body="true"
  160. >
  161. <el-form :model="form">
  162. <el-form-item label="未收金额(元)" :label-width="formLabelWidth">
  163. <el-input v-model="allmoney1" autocomplete="off" class="deal"></el-input>
  164. </el-form-item>
  165. <el-form-item label="本次收款金额(元)" :label-width="formLabelWidth">
  166. <el-input
  167. v-model="collectmoney"
  168. autocomplete="off"
  169. placeholder="请输入本次收款金额"
  170. class="deal"
  171. ></el-input>
  172. </el-form-item>
  173. <el-form-item
  174. label="收款日期"
  175. prop="submissionDate"
  176. :label-width="formLabelWidth"
  177. class="deal"
  178. >
  179. <ws-date-picker
  180. v-model="collectionDate"
  181. type="date"
  182. placeholder="请选择收款日期"
  183. value-format="yyyy-MM-dd"
  184. class="deal"
  185. />
  186. </el-form-item>
  187. <el-form-item label="上传收款截图" :label-width="formLabelWidth">
  188. <el-upload
  189. action="https://www.zthymaoyi.com/upload/admin"
  190. list-type="picture-card"
  191. :on-success="handlePictureCardPreview1"
  192. :on-remove="handleRemove"
  193. class="photo2"
  194. >
  195. <i class="el-icon-plus"></i>
  196. </el-upload>
  197. <el-dialog :visible.sync="dialogVisible">
  198. <img width="100%" :src="collectionScreenshot" alt="">
  199. </el-dialog>
  200. </el-form-item>
  201. </el-form>
  202. <div slot="footer" class="dialog-footer">
  203. <el-button @click="dialogFormVisible2 = false">取 消</el-button>
  204. <el-button type="primary" @click="collectment">提 交</el-button>
  205. </div>
  206. </el-dialog>
  207. </div>
  208. <!-- </div> -->
  209. </template>
  210. <script>
  211. import {
  212. getclose,
  213. getpurchasecontractno,
  214. closeaudit,
  215. closepaymoney,
  216. closecollmoney
  217. } from '@/model/statisticalReport/index'
  218. import {
  219. posthandle
  220. } from '@/model/purchasingManagement/index'
  221. import { downloadFile } from '@/utils/batchDown'
  222. import Pagination from '@/components/Pagination'
  223. import WsUpload from '@/components/WsUpload'
  224. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  225. export default {
  226. name: 'viewSpareMoney',
  227. components: {
  228. WsUpload,
  229. Pagination
  230. },
  231. watch: {
  232. vesselId(val) {
  233. this.getList()
  234. },
  235. isShow(val) {
  236. this.showType = val
  237. }
  238. },
  239. data() {
  240. return {
  241. dialogFormVisible1: false,
  242. dialogFormVisible2: false,
  243. dialogVisible: false,
  244. showViewer: false,
  245. form: {
  246. transactionPrice: '',
  247. transactionsNumber: '',
  248. submissionDate: ''
  249. },
  250. formLabelWidth: '120px',
  251. barWidth: 0,
  252. barHeight: 0,
  253. retioX: 1,
  254. ratioY: 1,
  255. money:0,
  256. collectmoney:0,
  257. collectionDate:'',
  258. paymentScreenshot: '',
  259. collectionScreenshot:'',
  260. paymentDate:'',
  261. isTaped: false,
  262. isHover: false,
  263. isShow: !this.autohide,
  264. //弹出框
  265. dialogViewSpareMoney: false,
  266. dialogApproveFormVisible: false,
  267. // 船舶类型
  268. monetaryKey: null,
  269. // 表格显示数据
  270. tableDate: [],
  271. // 是否显示
  272. showType: true,
  273. // 年
  274. year: '',
  275. pickerOptions: {},
  276. allmoney:0,
  277. allmoney1:0,
  278. value2: '',
  279. deptBudgetTotal: 0,
  280. currentPage: 1,
  281. tranTypeKey: 1,
  282. pageSize: 10,
  283. searchType: 1,
  284. searchTypeText: '未完成',
  285. searchKeyWord: '',
  286. contractType: 2,
  287. enter: {
  288. closePositionList: []
  289. },
  290. // 提交类型
  291. submitType: true,
  292. size: 10,
  293. spanArr: [],
  294. contractNoList:[],
  295. modification:[],
  296. contractNo: '',
  297. compId: sessionStorage.getItem('ws-pf_compId'),
  298. roleId: sessionStorage.getItem('ws-pf_roleId'),
  299. deptCircularPage: {},
  300. warehouseList: [],
  301. deptBudgetList: {},
  302. pcFlag: 1,
  303. pickerBeginDateBefore: {
  304. disabledDate: time => {
  305. return time.getTime() > Date.now()
  306. }
  307. },
  308. accessoryTFs: false
  309. }
  310. },
  311. activated() {
  312. // this.loaddata()
  313. this.getList()
  314. this.showType = this.isShow
  315. },
  316. methods: {
  317. handleRowClick(row){
  318. if(row.approveStatus==null){
  319. this.$refs.warehouseList.toggleRowSelection(row);
  320. return true
  321. }else if(row.approveStatus!=null){
  322. if(row.taskId==null){
  323. return false
  324. }else{
  325. this.$refs.warehouseList.toggleRowSelection(row);
  326. return true
  327. }
  328. }
  329. },
  330. selectInit(row){
  331. //在这里一定要记得类型匹配的上。
  332. if(row.approveStatus==null){
  333. return true
  334. }else if(row.approveStatus!=null){
  335. if(row.taskId==null){
  336. return false
  337. }else{
  338. return true
  339. }
  340. }
  341. },
  342. contractchange(e){
  343. this.contractNo=e
  344. this.getList()
  345. },
  346. handlestatus(status){
  347. this.searchType=status
  348. this.getList()
  349. },
  350. handlepayment(){
  351. if(this.modification.length==0){
  352. this.$message.warning('请选择一条要付款的条目')
  353. }
  354. else{
  355. for(var i=0;i<this.modification.length;i++){
  356. if(this.modification[i].status!='已通过'){
  357. this.$message.warning('审核尚未通过,不可进行付款操作')
  358. }
  359. this.allmoney+=this.modification[i].amountNotPayable
  360. }
  361. this.dialogFormVisible1=true
  362. }
  363. },
  364. handlecollect(){
  365. if(this.modification.length==0){
  366. this.$message.warning('请选择一条要收款的条目')
  367. }
  368. else{
  369. for(var i=0;i<this.modification.length;i++){
  370. if(this.modification[i].status!='已通过'){
  371. this.$message.warning('审核尚未通过,不可进行收款操作')
  372. }
  373. this.allmoney1+=this.modification[i].collectionNotPayable
  374. }
  375. this.dialogFormVisible2=true
  376. }
  377. },
  378. audit(item,index,status){
  379. if(index<this.modification.length){
  380. posthandle({ taskId: item.taskId,
  381. approved: status,
  382. auditMind: '34',
  383. needReapply: false,})
  384. .toPromise()
  385. .then((response) => {
  386. this.audit(this.modification[index+1],index+1,status)
  387. }).catch((req) => {
  388. this.$message.warning(req.message)
  389. })
  390. }else{
  391. if(status){
  392. this.$message.success('通过成功')
  393. this.getList()
  394. }else if(!status){
  395. closeaudit({
  396. flag: 2,
  397. purchaseReceiptReportList: this.modification,
  398. })
  399. .toPromise()
  400. .then((response) => {
  401. this.$message.success('驳回成功')
  402. this.getList()
  403. })
  404. .catch((req) => {
  405. this.$message.success('驳回失败')
  406. })
  407. }
  408. }
  409. },
  410. //统计审核
  411. handleAudit(){
  412. var that=this
  413. if(this.modification.length==0){
  414. this.$message.warning('请选择一条要审核的条目')
  415. }else{
  416. this.$confirm(`审核通过后,任务将发送给财务,是否确定通过?`, {
  417. cancelButtonText: '取消',
  418. confirmButtonText: '确定',
  419. type: 'warning'
  420. }).then(() => {
  421. // closeaudit({roleFlag:1,flag:1,purchaseClosingReportList:this.modification}).toPromise()
  422. // .then(response => {
  423. // this.$message.success('审核成功')
  424. // this.getList()
  425. // })
  426. that.audit(this.modification[0],0,true,1)
  427. })
  428. }
  429. },
  430. //驳回
  431. handlereject(status){
  432. var that=this
  433. if(this.modification.length==0){
  434. this.$message.warning('请选择要驳回的条目')
  435. }else{
  436. this.$confirm(`是否确定驳回?`, {
  437. cancelButtonText: '取消',
  438. confirmButtonText: '确定',
  439. type: 'warning'
  440. }).then(() => {
  441. // postaudit({roleFlag:status,flag:2,purchaseClosingReportList:this.modification}).toPromise()
  442. // .then(response => {
  443. // this.$message.success('驳回成功')
  444. // this.getList()
  445. // }).catch(req => {
  446. // this.$message.success('驳回失败')
  447. // })
  448. that.audit(this.modification[0],0,false)
  449. })
  450. }
  451. },
  452. handleSelectionChange(val){
  453. this.modification=val
  454. },
  455. //合计
  456. getSummaries(param) {
  457. const { columns, data } = param
  458. const sums = []
  459. columns.forEach((column, index) => {
  460. if (index === 0) {
  461. sums[index] = '合计'
  462. } else if (index === 4 || index === 10 || index === 8 || index === 9|| index === 12 || index === 13 || index === 14 ) {
  463. const values = data.map(item => Number(item[column.property]))
  464. if (!values.every(value => isNaN(value))) {
  465. sums[index] = values.reduce((prev, curr) => {
  466. const value = Number(curr)
  467. if (!isNaN(value)) {
  468. return prev + curr
  469. } else {
  470. return prev
  471. }
  472. }, 0)
  473. } else {
  474. sums[index] = '元'
  475. }
  476. } else {
  477. sums[index] = '--'
  478. }
  479. })
  480. return sums
  481. },
  482. //付款
  483. payment(){
  484. this.$confirm(`确定提交付款信息?`, {
  485. cancelButtonText: '取消',
  486. confirmButtonText: '确定',
  487. type: 'warning'
  488. }).then(() => {
  489. closepaymoney({purchaseClosingReportList:this.modification,money:this.money,paymentDate:this.paymentDate,paymentScreenshot:this.paymentScreenshot}).toPromise()
  490. .then(response => {
  491. this.$message.success('付款成功')
  492. this.dialogFormVisible1=false
  493. this.getList()
  494. })
  495. })
  496. },
  497. //收款
  498. collectment(){
  499. this.$confirm(`确定提交收款信息?`, {
  500. cancelButtonText: '取消',
  501. confirmButtonText: '确定',
  502. type: 'warning'
  503. }).then(() => {
  504. closecollmoney({purchaseClosingReportList:this.modification,money:this.collectmoney,collectionDate:this.collectionDate,collectionScreenshot:this.collectionScreenshot}).toPromise()
  505. .then(response => {
  506. this.$message.success('收款成功')
  507. this.dialogFormVisible2=false
  508. this.getList()
  509. })
  510. })
  511. },
  512. getList() {
  513. // if(this.roleId=='4c2d50d8ff2943c1b7a1e947feefe048'){
  514. // this.roleFlag=1
  515. // }else if(this.roleId=='cca3cf0ca2814d1e918f5b0a4380fe69'){
  516. // this.roleFlag=2
  517. // }else if(this.roleId=='9ad8abb997714ef29068f23c2ad3b125'){
  518. // this.roleFlag=3
  519. // }else if(this.roleId=='3d7b9179552b4c3e9c2d7af43962e2e4'){
  520. // this.roleFlag=4
  521. // }else if(this.roleId=="4ef070439cd64784bce8844fd3f0f8e1"){
  522. // this.roleFlag=''
  523. // }
  524. getclose({
  525. compId: sessionStorage.getItem('ws-pf_compId'),
  526. currentPage: this.currentPage,
  527. pageSize: this.pageSize,
  528. searchType: this.searchType,
  529. contractNo:this.contractNo,
  530. // roleFlag:this.roleFlag
  531. })
  532. .toPromise()
  533. .then(response => {
  534. // for (var i = 0; i < response.records.length; i++) {
  535. // if((response.records[i].transactionPrice-response.records[i].closeRate+response.records[i].basisPrice)*response.records[i].closingQuantity>0){
  536. // response.records[i].amountIngPayable=(response.records[i].transactionPrice-response.records[i].closeRate+response.records[i].basisPrice)*response.records[i].closingQuantity
  537. // }
  538. // else{
  539. // response.records[i].collectionIngPayable=response.records[i].collectionIngPayable+Math.abs((response.records[i].transactionPrice-response.records[i].closeRate+response.records[i].basisPrice)*response.records[i].closingQuantity)
  540. // response.records[i].amountIngPayable=0
  541. // response.records[i].amountEdPayable=0
  542. // response.records[i].amountNotPayable=0
  543. // }
  544. // }
  545. this.warehouseList = response
  546. this.deptBudgetTotal=response.total
  547. })
  548. getpurchasecontractno({
  549. compId: sessionStorage.getItem('ws-pf_compId'),
  550. currentPage: this.currentPage,
  551. pageSize: this.pageSize,
  552. roleFlag:this.roleFlag
  553. })
  554. .toPromise()
  555. .then(response => {
  556. this.contractNoList = response
  557. })
  558. },
  559. handleRemove(file) {
  560. console.log(file)
  561. },
  562. handlePictureCardPreview(file) {
  563. this.paymentScreenshot = file.url
  564. },
  565. handlePictureCardPreview1(file) {
  566. this.collectionScreenshot = file.url
  567. },
  568. handleDownload(file) {
  569. console.log(file)
  570. },
  571. handlepass(){
  572. var that=this
  573. if(this.modification.length==0){
  574. this.$message.warning('请选择要通过的条目')
  575. }else{
  576. this.$confirm(`是否确定通过?`, {
  577. cancelButtonText: '取消',
  578. confirmButtonText: '确定',
  579. type: 'warning'
  580. }).then(() => {
  581. // postaudit({roleFlag:2,flag:1,purchaseClosingReportList:this.modification}).toPromise()
  582. // .then(response => {
  583. // this.$message.success('通过成功')
  584. // this.getList()
  585. // }).catch(req => {
  586. // this.$message.success('通过失败')
  587. // })
  588. that.audit(this.modification[0],0,true)
  589. })
  590. }
  591. },
  592. getSpanArr(data) {
  593. let that = this
  594. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  595. that.spanArr = []
  596. that.pos = 0
  597. // //遍历数据
  598. data.forEach((item, index) => {
  599. //判断是否是第一项
  600. if (index === 0) {
  601. this.spanArr.push(1)
  602. this.pos = 0
  603. } else {
  604. //不是第一项时,就根据标识去存储
  605. if (data[index].warehouseNumViewList.length > 1) {
  606. 查找到符合条件的数据时每次要把之前存储的数据 + 1
  607. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  608. this.spanArr.push(0)
  609. } else {
  610. // 没有符合的数据时,要记住当前的index
  611. this.spanArr.push(1)
  612. this.pos = index
  613. }
  614. }
  615. })
  616. },
  617. dateFormat(fmt, date) {
  618. let ret
  619. const opt = {
  620. 'Y+': date.getFullYear().toString(), // 年
  621. 'm+': (date.getMonth() + 1).toString(), // 月
  622. 'd+': date.getDate().toString(), // 日
  623. 'H+': date.getHours().toString() // 时
  624. // "M+": date.getMinutes().toString(), // 分
  625. // "S+": date.getSeconds().toString() // 秒
  626. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  627. }
  628. for (let k in opt) {
  629. ret = new RegExp('(' + k + ')').exec(fmt)
  630. if (ret) {
  631. fmt = fmt.replace(
  632. ret[1],
  633. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  634. )
  635. }
  636. }
  637. return fmt
  638. },
  639. handleSizeChange(val) {
  640. console.log(`每页 ${val} 条`)
  641. this.pageSize = val
  642. this.getList()
  643. },
  644. handleCurrentChange(val) {
  645. this.currentPage = val
  646. console.log(`当前页: ${val}`)
  647. this.getList()
  648. },
  649. editClick(row) {
  650. var status = ''
  651. if (row.status == '待审核' || row.status == '已完成') {
  652. status = '执行中'
  653. } else if (row.status == '执行中') {
  654. status = '已完成'
  655. }
  656. //cancelButtonClass: "btn-custom-cancel"
  657. this.$confirm(`是否将状态改为${status}`, {
  658. confirmButtonText: '确定',
  659. cancelButtonText: '取消',
  660. type: 'warning'
  661. })
  662. .then(() => {
  663. alsostate({ id: row.id })
  664. .toPromise()
  665. .then(response => {
  666. this.$notify.success({
  667. title: '成功',
  668. message: '状态修改成功'
  669. })
  670. this.getList()
  671. })
  672. .catch(response => {
  673. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  674. })
  675. })
  676. .catch(() => {
  677. return false
  678. })
  679. },
  680. // 关闭 dialog时 处理文件url 初始化upload组件
  681. handleCloe() {
  682. this.dialogViewSpareMoney = false
  683. },
  684. //查找
  685. find() {
  686. this.currentPage = 1
  687. this.getList()
  688. },
  689. async exportlist() {
  690. const { data } = await export1(
  691. {
  692. compId: sessionStorage.getItem('ws-pf_compId'),
  693. contractType: this.contractType,
  694. currentPage: this.currentPage,
  695. pageSize: this.pageSize,
  696. searchType: this.searchType,
  697. searchKeyWord: this.searchKeyWord,
  698. startDate: this.startDate,
  699. endDate: this.endDate
  700. },
  701. {},
  702. { responseType: 'blob' }
  703. ).toPromise()
  704. downloadFile({
  705. res: data,
  706. fileName: `${this.date.year +
  707. (this.date.month ? `-${this.date.month}` : '')}_采购合同`,
  708. type: 'xls'
  709. })
  710. },
  711. total() {}
  712. }
  713. }
  714. </script>
  715. <style lang="scss" scoped>
  716. .connert {
  717. width: 90%;
  718. margin: 0 auto;
  719. }
  720. .vertical-text-left {
  721. width: 62px;
  722. text-align: right;
  723. }
  724. //分页
  725. .el-pagination {
  726. padding: 10px 15px;
  727. margin-bottom: 0;
  728. text-align: center;
  729. }
  730. /deep/.el-pager li.active {
  731. color: #5878e8;
  732. cursor: default;
  733. }
  734. /deep/.el-pager li:hover {
  735. color: #5878e8;
  736. cursor: default;
  737. }
  738. .el-button--default {
  739. color: #8890b1;
  740. border-color: #e8eaf1;
  741. }
  742. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  743. width: 30px;
  744. margin-left: 0;
  745. border-top-left-radius: 0px;
  746. border-bottom-left-radius: 0px;
  747. }
  748. /deep/.findValue .el-input__inner {
  749. border-top-right-radius: 0px;
  750. border-bottom-right-radius: 0px;
  751. width: 385px;
  752. }
  753. .completed.el-button--default {
  754. border-color: #5878e8;
  755. background-color: #f6f7fc;
  756. color: #5878e8;
  757. }
  758. .putstorage.el-button--default,
  759. .deliverystorage.el-button--default {
  760. border-color: #8890b1;
  761. background-color: #fff;
  762. color: #8890b1;
  763. }
  764. /deep/.el-table td,
  765. /deep/.el-table th.is-leaf {
  766. border-right: 1px solid #e9ecf7;
  767. text-align: center;
  768. }
  769. /deep/.el-table tr td:first-child,
  770. /deep/.el-table tr th.is-leaf:first-child {
  771. border-left: 1px solid #e9ecf7;
  772. }
  773. .record,
  774. .adjustment {
  775. display: inline-block;
  776. color: #5878e8;
  777. padding: 0 4px !important;
  778. position: relative;
  779. }
  780. .record:after {
  781. position: absolute;
  782. content: '';
  783. display: block;
  784. top: 5px;
  785. right: -2px;
  786. width: 1px;
  787. height: 12px;
  788. background: #e9ecf7;
  789. }
  790. // .el-row{
  791. // height: 150px;
  792. // }
  793. .base_header_layout .grid-content {
  794. margin-top: 80px;
  795. }
  796. .el-input--small .el-input__inner {
  797. margin-left: 20px;
  798. }
  799. .el-range-editor--small.el-input__inner {
  800. height: 32px;
  801. margin-left: -20%;
  802. }
  803. //执行样式
  804. .executory,
  805. .inExecution,
  806. .done {
  807. width: 6px;
  808. height: 6px;
  809. display: inline-block;
  810. border-radius: 50%;
  811. position: relative;
  812. top: -1px;
  813. font-size: 14px;
  814. }
  815. .executory {
  816. background: #ff9f24;
  817. }
  818. .inExecution {
  819. background: #5878e8;
  820. }
  821. .done {
  822. background: #50cad4;
  823. }
  824. .record,
  825. .adjustment {
  826. display: inline-block;
  827. color: #5878e8;
  828. padding: 0 4px !important;
  829. position: relative;
  830. font-size: 14px;
  831. }
  832. .container {
  833. overflow: scroll;
  834. height: 93vh;
  835. }
  836. .button-container {
  837. display: flex;
  838. flex-wrap: nowrap;
  839. justify-content: space-between;
  840. align-items: center;
  841. background-color: #fff;
  842. width: 100%;
  843. height: 50px;
  844. padding: 0 10px;
  845. & > div {
  846. margin-left: 10px;
  847. display: flex;
  848. flex-wrap: nowrap;
  849. flex-direction: row;
  850. & > span {
  851. line-height: 50px;
  852. }
  853. }
  854. /deep/.auditFlow-box {
  855. position: unset;
  856. margin-left: 10px;
  857. &/deep/.auditFlow-icon {
  858. width: auto;
  859. padding-right: 30px;
  860. }
  861. &/deep/.auditFlow-main {
  862. position: absolute;
  863. }
  864. }
  865. }
  866. .bg-left {
  867. padding-left: 30px;
  868. }
  869. .title {
  870. position: relative;
  871. }
  872. .title::before {
  873. content: '';
  874. display: inline-block;
  875. width: 5px;
  876. height: 30px;
  877. background: #5473e8;
  878. position: absolute;
  879. left: 0;
  880. }
  881. .el-button--primary {
  882. background-color: #5878e8;
  883. border-color: #5878e8;
  884. // margin-left: 85%;
  885. margin-top: 13px;
  886. }
  887. //导航条样式
  888. .el-col-12 {
  889. width: 50%;
  890. height: 60px;
  891. background: #f6f7fc;
  892. border-radius: 4px 4px 1px 1px;
  893. }
  894. .el-input--small .el-input__inner {
  895. height: 32px;
  896. line-height: 32px;
  897. width: 385px;
  898. margin-top: 10px;
  899. }
  900. .bg-bottom {
  901. margin-left: 85%;
  902. }
  903. .but {
  904. margin-left: 30%;
  905. /* margin-top: -32px; */
  906. overflow: auto;
  907. /* float: left; */
  908. /* margin-left: 1px; */
  909. margin-left: -10px;
  910. }
  911. .el-input--small {
  912. font-size: 13px;
  913. width: 390px;
  914. margin-left: 74%;
  915. }
  916. /deep/.el-table .el-table__header .cell,
  917. .el-table .el-table__body .cell {
  918. text-align: center;
  919. }
  920. .el-scrollbar__wrap {
  921. overflow-y: hidden;
  922. }
  923. /deep/.deal {
  924. margin-left: 0%;
  925. width: 64%;
  926. }
  927. .photo {
  928. padding: 0% 34%;
  929. }
  930. .photo1 {
  931. padding: 0 10%;
  932. }
  933. .photo2 {
  934. padding: 0 12%;
  935. }
  936. /deep/.el-form-item--small .el-form-item__label,
  937. .el-form-item--small .el-form-item__content {
  938. text-align: center;
  939. }
  940. hr {
  941. width: 91%;
  942. }
  943. /deep/.deaal {
  944. width: 66%;
  945. margin-left: 9%;
  946. }
  947. .el-date-editor.el-input,
  948. .el-date-editor.el-input__inner,
  949. .el-input-number--small {
  950. width: 123% !important;
  951. }
  952. /deep/.el-table td,
  953. .el-table th.is-leaf {
  954. border-right: 1px solid #e9ecf7;
  955. text-align: center;
  956. height: 40px;
  957. }
  958. // .danjia{
  959. // width: 9px;
  960. // height: 9px;
  961. // margin-left: 40px;
  962. // }
  963. </style>