purchaseClosingCashierList.vue 30 KB

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