salesDeliveryReportList.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241
  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.saleOutReport.view`
  13. " @click="handlepass()">通过</ws-button>
  14. <ws-button type="primary" v-hasPermission="
  15. `report.saleOutReport.view`
  16. " @click="handlereject()">驳回</ws-button>
  17. <ws-button type="primary" v-hasPermission="
  18. `report.saleOutReport.payment`
  19. " @click="handlecollect()">收款</ws-button>
  20. <ws-button type="primary" v-hasPermission="
  21. `report.saleOutReport.draw`
  22. " @click="handleninvoice()">开发票</ws-button>
  23. <ws-button type="primary" v-hasPermission="
  24. `report.saleOutReport.carry`
  25. " @click="amend()">最终结算价</ws-button>
  26. </el-col>
  27. <el-col style='text-align:right;line-height:60px;padding-right:10px;' :span="8">
  28. <ws-select
  29. v-model="contractNo"
  30. placeholder="请选择合同"
  31. clearable
  32. @change='contractchange'
  33. maxlength="500"
  34. type="input"
  35. class="findValue"
  36. >
  37. <ws-option
  38. key=""
  39. label="全部合同"
  40. value=""
  41. />
  42. <ws-option
  43. v-if= 'item.reportStatus'
  44. v-for="item in contractNoList"
  45. :key="item.constKey"
  46. :label="item.contractNo+'('+item.reportStatus+')'"
  47. :value="item.contractNo"
  48. />
  49. <ws-option
  50. v-if= '!item.reportStatus'
  51. v-for="item in contractNoList"
  52. :key="item.constKey"
  53. :label="item.contractNo"
  54. :value="item.contractNo"
  55. />
  56. </ws-select>
  57. </el-col>
  58. </el-row>
  59. <div v-if='contractNo!=""'>
  60. <span v-if='orderList.transactionsNumber'>合同重量: {{orderList.transactionsNumber}} 吨</span>
  61. <span v-else>合同重量: 0 吨</span>
  62. <span v-if='orderList.cumulativeTurnover'>成交量: {{orderList.cumulativeTurnover}} 吨</span>
  63. <span v-else>成交量: 0 吨</span>
  64. <span v-if='orderList.closedPosition'>已平仓: {{orderList.closedPosition}} 吨</span>
  65. <span v-else>已平仓: 0 吨</span>
  66. <span v-if='orderList.stockOutQuantity'>出库量: {{orderList.stockOutQuantity}} 吨</span>
  67. <span v-else>出库量: 0 吨</span>
  68. </div>
  69. <el-table
  70. class="wenzi"
  71. :data="warehouseList.records"
  72. style="width: 100%; margin-top: 20px"
  73. ref="warehouseList"
  74. border
  75. :summary-method="getSummaries"
  76. show-summary
  77. @selection-change="handleSelectionChange"
  78. >
  79. <el-table-column :selectable='selectInit' type="selection" width="55"></el-table-column>
  80. <el-table-column type="index" label="序号" width="50"></el-table-column>
  81. <el-table-column class="table_td" prop="contractNo" label="合同编号"></el-table-column>
  82. <el-table-column class="table_td" prop="goodsName" label="货名"></el-table-column>
  83. <el-table-column class="table_td" prop="positionNumber" label="仓位号"></el-table-column>
  84. <el-table-column class="table_td" prop="carNo" label="车牌号">
  85. <template slot-scope="scope">
  86. {{scope.row.carNo}}({{scope.row.tranCarNo}})
  87. </template>
  88. </el-table-column>
  89. <el-table-column class="table_td" prop="retrievalDate" label="出库日期"></el-table-column>
  90. <el-table-column width='100' class="table_td" prop="protein" label="蛋白(%)>="></el-table-column>
  91. <el-table-column width='100' class="table_td" prop="waterContent" label="水分(%)>="></el-table-column>
  92. <el-table-column width='100' class="table_td" prop="unitPrice" label="单价(元/吨)"></el-table-column>
  93. <el-table-column width='100' class="table_td" prop="basisPrice" label="基差(元/吨)"></el-table-column>
  94. <el-table-column width='100' class="table_td" prop="invoiceFee" label="发票费(元/吨)"></el-table-column>
  95. <el-table-column width='120' class="table_td" prop="settlementPrice" label="结算单价(元/吨)"></el-table-column>
  96. <el-table-column class="table_td" prop="netWeight" label="净重(吨)"></el-table-column>
  97. <el-table-column width='100' class="table_td" label="应收金额(元)" prop="collectionIngPayable"></el-table-column>
  98. <el-table-column width='100' class="table_td" label="已收金额(元)" prop="collectionEdPayable"></el-table-column>
  99. <el-table-column width='100' class="table_td" label="未收金额(元)" prop="collectionNotPayable"></el-table-column>
  100. <el-table-column class="table_td" label="收款日期" prop="collectionDate"></el-table-column>
  101. <el-table-column class="table_td" label="客户确认" prop="customerConfirmationStatus"></el-table-column>
  102. <el-table-column class="table_td" label="客户" prop="customerName"></el-table-column>
  103. <el-table-column class="table_td" label="库点" prop="warehouseName"></el-table-column>
  104. <el-table-column width='100' class="table_td" label="已开发票(元)" prop="alreadyInvoice">
  105. <template slot-scope="scope">
  106. {{ scope.row.alreadyInvoice }}
  107. <img
  108. width="17"
  109. height="18"
  110. style="vertical-align: text-top; position: relative; top: -1px"
  111. src="../../../public/img/edit.png"
  112. @click="editClickInvoice(scope.row)"
  113. alt=""
  114. />
  115. </template></el-table-column>
  116. <el-table-column label="状态" prop="status">
  117. <template slot-scope="scope">
  118. <span v-if='scope.row.approveStatus!=null'>{{ scope.row.approveStatus }}</span>
  119. <span v-else>{{ scope.row.status }}</span>
  120. </template>
  121. </el-table-column>
  122. </el-table>
  123. <!-- 页数 -->
  124. <el-pagination
  125. @size-change="handleSizeChange"
  126. @current-change="handleCurrentChange"
  127. :current-page="currentPage"
  128. :page-size="pageSize"
  129. layout="total, sizes, prev, pager, next, jumper"
  130. :total="deptBudgetTotal"
  131. ></el-pagination>
  132. </el-scrollbar>
  133. <!-- 收款 -->
  134. <el-dialog
  135. width="25%"
  136. title="收款"
  137. :visible.sync="dialogFormVisible1"
  138. :append-to-body="true"
  139. >
  140. <el-form :model="form">
  141. <el-form-item label="未收金额(元)" :label-width="formLabelWidth">
  142. <span>{{collectionNotPayable}}</span>
  143. <!-- <el-input v-model="form.region" autocomplete="off" class="deal"></el-input> -->
  144. </el-form-item>
  145. <el-form-item label="本次收款金额" :label-width="formLabelWidth">
  146. <el-input
  147. v-model="money"
  148. autocomplete="off"
  149. placeholder="请输入本次收款金额"
  150. class="deal"
  151. ></el-input>
  152. </el-form-item>
  153. <el-form-item
  154. label="收款日期"
  155. prop="collectionDate"
  156. :label-width="formLabelWidth"
  157. class="deal"
  158. >
  159. <ws-date-picker
  160. v-model="deptBudgetList.collectionDate"
  161. type="date"
  162. placeholder="请选择收款日期"
  163. value-format="yyyy-MM-dd"
  164. class="deal"
  165. />
  166. </el-form-item>
  167. <el-form-item label="上传收款截图" :label-width="formLabelWidth">
  168. <el-upload
  169. action="https://www.zthymaoyi.com/upload/admin"
  170. list-type="picture-card"
  171. :on-success="handlePictureCardPreview"
  172. :on-remove="handleRemove"
  173. class="photo2"
  174. >
  175. <i class="el-icon-plus"></i>
  176. </el-upload>
  177. </el-form-item>
  178. </el-form>
  179. <div slot="footer" class="dialog-footer">
  180. <el-button @click="dialogFormVisible1 = false">取 消</el-button>
  181. <el-button type="primary" @click="collectment">提 交</el-button>
  182. </div>
  183. </el-dialog>
  184. <!-- 批量开发票 -->
  185. <el-dialog
  186. width="30%"
  187. title="批量开发票"
  188. :visible.sync="dialogFormVisible2"
  189. :append-to-body="true"
  190. >
  191. <el-form :model="form">
  192. <el-form-item label="发票金额(元)" :label-width="formLabelWidth">
  193. <span>{{collectionEdPayable}}</span>
  194. </el-form-item>
  195. </el-form>
  196. <div slot="footer" class="dialog-footer">
  197. <el-button @click="dialogFormVisible2 = false">取 消</el-button>
  198. <el-button type="primary" @click="submitBatchInvoice()">提 交</el-button>
  199. </div>
  200. </el-dialog>
  201. <!-- 开发票 -->
  202. <el-dialog
  203. width="30%"
  204. title="开发票"
  205. :visible.sync="dialogFormVisible3"
  206. :append-to-body="true"
  207. >
  208. <el-form :model="form">
  209. <el-form-item label="可开发票金额(元)" :label-width="formLabelWidth">
  210. <span>{{collectionEdPayable}}</span>
  211. </el-form-item>
  212. <el-form-item label="实际发票金额(元)" :label-width="formLabelWidth">
  213. <el-input v-model="alreadyInvoice" autocomplete="off" class="deal" placeholder="请输入本次收款金额"></el-input>
  214. </el-form-item>
  215. </el-form>
  216. <div slot="footer" class="dialog-footer">
  217. <el-button @click="dialogFormVisible3 = false">取 消</el-button>
  218. <el-button type="primary" @click="submitInvoice()">提 交</el-button>
  219. </div>
  220. </el-dialog>
  221. <!-- 最终结算价 -->
  222. <el-dialog
  223. width="30%"
  224. title="最终结算价"
  225. :visible.sync="dialogFormVisible5"
  226. :append-to-body="true"
  227. >
  228. <el-form :rules="rules">
  229. <el-form-item label="单价" :label-width="formLabelWidth">
  230. <el-input @input="getprice" v-model="amendlist.unitPrice" autocomplete="off" class="deal"></el-input>
  231. </el-form-item>
  232. <el-form-item label="基差" :label-width="formLabelWidth">
  233. <el-input @input="getbasis" v-model="amendlist.basisPrice" autocomplete="off" class="deal"></el-input>
  234. </el-form-item>
  235. <el-form-item label="发票费" :label-width="formLabelWidth">
  236. <el-input @input="getinvoice" v-model="amendlist.invoiceFee" autocomplete="off" class="deal"></el-input>
  237. </el-form-item>
  238. <el-form-item label="最终结算价" :label-width="formLabelWidth">
  239. <el-input readonly="readonly" v-model="amendlist.settlementPrice" autocomplete="off" class="deal" placeholder="不可编辑,自动计算"></el-input>
  240. </el-form-item>
  241. </el-form>
  242. <div slot="footer" class="dialog-footer">
  243. <el-button @click="dialogFormVisible5 = false">取 消</el-button>
  244. <el-button type="primary" @click="amendconfirm">提 交</el-button>
  245. </div>
  246. </el-dialog>
  247. </div>
  248. <!-- </div> -->
  249. </template>
  250. <script>
  251. import {
  252. salelist,
  253. getsaleoutcontractno,
  254. finalsettlementprice,
  255. issueapproval,
  256. getsaleorder,
  257. cashierpayment,
  258. salesinvoicing,
  259. salesbatchinvoicing
  260. } from '@/model/statisticalReport/index'
  261. import { downloadFile } from '@/utils/batchDown'
  262. import Pagination from '@/components/Pagination'
  263. import WsUpload from '@/components/WsUpload'
  264. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  265. export default {
  266. name: 'viewSpareMoney',
  267. components: {
  268. WsUpload,
  269. Pagination
  270. },
  271. watch: {
  272. vesselId(val) {
  273. this.getList()
  274. },
  275. isShow(val) {
  276. this.showType = val
  277. }
  278. },
  279. data() {
  280. return {
  281. checked: true,
  282. dialogFormVisible1: false,
  283. dialogFormVisible2: false,
  284. dialogFormVisible3: false,
  285. dialogFormVisible4: false,
  286. dialogFormVisible5: false,
  287. dialogFormVisible6: false,
  288. dialogFormVisible7: false,
  289. dialogFormVisible8: false,
  290. dialogVisible: false,
  291. collectionEdPayable:0,
  292. collectionNotPayable:0,
  293. alreadyInvoice:0,
  294. form: {
  295. transactionPrice: '',
  296. transactionsNumber: '',
  297. basis: '',
  298. submissionDate: ''
  299. // delivery: false,
  300. // type: [],
  301. // resource: '',
  302. // desc: ''
  303. },
  304. currect:true,
  305. formLabelWidth: '120px',
  306. barWidth: 0,
  307. barHeight: 0,
  308. retioX: 1,
  309. ratioY: 1,
  310. orderList:{},
  311. isTaped: false,
  312. isHover: false,
  313. isShow: !this.autohide,
  314. //弹出框
  315. dialogViewSpareMoney: false,
  316. contractNoList:[],
  317. // 是否显示
  318. showType: true,
  319. // 年
  320. year: '',
  321. pickerOptions: {},
  322. value2: '',
  323. deptBudgetTotal: 0,
  324. currentPage: 1,
  325. tranTypeKey: 1,
  326. collectmoney:0,
  327. pageSize: 10,
  328. searchType: '',
  329. searchTypeText: '未完成',
  330. searchKeyWord: '',
  331. contractType: 2,
  332. enter: {
  333. closePositionList: []
  334. },
  335. // 提交类型
  336. submitType: true,
  337. size: 10,
  338. spanArr: [],
  339. contractNo: '',
  340. inOutTaskNo: '',
  341. compId: sessionStorage.getItem('ws-pf_compId'),
  342. deptCircularPage: {},
  343. warehouseList: [],
  344. deptBudgetList: {},
  345. rules: {
  346. settlementPrice: [
  347. {
  348. required: true,
  349. type: 'number',
  350. trigger: 'blur'
  351. }
  352. ]
  353. },
  354. pcFlag: 1,
  355. modification:[],
  356. amendlist:{},
  357. money: '',
  358. roleFlag:1,
  359. roleId: sessionStorage.getItem('ws-pf_roleId'),
  360. collectionScreenshot: '',
  361. salesDeliveryReportList: [],
  362. salesDeliveryReport: {
  363. salesDeliveryReportList: [],
  364. money: '',
  365. collectionEdPayable:0,
  366. collectionNotPayable:0,
  367. collectionDate: '',
  368. id: '',
  369. invoiceType: '',
  370. },
  371. historyList: [],
  372. collectionScreenshotUrls: [],
  373. pickerBeginDateBefore: {
  374. disabledDate: time => {
  375. return time.getTime() > Date.now()
  376. }
  377. },
  378. accessoryTFs: false
  379. }
  380. },
  381. activated() {
  382. // this.loaddata()
  383. console.log(1111)
  384. this.getList()
  385. this.showType = this.isShow
  386. },
  387. // computed:{
  388. // sum:function(){
  389. // this.amendlist.settlementPrice = Number(
  390. // this.amendlist.unitPrice )+ Number(this.amendlist.basisPrice )+ Number(this.amendlist.invoiceFee)
  391. // }
  392. // },
  393. methods: {
  394. selectInit(row){
  395. //在这里一定要记得类型匹配的上。
  396. if(row.approveStatus==null){
  397. return true
  398. }else if(row.approveStatus!=null){
  399. if(row.taskId==null){
  400. return false
  401. }else{
  402. return true
  403. }
  404. }
  405. },
  406. audit(item,index,status){
  407. if(index<this.modification.length){
  408. posthandle({ taskId: item.taskId,
  409. approved: status,
  410. auditMind: '34',
  411. needReapply: false,})
  412. .toPromise()
  413. .then((response) => {
  414. this.audit(this.modification[index+1],index+1,status)
  415. }).catch((req) => {
  416. this.$message.warning(req.message)
  417. })
  418. }else{
  419. if(status){
  420. this.$message.success('通过成功')
  421. this.getList()
  422. }else if(!status){
  423. issueapproval({
  424. flag: 2,
  425. purchaseReceiptReportList: this.modification,
  426. })
  427. .toPromise()
  428. .then((response) => {
  429. this.$message.success('驳回成功')
  430. this.getList()
  431. })
  432. .catch((req) => {
  433. this.$message.success('驳回失败')
  434. })
  435. }
  436. }
  437. },
  438. handlereject(status){
  439. var that=this
  440. if(this.modification.length==0){
  441. this.$message.warning('请选择要驳回的条目')
  442. }else{
  443. this.$confirm(`是否确定驳回?`, {
  444. cancelButtonText: '取消',
  445. confirmButtonText: '确定',
  446. type: 'warning'
  447. }).then(() => {
  448. that.audit(this.modification[0],0,false)
  449. // issueapproval({roleFlag:status,flag:2,salesDeliveryReportList:this.modification}).toPromise()
  450. // .then(response => {
  451. // this.$message.success('驳回成功')
  452. // this.getList()
  453. // }).catch(req => {
  454. // this.$message.success('驳回失败')
  455. // })
  456. })
  457. }
  458. },
  459. handlepass(){
  460. var that=this
  461. if(this.modification.length==0){
  462. this.$message.warning('请选择要通过的条目')
  463. }else{
  464. this.$confirm(`是否确定通过?`, {
  465. cancelButtonText: '取消',
  466. confirmButtonText: '确定',
  467. type: 'warning'
  468. }).then(() => {
  469. // issueapproval({roleFlag:2,flag:1,salesDeliveryReportList:this.modification}).toPromise()
  470. // .then(response => {
  471. // this.$message.success('通过成功')
  472. // this.getList()
  473. // }).catch(req => {
  474. // this.$message.success('通过失败')
  475. // })
  476. that.audit(this.modification[0],0,false)
  477. })
  478. }
  479. },
  480. //最终结算价
  481. amendconfirm(){
  482. this.amendlist.id=this.modification[0].id
  483. finalsettlementprice(this.amendlist).toPromise()
  484. .then(response => {
  485. this.$message.success('修改成功')
  486. this.dialogFormVisible5=false
  487. this.getList()
  488. })
  489. },
  490. handleSelectionChange(val){
  491. this.modification=val
  492. },
  493. handlestatus(status){
  494. this.searchType=status
  495. this.getList()
  496. },
  497. contractchange(e){
  498. this.contractNo=e
  499. getsaleorder({
  500. contractNo: this.contractNo
  501. })
  502. .toPromise()
  503. .then((response) => {
  504. if(response!=null){
  505. this.orderList = response
  506. }
  507. })
  508. this.getList()
  509. },
  510. updated() {
  511. this.$nextTick(() => {
  512. this.$refs.warehouseList.doLayout()
  513. })
  514. },
  515. //合计
  516. getSummaries(param) {
  517. const { columns, data } = param
  518. const sums = []
  519. columns.forEach((column, index) => {
  520. if (index === 0) {
  521. sums[index] = '合计'
  522. } else if (index === 13 || index === 14 || index === 15 || index === 16||index===21) {
  523. const values = data.map(item => Number(item[column.property]))
  524. if (!values.every(value => isNaN(value))) {
  525. sums[index] = values.reduce((prev, curr) => {
  526. const value = Number(curr)
  527. if (!isNaN(value)) {
  528. return prev + curr
  529. } else {
  530. return prev
  531. }
  532. }, 0)
  533. } else {
  534. sums[index] = '元'
  535. }
  536. } else {
  537. sums[index] = '--'
  538. }
  539. })
  540. return sums
  541. },
  542. handlecollect(){
  543. this.collectionNotPayable = 0
  544. if(this.modification.length==0){
  545. this.$message.warning('请选择一条要收款的条目')
  546. }
  547. else{
  548. this.dialogFormVisible1=true
  549. for(var i=0;i<this.modification.length;i++){
  550.        this.collectionNotPayable +=this.modification[i].collectionNotPayable
  551.       }
  552. }
  553. },
  554. //收款
  555. collectment(){
  556. this.salesDeliveryReport.money = this.money
  557. this.salesDeliveryReport.collectionDate = this.collectionDate
  558. if (this.modification.length == 0) {
  559. this.$message.warning('请选择一条要收款的条目')
  560. } else {
  561. if (
  562. this.money < 0 ||
  563. (String(this.money).indexOf('.') != -1 &&
  564. String(this.money).length - (String(this.money).indexOf('.') + 1) >
  565. 2)
  566. ) {
  567. this.$message({
  568. message: '收款金额输入错误',
  569. type: 'warning',
  570. })
  571. return
  572. }
  573. if (this.money) {
  574. if (isNaN(this.money)) {
  575. this.$message({
  576. message: '收款金额非数字!',
  577. type: 'warning',
  578. })
  579. return
  580. }
  581. }
  582. if (!this.money) {
  583. this.$message({
  584. message: '收款金额不能为空!',
  585. type: 'warning',
  586. })
  587. return
  588. }
  589. if (this.money > this.modification[0].collectionNotPayable) {
  590. this.$message({
  591. message: '收款金额不能大于未收金额!',
  592. type: 'warning',
  593. })
  594. return
  595. }
  596. this.$confirm(`确定提交收款信息?`, {
  597. cancelButtonText: '取消',
  598. confirmButtonText: '确定',
  599. type: 'warning',
  600. }).then(() => {
  601. cashierpayment({
  602. salesDeliveryReportList: this.modification,
  603. collectionEdPayable: this.modification[0].collectionEdPayable,
  604. collectionNotPayable: this.modification[0].collectionNotPayable,
  605. money: this.money,
  606. collectionDate: this.collectionDate,
  607. collectionScreenshot: this.collectionScreenshot,
  608. })
  609. .toPromise()
  610. .then((response) => {
  611. this.$notify.success({
  612. title: '成功',
  613. message: '收款成功',
  614. })
  615. this.salesDeliveryReportList = {}
  616. this.money = ''
  617. this.collectionDate = ''
  618. this.dialogFormVisible1 = false
  619. this.getList()
  620. })
  621. .catch((response) => {
  622. console.log(response)
  623. EventBus.$emit('error', response.message)
  624. })
  625. })
  626. }
  627. },
  628. //批量开发票
  629. handleninvoice() {
  630. this.collectionEdPayable = 0
  631. for (var i = 0; i < this.modification.length; i++) {
  632. this.collectionEdPayable += this.modification[i].collectionEdPayable
  633. }
  634. this.dialogFormVisible2 = true
  635. },
  636. submitBatchInvoice() {
  637. if (this.modification.length == 0) {
  638. this.$message.warning('请选择一条要开发票的条目')
  639. } else if (this.modification[0].collectionEdPayable < 0) {
  640. this.$message.warning('请选择一条已付款的条目')
  641. } else {
  642. this.$confirm(`确定提交发票信息?`, {
  643. cancelButtonText: '取消',
  644. confirmButtonText: '确定',
  645. type: 'warning',
  646. }).then(() => {
  647. salesbatchinvoicing({
  648. salesDeliveryReportList: this.modification,
  649. })
  650. .toPromise()
  651. .then((response) => {
  652. this.$notify.success({
  653. title: '成功',
  654. message: '提交成功',
  655. })
  656. this.dialogFormVisible2 = false
  657. this.getList()
  658. })
  659. .catch((response) => {
  660. console.log(response)
  661. EventBus.$emit('error', response.message)
  662. })
  663. })
  664. }
  665. },
  666. //开发票
  667. editClickInvoice(row) {
  668. this.id = row.id
  669. this.alreadyInvoice1 = row.alreadyInvoice
  670. this.amountEdPayable = row.amountEdPayable
  671. this.amountNotPayable = row.amountNotPayable
  672. this.dialogFormVisible3 = 'true'
  673. },
  674. submitInvoice() {
  675. if (this.collectionEdPayable < 0) {
  676. this.$message.warning('请选择一条已付款的条目')
  677. } else {
  678. if (
  679. this.alreadyInvoice < 0 ||
  680. this.alreadyInvoice > this.collectionEdPayable - this.alreadyInvoice1 ||
  681. (String(this.alreadyInvoice).indexOf('.') != -1 &&
  682. String(this.alreadyInvoice).length -
  683. (String(this.alreadyInvoice).indexOf('.') + 1) >
  684. 2)
  685. ) {
  686. this.$message({
  687. message: '金额输入错误',
  688. type: 'warning',
  689. })
  690. return
  691. }
  692. if (this.alreadyInvoice) {
  693. if (isNaN(this.alreadyInvoice)) {
  694. this.$message({
  695. message: '金额非数字!',
  696. type: 'warning',
  697. })
  698. return
  699. }
  700. }
  701. if (!this.alreadyInvoice) {
  702. this.$message({
  703. message: '金额不能为空!',
  704. type: 'warning',
  705. })
  706. return
  707. }
  708. this.$confirm(`确定提交发票信息?`, {
  709. cancelButtonText: '取消',
  710. confirmButtonText: '确定',
  711. type: 'warning',
  712. }).then(() => {
  713. salesinvoicing({
  714. id: this.id,
  715. invoiceType: this.invoiceType,
  716. alreadyInvoice: this.alreadyInvoice,
  717. collectionEdPayable: this.collectionEdPayable,
  718. collectionNotPayable: this.collectionNotPayable,
  719. })
  720. .toPromise()
  721. .then((response) => {
  722. this.$notify.success({
  723. title: '成功',
  724. message: '提交成功',
  725. })
  726. this.dialogFormVisible3 = false
  727. this.getList()
  728. })
  729. .catch((response) => {
  730. console.log(response)
  731. EventBus.$emit('error', response.message)
  732. })
  733. })
  734. }
  735. },
  736. //列表
  737. getList() {
  738. // if(this.roleId=='4c2d50d8ff2943c1b7a1e947feefe048'){
  739. // this.roleFlag=1
  740. // }else if(this.roleId=='cca3cf0ca2814d1e918f5b0a4380fe69'){
  741. // this.roleFlag=2
  742. // }else if(this.roleId=='9ad8abb997714ef29068f23c2ad3b125'){
  743. // this.roleFlag=3
  744. // }else if(this.roleId=='3d7b9179552b4c3e9c2d7af43962e2e4'){
  745. // this.roleFlag=4
  746. // }else if(this.roleId=="4ef070439cd64784bce8844fd3f0f8e1"){
  747. // this.roleFlag=''
  748. // }
  749. salelist({
  750. compId: sessionStorage.getItem('ws-pf_compId'),
  751. currentPage: this.currentPage,
  752. pageSize: this.pageSize,
  753. searchType: this.searchType,
  754. contractNo:this.contractNo,
  755. // roleFlag:this.roleFlag
  756. })
  757. .toPromise()
  758. .then(response => {
  759. for (var i = 0; i < response.records.length; i++) {
  760. response.records[i].settlementPrice = response.records[i].unitPrice
  761. + response.records[i].basisPrice
  762. + response.records[i].invoiceFee
  763. }
  764. this.deptBudgetTotal=response.total
  765. this.warehouseList = response
  766. })
  767. getsaleoutcontractno({
  768. compId: sessionStorage.getItem('ws-pf_compId'),
  769. currentPage: this.currentPage,
  770. pageSize: this.pageSize,
  771. roleFlag:this.roleFlag
  772. })
  773. .toPromise()
  774. .then(response => {
  775. this.contractNoList = response
  776. })
  777. },
  778. //最终结算价
  779. amend(){
  780. if(this.modification.length==0){
  781. this.$message.warning('请选择一条要修改最终结算价的条目')
  782. }
  783. else{
  784. this.dialogFormVisible5=true
  785. }
  786. },
  787. getprice(e) {
  788. if (this.amendlist.unitPrice && this.amendlist.basisPrice && this.amendlist.invoiceFee) {
  789. this.amendlist.settlementPrice = Number(
  790. this.amendlist.unitPrice )+ Number(this.amendlist.basisPrice )+ Number(this.amendlist.invoiceFee)
  791. }
  792. },
  793. getbasis(e) {
  794. console.log(e)
  795. if (this.amendlist.unitPrice && this.amendlist.basisPrice && this.amendlist.invoiceFee) {
  796. this.amendlist.settlementPrice = Number(
  797. this.amendlist.unitPrice) + Number(this.amendlist.basisPrice) + Number(this.amendlist.invoiceFee
  798. )
  799. }
  800. },
  801. getinvoice(e) {
  802. if (this.amendlist.unitPrice && this.amendlist.basisPrice && this.amendlist.invoiceFee) {
  803. this.amendlist.settlementPrice = Number(
  804. this.amendlist.unitPrice) + Number(this.amendlist.basisPrice )+ Number(this.amendlist.invoiceFee
  805. )
  806. }
  807. },
  808. handleRemove(file) {
  809. console.log(file)
  810. },
  811. handlePictureCardPreview(file) {
  812. this.collectionScreenshot = file.url
  813. },
  814. handleDownload(file) {
  815. console.log(file)
  816. },
  817. getSpanArr(data) {
  818. let that = this
  819. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  820. that.spanArr = []
  821. that.pos = 0
  822. // //遍历数据
  823. data.forEach((item, index) => {
  824. //判断是否是第一项
  825. if (index === 0) {
  826. this.spanArr.push(1)
  827. this.pos = 0
  828. } else {
  829. //不是第一项时,就根据标识去存储
  830. if (data[index].warehouseNumViewList.length > 1) {
  831. 查找到符合条件的数据时每次要把之前存储的数据 + 1
  832. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  833. this.spanArr.push(0)
  834. } else {
  835. // 没有符合的数据时,要记住当前的index
  836. this.spanArr.push(1)
  837. this.pos = index
  838. }
  839. }
  840. })
  841. },
  842. //查看
  843. handleLook(row) {
  844. this.$router.push({
  845. path: 'warehouseManagementPutOutLook',
  846. query: {
  847. relevanceId: row.relevanceId
  848. }
  849. })
  850. },
  851. //返回
  852. revert() {
  853. this.$router.push({ path: 'warehouseManagementList' })
  854. },
  855. dateFormat(fmt, date) {
  856. let ret
  857. const opt = {
  858. 'Y+': date.getFullYear().toString(), // 年
  859. 'm+': (date.getMonth() + 1).toString(), // 月
  860. 'd+': date.getDate().toString(), // 日
  861. 'H+': date.getHours().toString() // 时
  862. // "M+": date.getMinutes().toString(), // 分
  863. // "S+": date.getSeconds().toString() // 秒
  864. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  865. }
  866. for (let k in opt) {
  867. ret = new RegExp('(' + k + ')').exec(fmt)
  868. if (ret) {
  869. fmt = fmt.replace(
  870. ret[1],
  871. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  872. )
  873. }
  874. }
  875. return fmt
  876. },
  877. handleClose() {
  878. this.accessoryTFs = false
  879. },
  880. handleSizeChange(val) {
  881. console.log(`每页 ${val} 条`)
  882. this.pageSize = val
  883. this.getList()
  884. },
  885. handleCurrentChange(val) {
  886. this.currentPage = val
  887. console.log(`当前页: ${val}`)
  888. this.getList()
  889. },
  890. editClick(row) {
  891. var status = ''
  892. if (row.status == '待审核' || row.status == '已完成') {
  893. status = '执行中'
  894. } else if (row.status == '执行中') {
  895. status = '已完成'
  896. }
  897. //cancelButtonClass: "btn-custom-cancel"
  898. this.$confirm(`是否将状态改为${status}`, {
  899. confirmButtonText: '确定',
  900. cancelButtonText: '取消',
  901. type: 'warning'
  902. })
  903. .then(() => {
  904. alsostate({ id: row.id })
  905. .toPromise()
  906. .then(response => {
  907. this.$notify.success({
  908. title: '成功',
  909. message: '状态修改成功'
  910. })
  911. this.getList()
  912. })
  913. .catch(response => {
  914. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  915. })
  916. })
  917. .catch(() => {
  918. return false
  919. })
  920. },
  921. selecttaskType(e) {
  922. for (var i = 0; i < this.taskTypeList.length; i++) {
  923. if (this.taskTypeList[i].value == e) {
  924. this.searchType = this.taskTypeList[i].type
  925. }
  926. }
  927. },
  928. handleExamine(row) {
  929. this.$router.push({
  930. name: 'salesContractExamine',
  931. query: { id: row.id }
  932. })
  933. },
  934. // 关闭 dialog时 处理文件url 初始化upload组件
  935. handleCloe() {
  936. this.dialogViewSpareMoney = false
  937. },
  938. history(row) {
  939. billoperatehis({ id: row.id })
  940. .toPromise()
  941. .then(response => {
  942. this.historyList = response
  943. })
  944. },
  945. //查找
  946. find() {
  947. this.currentPage = 1
  948. this.getList()
  949. },
  950. async exportlist() {
  951. const { data } = await export1(
  952. {
  953. compId: sessionStorage.getItem('ws-pf_compId'),
  954. contractType: this.contractType,
  955. currentPage: this.currentPage,
  956. pageSize: this.pageSize,
  957. searchType: this.searchType,
  958. searchKeyWord: this.searchKeyWord,
  959. startDate: this.startDate,
  960. endDate: this.endDate
  961. },
  962. {},
  963. { responseType: 'blob' }
  964. ).toPromise()
  965. downloadFile({
  966. res: data,
  967. fileName: `${this.date.year +
  968. (this.date.month ? `-${this.date.month}` : '')}_采购合同`,
  969. type: 'xls'
  970. })
  971. },
  972. total() {}
  973. }
  974. }
  975. </script>
  976. <style lang="scss" scoped>
  977. .connert {
  978. width: 90%;
  979. margin: 0 auto;
  980. }
  981. .vertical-text-left {
  982. width: 62px;
  983. text-align: right;
  984. }
  985. //分页
  986. .el-pagination {
  987. padding: 10px 15px;
  988. margin-bottom: 0;
  989. text-align: center;
  990. }
  991. /deep/.el-pager li.active {
  992. color: #5878e8;
  993. cursor: default;
  994. }
  995. /deep/.el-pager li:hover {
  996. color: #5878e8;
  997. cursor: default;
  998. }
  999. .el-button--default {
  1000. color: #8890b1;
  1001. border-color: #e8eaf1;
  1002. }
  1003. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  1004. width: 30px;
  1005. margin-left: 0;
  1006. border-top-left-radius: 0px;
  1007. border-bottom-left-radius: 0px;
  1008. }
  1009. /deep/.findValue .el-input__inner {
  1010. border-top-right-radius: 0px;
  1011. border-bottom-right-radius: 0px;
  1012. width: 385px;
  1013. }
  1014. .completed.el-button--default {
  1015. border-color: #5878e8;
  1016. background-color: #f6f7fc;
  1017. color: #5878e8;
  1018. }
  1019. .putstorage.el-button--default,
  1020. .deliverystorage.el-button--default {
  1021. border-color: #8890b1;
  1022. background-color: #fff;
  1023. color: #8890b1;
  1024. }
  1025. /deep/.el-table td,
  1026. /deep/.el-table th.is-leaf {
  1027. border-right: 1px solid #e9ecf7;
  1028. text-align: center;
  1029. }
  1030. /deep/.el-table tr td:first-child,
  1031. /deep/.el-table tr th.is-leaf:first-child {
  1032. border-left: 1px solid #e9ecf7;
  1033. }
  1034. .record,
  1035. .adjustment {
  1036. display: inline-block;
  1037. color: #5878e8;
  1038. padding: 0 4px !important;
  1039. position: relative;
  1040. }
  1041. .record:after {
  1042. position: absolute;
  1043. content: '';
  1044. display: block;
  1045. top: 5px;
  1046. right: -2px;
  1047. width: 1px;
  1048. height: 12px;
  1049. background: #e9ecf7;
  1050. }
  1051. // .el-row{
  1052. // height: 150px;
  1053. // }
  1054. .base_header_layout .grid-content {
  1055. margin-top: 80px;
  1056. }
  1057. .el-input--small .el-input__inner {
  1058. margin-left: 20px;
  1059. }
  1060. .el-range-editor--small.el-input__inner {
  1061. height: 32px;
  1062. margin-left: -20%;
  1063. }
  1064. //执行样式
  1065. .executory,
  1066. .inExecution,
  1067. .done {
  1068. width: 6px;
  1069. height: 6px;
  1070. display: inline-block;
  1071. border-radius: 50%;
  1072. position: relative;
  1073. top: -1px;
  1074. font-size: 14px;
  1075. }
  1076. .executory {
  1077. background: #ff9f24;
  1078. }
  1079. .inExecution {
  1080. background: #5878e8;
  1081. }
  1082. .done {
  1083. background: #50cad4;
  1084. }
  1085. .record,
  1086. .adjustment {
  1087. display: inline-block;
  1088. color: #5878e8;
  1089. padding: 0 4px !important;
  1090. position: relative;
  1091. font-size: 14px;
  1092. }
  1093. .container {
  1094. overflow: scroll;
  1095. height: 93vh;
  1096. }
  1097. .button-container {
  1098. display: flex;
  1099. flex-wrap: nowrap;
  1100. justify-content: space-between;
  1101. align-items: center;
  1102. background-color: #fff;
  1103. width: 100%;
  1104. height: 50px;
  1105. padding: 0 10px;
  1106. & > div {
  1107. margin-left: 10px;
  1108. display: flex;
  1109. flex-wrap: nowrap;
  1110. flex-direction: row;
  1111. & > span {
  1112. line-height: 50px;
  1113. }
  1114. }
  1115. /deep/.auditFlow-box {
  1116. position: unset;
  1117. margin-left: 10px;
  1118. &/deep/.auditFlow-icon {
  1119. width: auto;
  1120. padding-right: 30px;
  1121. }
  1122. &/deep/.auditFlow-main {
  1123. position: absolute;
  1124. }
  1125. }
  1126. }
  1127. .bg-left {
  1128. padding-left: 30px;
  1129. }
  1130. .title {
  1131. position: relative;
  1132. }
  1133. .title::before {
  1134. content: '';
  1135. display: inline-block;
  1136. width: 5px;
  1137. height: 30px;
  1138. background: #5473e8;
  1139. position: absolute;
  1140. left: 0;
  1141. }
  1142. .el-button--primary {
  1143. background-color: #5878e8;
  1144. border-color: #5878e8;
  1145. // margin-left: 85%;
  1146. margin-top: 13px;
  1147. }
  1148. //导航条样式
  1149. .el-col-12 {
  1150. width: 50%;
  1151. height: 60px;
  1152. background: #f6f7fc;
  1153. border-radius: 4px 4px 1px 1px;
  1154. }
  1155. .el-input--small .el-input__inner {
  1156. height: 32px;
  1157. line-height: 32px;
  1158. width: 385px;
  1159. margin-top: 10px;
  1160. }
  1161. .bg-bottom {
  1162. margin-left: 85%;
  1163. }
  1164. .but {
  1165. margin-left: 30%;
  1166. /* margin-top: -32px; */
  1167. overflow: auto;
  1168. /* float: left; */
  1169. /* margin-left: 1px; */
  1170. margin-left: -10px;
  1171. }
  1172. .el-input--small {
  1173. font-size: 13px;
  1174. width: 390px;
  1175. margin-left: 74%;
  1176. }
  1177. /deep/.el-table .el-table__header .cell,
  1178. .el-table .el-table__body .cell {
  1179. text-align: center;
  1180. }
  1181. .el-scrollbar__wrap {
  1182. overflow-y: hidden;
  1183. }
  1184. /deep/.deal {
  1185. margin-left: 0%;
  1186. width: 64%;
  1187. }
  1188. .photo {
  1189. padding: 0% 34%;
  1190. }
  1191. .photo1 {
  1192. padding: 0 10%;
  1193. }
  1194. .photo2 {
  1195. padding: 0 12%;
  1196. }
  1197. /deep/.el-form-item--small .el-form-item__label,
  1198. .el-form-item--small .el-form-item__content {
  1199. text-align: center;
  1200. }
  1201. hr {
  1202. width: 91%;
  1203. }
  1204. /deep/.deaal {
  1205. width: 66%;
  1206. margin-left: 9%;
  1207. }
  1208. .el-date-editor.el-input,
  1209. .el-date-editor.el-input__inner,
  1210. .el-input-number--small {
  1211. width: 123% !important;
  1212. }
  1213. /deep/.el-table td,
  1214. .el-table th.is-leaf {
  1215. border-right: 1px solid #e9ecf7;
  1216. text-align: center;
  1217. height: 40px;
  1218. }
  1219. // .danjia{
  1220. // width: 9px;
  1221. // height: 9px;
  1222. // margin-left: 40px;
  1223. // }
  1224. </style>