salesDeliveryReportList.vue 36 KB

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