paymentManagement.vue 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699
  1. <!--付款管理-->
  2. <template>
  3. <div>
  4. <div class="mask" v-show="isShowPrintType"></div>
  5. <div class="print-type" v-show="isShowPrintType">
  6. <div class="print-type-content">
  7. <div class="print-type-title">打印凭证</div>
  8. <div class="print-type-checkbox">
  9. <el-checkbox-group v-model="ruleForm.type">
  10. <el-checkbox label="打印身份证" name="type" class="label-width" @change="selectType"></el-checkbox>
  11. <el-checkbox label="打印银行卡" name="type" class="label-width" @change="selectType"></el-checkbox>
  12. <el-checkbox label="打印结算凭证" name="type" class="label-width" @change="selectType($event)"></el-checkbox>
  13. <el-checkbox label="打印检斤单" name="type" class="label-width" @change="selectType($event)"></el-checkbox>
  14. <el-checkbox label="打印回执单" name="type" class="label-width" @change="selectType($event)"></el-checkbox>
  15. <!-- <el-checkbox label="打印发票" name="type" class="label-width" @change="selectType($event)"></el-checkbox> -->
  16. </el-checkbox-group>
  17. </div>
  18. </div>
  19. <div class="bottom-btn">
  20. <el-button @click="typePrintClick(printType)">确定</el-button>
  21. <el-button @click="typePrintCannelClick">取消</el-button>
  22. </div>
  23. </div>
  24. <BaseHeaderLayout :leftSpan="10">
  25. <template slot="left">
  26. <!-- <ws-button type="primary" @click="screen(2)">待结算</ws-button>
  27. <ws-button type="primary" @click="screen(0)">待审核</ws-button>
  28. <ws-button type="primary" @click="screen()">全部</ws-button>-->
  29. <ws-button :type="searchType == '' ? 'primary' : ''" @click="screen(-1)">全部</ws-button>
  30. <ws-button :type="searchType == 1 ? 'primary' : ''" @click="screen(1)">待审核</ws-button>
  31. <div v-hasPermission="`acquisitionManagement.acquisitionPay.pay`">
  32. <ws-button :type="searchType == 7 ? 'primary' : ''" @click="screen(7)">待付款</ws-button>
  33. </div>
  34. <ws-button :type="searchType == 2 ? 'primary' : ''" @click="screen(2)"
  35. v-hasPermission="`acquisitionManagement.acquisitionPay.add`">待结算</ws-button>
  36. <ws-button :type="invoicing === 0 ? 'primary' : ''" @click="screen(0)">未开票</ws-button>
  37. </template>
  38. <template slot="right">
  39. <el-select class="warehouse_select" v-model="warehouseNameKey" placeholder="请选择仓库" @change="warehouseChange"
  40. filterable clearable style="margin: 0 10px">
  41. <el-option v-for="item in warehouseList" :key="item.id" :label="item.warehouseName" :value="item.id">
  42. </el-option>
  43. </el-select>
  44. <el-date-picker style="margin: 0 10px 0 0" value-format="yyyy-MM-dd" v-model="value2" @change="datechange"
  45. type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="结算时间起"
  46. end-placeholder="结算时间止">
  47. </el-date-picker>
  48. <div></div>
  49. <ws-input class='findinput' @keyup.enter.native="find()" v-model="searchKeyWord" placeholder="可按编号、客户名、车牌号查找"
  50. clearable maxlength="500" type="input">
  51. </ws-input>
  52. <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
  53. <ws-button class="find" type="primary" @click="find()">
  54. <img width="16" height="16" style="vertical-align: text-top; position: relative; top: 0px;left:-8px;"
  55. src="../../../public/img/sousuo.png" alt />
  56. </ws-button>
  57. </template>
  58. </BaseHeaderLayout>
  59. <BaseHeaderLayout :leftSpan="10">
  60. <template slot="left">
  61. <!-- <ws-button type="primary" @click="screen(2)">待结算</ws-button>
  62. <ws-button type="primary" @click="screen(0)">待审核</ws-button>
  63. <ws-button type="primary" @click="screen()">全部</ws-button>-->
  64. <ws-button type="primary" @click="reject">驳回</ws-button>
  65. <ws-button type="primary" @click="adopt">通过</ws-button>
  66. <ws-button type="primary" @click="invoicingClick"
  67. v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">开票</ws-button>
  68. <ws-button type="primary" @click="exportlist" v-hasPermission="`acquisitionManagement.acquisitionPay.print`">导出
  69. </ws-button>
  70. <!-- <ws-button type="primary" @click="handlepass" v-if="isShowAdopt">审核</ws-button> -->
  71. <ws-button type="primary" @click="payment" v-hasPermission="`acquisitionManagement.acquisitionPay.pay`">付款
  72. </ws-button>
  73. <!-- v-hasPermission="`acquisitionManagement.acquisitionPay.finace`" -->
  74. <ws-button type="primary" @click="selectPrint(1)"
  75. v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">财务批量打印
  76. </ws-button>
  77. <ws-button type="primary" @click="agreementPrint()"
  78. v-hasPermission="`acquisitionManagement.acquisitionPay.dow`">下载结算单
  79. </ws-button>
  80. </template>
  81. <template slot="right"> </template>
  82. </BaseHeaderLayout>
  83. <el-table :data="paymentList" ref="table" style="width: 100%; margin-top: 20px" border height="calc(100% - 170px)"
  84. @row-click="handleRowClick" @selection-change="handleSelectionChange" :summary-method="getSummaries" show-summary>
  85. <el-table-column :selectable="selectInit" type="selection" width="30"></el-table-column>
  86. <el-table-column type="index" label="序号" width="50">
  87. <template scope="scope">
  88. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  89. <span v-else>{{ scope.$index + 1 }}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column class="table_td" prop="paymentNo" width="90" label="编号" sortable></el-table-column>
  93. <el-table-column class="table_td" prop="customerName" label="客户" sortable>
  94. <template slot-scope="scope">
  95. <div @click.stop="customer(scope.row)">
  96. <span class="text_css">{{ scope.row.customerName }}</span>
  97. </div>
  98. </template>
  99. </el-table-column>
  100. <el-table-column class="table_td" prop="carNo" label="车牌号"></el-table-column>
  101. <el-table-column class="table_td" v-if='warehouseName=="鲅鱼圈金信库"' width='140' prop="actualWeighingFee"
  102. label="卸车过磅费(元)"></el-table-column>
  103. <el-table-column class="table_td" prop="goodsName" width="70" label="货名"></el-table-column>
  104. <el-table-column class="table_td" prop="type" width="60" label="类型"></el-table-column>
  105. <el-table-column class="table_td" prop="tidalGrainPrice" width="140" label="净重单价(元/公斤)"></el-table-column>
  106. <el-table-column class="table_td" prop="unitDeduction" width="130" label="扣单价(元/公斤)"></el-table-column>
  107. <el-table-column class="table_td" prop="solidGrainPrice" width="140" label="纯重单价(元/公斤)"></el-table-column>
  108. <el-table-column class="table_td" prop="netWeight" width="100" label="净重(公斤)"></el-table-column>
  109. <el-table-column class="table_td" prop="pureWeight" width="100" label="纯重(公斤)"></el-table-column>
  110. <el-table-column class="table_td" prop="bulkDensity" width="60" label="容重"></el-table-column>
  111. <el-table-column class="table_td" prop="waterContent" width="60" label="水分"></el-table-column>
  112. <el-table-column class="table_td" prop="mildewGrain" width="50" label="霉变"></el-table-column>
  113. <el-table-column class="table_td" prop="amountIngPayable" width="80" label="应付款(元)"></el-table-column>
  114. <el-table-column class="table_td" prop="amountEdPayable" width="80" label="已付款(元)">
  115. <template slot-scope="scope">
  116. <div @click="showPayImg(scope.row)">
  117. {{ scope.row.amountEdPayable }}
  118. </div>
  119. </template>
  120. </el-table-column>
  121. <el-table-column class="table_td" prop="updateDate" label="更新时间" width="150" sortable></el-table-column>
  122. <el-table-column class="table_td" prop="status" width="80" label="状态">
  123. <template scope="scope">
  124. <span v-if="scope.row.approveStatus&&scope.row.reverseFlag!=1">{{
  125. scope.row.approveStatus
  126. }}</span>
  127. <span v-else>{{ scope.row.status }}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column class="table_td" prop="status" width="80" label="是否开票">
  131. <template scope="scope">
  132. <span v-if="scope.row.invoicing == '0'">未开票</span>
  133. <span v-else>已开票</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column class="table_td" prop="collectionEdPayable" label="操作" width="600">
  137. <template scope="scope">
  138. <span v-hasPermission="`acquisitionManagement.acquisitionPay.add`">
  139. <el-button v-if="
  140. (!scope.row.approveStatus ||scope.row.approveStatus == '待结算') &&
  141. (scope.row.status == '待结算' || scope.row.status == '已驳回' )||scope.row.approveStatus&&scope.row.reverseFlag==1
  142. " @click="settlement(1, scope.row)">结算</el-button>
  143. </span>
  144. <el-button @click="settlement(2, scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.view`">查看
  145. </el-button>
  146. <el-button v-if="scope.row.approveStatus&&scope.row.reverseFlag!=1" @click="settleaccounts(scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.seet`">反结算
  147. </el-button>
  148. <el-button v-if="
  149. scope.row.approveStatus ||
  150. (scope.row.status != '待结算' && !scope.row.approveStatus)
  151. " @click="print(scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.print`">打印</el-button>
  152. <el-button v-if="
  153. scope.row.approveStatus ||
  154. (scope.row.status != '待结算' && !scope.row.approveStatus)
  155. " @click="print1(scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">财务打印
  156. </el-button>
  157. <el-button @click="previewPayOrder(scope.row)" class="my-pre"
  158. v-hasPermission="`acquisitionManagement.acquisitionPay.pay`">预览付款单
  159. </el-button>
  160. <el-button type="danger" v-if="
  161. (!scope.row.approveStatus ||
  162. scope.row.approveStatus == '待结算') &&
  163. scope.row.status == '待结算'
  164. " @click="del(scope.row)" v-hasPermission="`acquisitionManagement.acquisitionPay.delete`">删除</el-button>
  165. </template>
  166. </el-table-column>
  167. </el-table>
  168. <!-- 付款弹窗 -->
  169. <el-dialog width="40%" :visible.sync="paymentForm" :append-to-body="true" title="付款">
  170. <div class="tanchuang">
  171. <ws-form>
  172. <ws-info-table>
  173. <ws-form-item label="未付金额(元)" prop="amountNotPayable">
  174. {{ payments.amountNotPayable }}
  175. </ws-form-item>
  176. <ws-form-item label="本次付款金额(元)" prop="money">
  177. <ws-input type="number" @mousewheel.native.prevent v-model="payments.money" placeholder="请输入本次付款金额(元)"
  178. maxlength="100" size="small" />
  179. </ws-form-item>
  180. <ws-form-item label="付款日期" prop=" paymentDate">
  181. <el-date-picker v-model="payments.paymentDate" type="date" placeholder="选择日期"></el-date-picker>
  182. </ws-form-item>
  183. <ws-form-item label="上传截图" prop=" paymentScreenshot"></ws-form-item>
  184. <div class="upLoad">
  185. <el-upload class="avatar-uploader" action="https://www.zthymaoyi.com/upload/admin" :show-file-list="false"
  186. :on-success="handleAvatarSuccess">
  187. <img v-if="imageUrl" :src="imageUrl" class="avatar" />
  188. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  189. </el-upload>
  190. </div>
  191. </ws-info-table>
  192. <div style="text-align: center; margin-top: 20px">
  193. <el-button @click="paymentForm = false">取消</el-button>
  194. <el-button @click="paymentSubmit">提交</el-button>
  195. </div>
  196. </ws-form>
  197. </div>
  198. </el-dialog>
  199. <!-- 付款截图 -->
  200. <el-dialog width="50%" :visible.sync="showPayImgs" :append-to-body="true" title="付款截图">
  201. <!-- <div v-for="(item, index) in payImg" :key="index" class="pay_img">
  202. <img :src="item" alt class="img" />
  203. </div> -->
  204. <el-upload action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
  205. :on-success="handleAvatarSuccess1" :file-list='payImg' :limit='1'>
  206. <i slot="default" class="el-icon-plus"></i>
  207. <div slot="file" slot-scope="{file}">
  208. <img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
  209. <span class="el-upload-list__item-actions">
  210. <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
  211. <i class="el-icon-zoom-in"></i>
  212. </span>
  213. <span v-if="!disabled" class="el-upload-list__item-delete" @click="_handleRemove(file)">
  214. <i class="el-icon-delete"></i>
  215. </span>
  216. </span>
  217. </div>
  218. </el-upload>
  219. <!-- <el-upload class="avatar-uploader" action="https://www.zthymaoyi.com/upload/admin" :show-file-list="false"
  220. :on-success="handleAvatarSuccess1" :on-remove="_handleRemove">
  221. <img @mouseout='imgshow' @mouseover="deleteshow=true" v-if="payImg" :src="payImg" class="avatar" />
  222. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  223. </el-upload> -->
  224. <div style="text-align: center; margin: 10px auto">
  225. <el-button @click="showPayImgs = false" type="primary">关闭</el-button>
  226. </div>
  227. </el-dialog>
  228. <div style="text-align: center">
  229. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  230. :page-sizes="[10, 30, 50, 100, 500, 1000, 9999]" layout="total, sizes, prev, pager, next, jumper"
  231. :total="deptBudgetTotal"></el-pagination>
  232. <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint"
  233. :title="printData.compName + '结算凭证'">
  234. <!-- selectCustomerList:[],
  235. selectPrintList: [], -->
  236. <paymentPrint :printData="printData" :customerInfo="customerList" :showType="ruleForm.type"></paymentPrint>
  237. <div style="text-align: center">
  238. <el-button type="primary" @click="isShowPrint = false">关闭</el-button>
  239. <!-- <el-button type="primary" @click="printSmall">打印小票</el-button> -->
  240. <el-button type="primary" @click="printBig">打印单据</el-button>
  241. </div>
  242. </el-dialog>
  243. </div>
  244. <el-dialog :visible.sync="dialogVisible">
  245. <img width="100%" :src="dialogImageUrl" alt="">
  246. </el-dialog>
  247. <!--客户信息-->
  248. <el-dialog width="50%" title="客户信息" :visible.sync="customerInfo" :append-to-body="true" :close="customerclose">
  249. <el-form class="customer">
  250. <div class="flex">
  251. <div style="flex: 1; text-align: center">
  252. <h4>身份证正面</h4>
  253. <img width="100%" :src="customerlist.cardAddressUrl1" alt class="img_css" />
  254. </div>
  255. <div style="flex: 1; text-align: center">
  256. <h4>身份证反面</h4>
  257. <img width="100%" :src="customerlist.cardAddressUrl2" alt class="img_css" />
  258. </div>
  259. </div>
  260. <el-form-item label="姓名">
  261. {{ customerlist.customerName }}
  262. </el-form-item>
  263. <el-form-item label="身份证号">
  264. {{ customerlist.customerNumberCard }}
  265. </el-form-item>
  266. <div class="flex">
  267. <div style="flex: 1; text-align: center">
  268. <h4>银行卡正面</h4>
  269. <img width="100%" :src="customerlist.payeeAddressUrls[0]" alt class="img_css" />
  270. </div>
  271. <div style="flex: 1; text-align: center">
  272. <h4>银行卡反面</h4>
  273. <img width="100%" :src="customerlist.payeeAddressUrls[1]" alt class="img_css" />
  274. </div>
  275. </div>
  276. <el-form-item label="银行卡号" label-width="100px">
  277. {{ customerlist.bankCard }}
  278. </el-form-item>
  279. <el-form-item label="开户行" label-width="100px">
  280. {{ customerlist.bankDeposit }}
  281. </el-form-item>
  282. <el-form-item label="开户支行" label-width="100px">
  283. {{ customerlist.bankDepositBranch }}
  284. </el-form-item>
  285. <el-form-item label="收款人姓名" label-width="100px" v-if="customerlist.customerTypeFlag == '1'">
  286. {{ customerlist.payeeName }}
  287. </el-form-item>
  288. <el-form-item label="收款人身份证号" label-width="120px" v-if="customerlist.customerTypeFlag == '1'">
  289. {{ customerlist.payeeNumberCard }}
  290. </el-form-item>
  291. <el-form-item label="手机号" label-width="100px">
  292. {{ customerlist.customerPhone }}
  293. </el-form-item>
  294. <el-form-item label="联系地址" label-width="100px">
  295. {{ customerlist.compAddress }}
  296. </el-form-item>
  297. </el-form>
  298. <div slot="footer" class="dialog-footer">
  299. <el-button @click="customerclose">取 消</el-button>
  300. </div>
  301. </el-dialog>
  302. <el-dialog width="50%" title="付款回执单" :visible.sync="isPreviewPayOrder" :close="paymentReceiptClose">
  303. <div class="no-messege" v-if="!paymentReceipt">暂未上传付款回执单</div>
  304. <el-image class="my-img" ref="myImg" v-if="paymentReceipt" :src="paymentReceipt"
  305. :preview-src-list="[paymentReceipt]">
  306. </el-image>
  307. </el-dialog>
  308. <el-dialog width="30%" title="开票信息" :visible.sync="invoicingshow" :close="invoicingClose">
  309. <el-form :label-position="labelposition" label-width="200px" style='text-align:center;' class="customer">
  310. <el-form-item label="税控盘:">
  311. <el-select v-model="invoiceFlag" placeholder="请选择税控盘"
  312. filterable clearable style="margin: 0 10px">
  313. <el-option v-for="item in invoicingList" :key="'invoicing'+item.value" :label="item.label" :value="item.value">
  314. </el-option>
  315. </el-select>
  316. </el-form-item>
  317. </el-form>
  318. <span slot="footer" class="dialog-footer">
  319. <el-button @click="invoicingshow = false">取 消</el-button>
  320. <el-button type="primary" @click="invoicingconfirm">确 定</el-button>
  321. </span>
  322. </el-dialog>
  323. </div>
  324. </template>
  325. <script>
  326. import {
  327. dayjs,
  328. EventBus
  329. } from 'base-core-lib'
  330. import {
  331. downloadFile
  332. } from '@/utils/batchDown'
  333. import JSZip from 'jszip'
  334. import FileSaver from 'file-saver'
  335. import {
  336. getpayment,
  337. selectWarehouseSelf,
  338. delpayment,
  339. auditpayment,
  340. getpaymentexamine,
  341. getCustomerLook,
  342. paymentCommit,
  343. getJurisdiction,
  344. invoicing,
  345. export1,
  346. settlementEdit,
  347. workflowcontent,
  348. suspendinstance
  349. } from '@/model/houseSelfCollect/index'
  350. import {
  351. posthandle,
  352. postqueryhandle
  353. } from '@/model/purchasingManagement/index'
  354. import paymentPrint from './component/paymentPrint.vue'
  355. import {
  356. getHp
  357. } from '@/utils/getHasPermission'
  358. import download from '../../components/WsDownload/download'
  359. export default {
  360. components: {
  361. paymentPrint,
  362. },
  363. watch: {},
  364. data() {
  365. return {
  366. paymentReceipt: '',
  367. isPreviewPayOrder: false,
  368. printType: 0,
  369. invoiceFlag:'',
  370. isShowPrintType1: true,
  371. isShowPrintType2: true,
  372. isShowPrintType3: true,
  373. isShowPrintType4: true,
  374. customerInfo: false,
  375. form: {},
  376. labelposition:'right',
  377. invoicingList:[{label:'航天信息',value:1},{label:'百旺',value:2}],
  378. formLabelWidth: '300px',
  379. invoicing: '',
  380. deleteshow: false,
  381. customerlist: {
  382. payeeAddressUrls: [],
  383. },
  384. ruleForm: {
  385. type: [
  386. '打印身份证',
  387. '打印银行卡',
  388. '打印结算凭证',
  389. '打印检斤单',
  390. '打印回执单'
  391. // '打印发票'
  392. ],
  393. },
  394. row: {},
  395. isShowPrintType: false,
  396. customerList: {
  397. customerName: '',
  398. customerNumberCard: '',
  399. bankCard: '',
  400. bankDeposit: '',
  401. },
  402. selectCustomerList: [],
  403. selectPrintList: [],
  404. identity: [],
  405. //分页
  406. currentPage: 1,
  407. pageSize: 10,
  408. paymentList: [],
  409. deptCircularPage: {},
  410. deptBudgetTotal: 0,
  411. paymentForm: false,
  412. searchType: '',
  413. searchTypeText: '',
  414. searchKeyWord: '',
  415. warehouseList: [],
  416. warehouseNameKey: '',
  417. warehouseName: '',
  418. isShowPrint: false,
  419. invoicingshow:false,
  420. printData: {},
  421. warehouse: [],
  422. disabled: false,
  423. dialogImageUrl: '',
  424. dialogVisible: false,
  425. value1: '', //付款日期
  426. modification: [],
  427. userJurisdiction: true,
  428. payments: {
  429. amountNotPayable: 0,
  430. paymentDate: '',
  431. },
  432. showPayImgs: false,
  433. isShowAdopt: false,
  434. //上传截图路径
  435. imageUrl: '',
  436. payImg: [],
  437. rowData: {},
  438. value2: [],
  439. date: {
  440. year: dayjs().format('YYYY'),
  441. month: dayjs().format('MM'),
  442. },
  443. }
  444. },
  445. activated() {
  446. this.userJurisdiction = getHp('acquisitionManagement.acquisitionPay.print')
  447. this.getPassYearFormatDate()
  448. this.getWarehouse()
  449. // this.getList()
  450. },
  451. updated() {
  452. this.$nextTick(() => {
  453. this.$refs['table'].doLayout()
  454. })
  455. },
  456. methods: {
  457. invoicingClose(){
  458. this.invoicingshow=false
  459. },
  460. settleaccounts(row){
  461. this.$confirm('确定将该笔业务进行反结算操作?', '提示', {
  462. confirmButtonText: '确定',
  463. cancelButtonText: '取消',
  464. type: 'warning'
  465. }).then(() => {
  466. suspendinstance({workflowId:row.workflowId,id:row.id}).toPromise()
  467. .then((response) => {
  468. this.$message({
  469. type: 'success',
  470. message: '反结算成功!'
  471. });
  472. this.getList()
  473. })
  474. }).catch(() => {
  475. return false
  476. });
  477. },
  478. imgshow() {
  479. this.deleteshow = false
  480. console.log(11111)
  481. },
  482. handlePictureCardPreview(file) {
  483. this.dialogImageUrl = file.url;
  484. this.dialogVisible = true;
  485. },
  486. previewPayOrder(val) {
  487. this.paymentReceipt = val.paymentScreenshot
  488. this.isPreviewPayOrder = true
  489. console.log(val.paymentScreenshot)
  490. },
  491. paymentReceiptClose() {},
  492. datechange() {
  493. this.getList()
  494. },
  495. getPassYearFormatDate() {
  496. var nowDate = new Date()
  497. nowDate.setTime(nowDate.getTime() - 24 * 60 * 60 * 1000 * 30)
  498. var seperator1 = '-'
  499. var year = nowDate.getFullYear()
  500. var month = nowDate.getMonth() + 1
  501. var strDate = nowDate.getDate()
  502. if (month >= 1 && month <= 9) {
  503. month = '0' + month
  504. }
  505. if (strDate >= 0 && strDate <= 9) {
  506. strDate = '0' + strDate
  507. }
  508. var formatDate = year + seperator1 + month + seperator1 + strDate
  509. this.getNowFormatDate(formatDate)
  510. },
  511. /* 获取现在时间,并接受过去时间的值 */
  512. getNowFormatDate(formatDate) {
  513. var date = new Date()
  514. date.setTime(date.getTime() + 24 * 60 * 60 * 1000)
  515. var seperator1 = '-'
  516. var year = date.getFullYear()
  517. var month = date.getMonth() + 1
  518. var strDate = date.getDate()
  519. if (month >= 1 && month <= 9) {
  520. month = '0' + month
  521. }
  522. if (strDate >= 0 && strDate <= 9) {
  523. strDate = '0' + strDate
  524. }
  525. var nowData = year + seperator1 + month + seperator1 + strDate
  526. this.value2 = [formatDate, nowData] // 默认赋值一年时间
  527. },
  528. selectPrint() {
  529. console.log('批量打印数据', this.modification)
  530. this.printType = 1
  531. this.isShowPrintType = true
  532. },
  533. agreementPrint() {
  534. var arr = []
  535. for (let i = 0; i < this.modification.length; i++) {
  536. if (this.modification[i].pictureAddress) {
  537. arr.push({
  538. fileUrl: this.modification[i].pictureAddress,
  539. renameFileName: '结算单' + i + '.png',
  540. })
  541. }
  542. }
  543. if (arr.length > 0) {
  544. this.filesToRar(arr, '结算单文件')
  545. }
  546. },
  547. async exportlist() {
  548. console.log('导出数据', this.modification)
  549. let _data = {
  550. paymentManagementList: this.modification,
  551. }
  552. const {
  553. data
  554. } = await export1(
  555. _data, {}, {
  556. responseType: 'blob',
  557. }
  558. ).toPromise()
  559. downloadFile({
  560. res: data,
  561. fileName: `${
  562. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  563. }结算凭证`,
  564. type: 'xls',
  565. })
  566. },
  567. /**文件打包
  568. * arrImages:文件list:[{fileUrl:文件url,renameFileName:文件名}]
  569. * filename 压缩包名
  570. * */
  571. filesToRar(arrImages, filename) {
  572. let _this = this
  573. let zip = new JSZip()
  574. let cache = {}
  575. let promises = []
  576. _this.title = '正在加载压缩文件'
  577. for (let item of arrImages) {
  578. const promise = _this.getImgArrayBuffer(item.fileUrl).then((data) => {
  579. // 下载文件, 并存成ArrayBuffer对象(blob)
  580. zip.file(item.renameFileName, data, {
  581. binary: true
  582. }) // 逐个添加文件
  583. cache[item.renameFileName] = data
  584. })
  585. promises.push(promise)
  586. }
  587. Promise.all(promises)
  588. .then(() => {
  589. zip.generateAsync({
  590. type: 'blob'
  591. }).then((content) => {
  592. _this.title = '正在压缩'
  593. // 生成二进制流
  594. FileSaver.saveAs(content, filename) // 利用file-saver保存文件 自定义文件名
  595. _this.title = '压缩完成'
  596. })
  597. })
  598. .catch((res) => {
  599. _this.$message.error('文件压缩失败')
  600. })
  601. },
  602. //获取文件blob
  603. getImgArrayBuffer(url) {
  604. let _this = this
  605. return new Promise((resolve, reject) => {
  606. //通过请求获取文件blob格式
  607. let xmlhttp = new XMLHttpRequest()
  608. xmlhttp.open('GET', url, true)
  609. xmlhttp.responseType = 'blob'
  610. xmlhttp.onload = function() {
  611. if (this.status == 200) {
  612. resolve(this.response)
  613. } else {
  614. reject(this.status)
  615. }
  616. }
  617. xmlhttp.send()
  618. })
  619. },
  620. invoicingconfirm(){
  621. let data = {
  622. paymentManagementList: this.modification,
  623. }
  624. for (let i = 0; i < this.modification.length; i++) {
  625. this.modification[i].invoiceFlag=this.invoiceFlag
  626. if (
  627. this.modification[i].status != '全部付款' &&
  628. this.modification[i].status != '部分付款' &&
  629. this.modification[i].status != '已通过'
  630. ) {
  631. this.$message.error('开票只能选择全部付款或部分付款或已通过!')
  632. return
  633. }
  634. }
  635. //开票
  636. invoicing(data)
  637. .toPromise()
  638. .then((response) => {
  639. if (response.length > 0) {
  640. var arr = []
  641. for (let i = 0; i < response.length; i++) {
  642. arr.push({
  643. fileUrl: response[i],
  644. renameFileName: '发票' + i + '.xml',
  645. })
  646. }
  647. this.filesToRar(arr, '开票XML文件')
  648. }
  649. })
  650. .catch(() => {})
  651. },
  652. invoicingClick() {
  653. this.invoicingshow=true
  654. // let data = JSON.stringify({
  655. // paymentManagementList : this.modification
  656. // })
  657. // //开票
  658. // invoicing(data)
  659. // .toPromise()
  660. // .then(response => {
  661. // console.log(response)
  662. // })
  663. },
  664. customer(row) {
  665. getCustomerLook({
  666. id: row.identityId,
  667. authenticationStatusKey: 7,
  668. })
  669. .toPromise()
  670. .then((response) => {
  671. this.customerInfo = true
  672. this.customerlist = response
  673. this.customerlist.cardAddressUrl1 =
  674. this.customerlist.cardAddressUrl.split(',')[0]
  675. this.customerlist.cardAddressUrl2 =
  676. this.customerlist.cardAddressUrl.split(',')[1]
  677. this.customerlist.payeeAddressUrls =
  678. this.customerlist.payeeAddressUrl.split(',')
  679. })
  680. },
  681. customerclose(e) {
  682. // row.textcss = false
  683. this.customerInfo = false
  684. },
  685. //合计
  686. getSummaries(param) {
  687. console.log(param)
  688. const {
  689. columns,
  690. data
  691. } = param
  692. const sums = []
  693. var _number = []
  694. if (this.warehouseName == '鲅鱼圈金信库') {
  695. _number = [11, 12, 16, 17, 18]
  696. } else {
  697. _number = [10, 11, 15, 16, 17]
  698. }
  699. if (this.modification.length > 0) {
  700. columns.forEach((column, index) => {
  701. console.log(column, index)
  702. if (index === 0) {
  703. sums[index] = '合计'
  704. } else if (index === 10 || index === 11 || index === 15 || index === 16) {
  705. const values = this.modification.map((item) => Number(item[column.property]))
  706. if (!values.every((value) => isNaN(value))) {
  707. sums[index] = values.reduce((prev, curr) => {
  708. const value = Number(curr)
  709. if (!isNaN(value)) {
  710. return prev + curr
  711. } else {
  712. return prev
  713. }
  714. }, 0)
  715. sums[index] = sums[index].toFixed(3)
  716. } else {
  717. // sums[index] = '元'
  718. }
  719. } else {
  720. sums[index] = '--'
  721. }
  722. })
  723. } else {
  724. columns.forEach((column, index) => {
  725. if (index === 0) {
  726. sums[index] = '合计'
  727. } else if (index === _number[0] || index === _number[1] || index === _number[2] || index === _number[
  728. 3] || index === _number[4]) {
  729. const values = data.map((item) => Number(item[column.property]))
  730. if (!values.every((value) => isNaN(value))) {
  731. sums[index] = values.reduce((prev, curr) => {
  732. const value = Number(curr)
  733. if (!isNaN(value)) {
  734. return prev + curr
  735. } else {
  736. return prev
  737. }
  738. }, 0)
  739. sums[index] = sums[index].toFixed(3)
  740. } else {
  741. // sums[index] = '元'
  742. }
  743. } else {
  744. sums[index] = '--'
  745. }
  746. })
  747. }
  748. // sums[6]=sums[6].toFixed(2)
  749. // sums[sums.length-2]=sums[sums.length-2].toFixed(2)
  750. return sums
  751. },
  752. selectType(val) {
  753. for (let i = 0; i < this.ruleForm.type.length; i++) {
  754. switch (this.ruleForm.type[i]) {
  755. case '打印身份证':
  756. this.isShowPrintType1 = !this.isShowPrintType1
  757. break
  758. case '打印银行卡':
  759. this.isShowPrintType2 = !this.isShowPrintType2
  760. break
  761. case '打印结算凭证':
  762. this.isShowPrintType3 = !this.isShowPrintType3
  763. case '打印检斤单':
  764. this.isShowPrintType4 = !this.isShowPrintType4
  765. break
  766. case '打印回执单':
  767. this.isShowPrintType5 = !this.isShowPrintType5
  768. break
  769. }
  770. }
  771. },
  772. typePrintCannelClick() {
  773. this.isShowPrintType = false
  774. },
  775. async typePrintClick(type) {
  776. // type 1批量打印 0单个打印
  777. //  this.isShowPrint = true
  778. this.selectCustomerList = []
  779. this.selectPrintList = []
  780. if (type == 1) {
  781. let index1 = 0
  782. let index2 = 0
  783. for (let i = 0; i < this.modification.length; i++) {
  784. await getCustomerLook({
  785. id: this.modification[i].identityId,
  786. authenticationStatusKey: 7,
  787. })
  788. .toPromise()
  789. .then((response) => {
  790. this.selectCustomerList.push(response)
  791. index2++
  792. if (
  793. index1 == this.modification.length &&
  794. index2 == this.modification.length
  795. ) {
  796. this.printData.compName = ''
  797. // this.isShowPrint = true
  798. this.printBig()
  799. }
  800. getpaymentexamine({
  801. id: this.modification[i].id,
  802. })
  803. .toPromise()
  804. .then((response) => {
  805. if (response.compName == '黑龙江秋收有限公司') {
  806. response.compName = '黑龙江中天昊元贸易有限公司'
  807. }
  808. index1++
  809. let date = new Date()
  810. response.currentTime =
  811. date.getFullYear() +
  812. '年' +
  813. Number(date.getMonth() + 1) +
  814. '月' +
  815. date.getDate() +
  816. '日'
  817. this.selectPrintList.push(response)
  818. if (
  819. index1 == this.modification.length &&
  820. index2 == this.modification.length
  821. ) {
  822. this.printData.compName = ''
  823. // this.isShowPrint = true
  824. this.printBig()
  825. }
  826. })
  827. })
  828. }
  829. } else {
  830. let _url1 = process.env.VUE_APP_BASE_API + '/identityAuthenticationInfo/api/getIdentityAuthenticationInfo'
  831. let _url2 = process.env.VUE_APP_BASE_API + '/paymentManagement/getInfo'
  832. this.$axios.all([
  833. this.$axios.get(_url1, {
  834. params: {
  835. id: this.rowData.identityId,
  836. authenticationStatusKey: 7,
  837. }
  838. }).then(res => res.data),
  839. this.$axios.get(_url2, {
  840. params: {
  841. id: this.rowData.id
  842. }
  843. }).then(res => res.data)
  844. ]).then(
  845. this.$axios.spread((val1, val2) => {
  846. // val 是数组中每个接口返回的值 res.data
  847. console.log('两个接口全部加载完成', val1, val2);
  848. this.printData = val2.data
  849. if (val2.data.compName == '黑龙江秋收有限公司') {
  850. this.printData.compName = '黑龙江中天昊元贸易有限公司'
  851. }
  852. this.isShowPrint = true
  853. // if(this.printData.solidGrainPrice){
  854. // this.printData.solidGrainPrice = (this.printData.tidalGrainPrice * this.printData.netWeight)/this.printData.pureWeight
  855. // }
  856. let date = new Date()
  857. this.printData.currentTime =
  858. date.getFullYear() +
  859. '年' +
  860. Number(date.getMonth() + 1) +
  861. '月' +
  862. date.getDate() +
  863. '日'
  864. })
  865. ).catch(err => {
  866. console.log(err);
  867. })
  868. // getCustomerLook({
  869. // id: this.rowData.identityId,
  870. // authenticationStatusKey: 7,
  871. // })
  872. // .toPromise()
  873. // .then((response) => {
  874. // this.customerList = response
  875. // getpaymentexamine({
  876. // id: this.rowData.id,
  877. // })
  878. // .toPromise()
  879. // .then((response) => {
  880. // this.printData = response
  881. // this.isShowPrint = true
  882. // // if(this.printData.solidGrainPrice){
  883. // // this.printData.solidGrainPrice = (this.printData.tidalGrainPrice * this.printData.netWeight)/this.printData.pureWeight
  884. // // }
  885. // let date = new Date()
  886. // this.printData.currentTime =
  887. // date.getFullYear() +
  888. // '年' +
  889. // Number(date.getMonth() + 1) +
  890. // '月' +
  891. // date.getDate() +
  892. // '日'
  893. // })
  894. // })
  895. }
  896. },
  897. handleRowClick(row) {
  898. // if (row.status != '已驳回') {
  899. // if (
  900. // row.taskId == null &&
  901. // row.status != '已通过' &&
  902. // row.status != '部分付款'
  903. // ) {
  904. // return false
  905. // } else {
  906. // this.$refs.paymentList.toggleRowSelection(row)
  907. // return true
  908. // }
  909. // } else {
  910. // this.$refs.paymentList.toggleRowSelection(row)
  911. // return true
  912. // }
  913. return true
  914. },
  915. handlepass() {
  916. var that = this
  917. if (this.modification.length == 0) {
  918. this.$message.warning('请选择要通过的条目')
  919. } else {
  920. this.$confirm(`审核通过后,任务将发送给财务,是否确定通过?`, {
  921. cancelButtonText: '取消',
  922. confirmButtonText: '确定',
  923. type: 'warning',
  924. }).then(() => {
  925. that.audit(this.modification[0], 0, true, 2)
  926. })
  927. }
  928. },
  929. //查看付款截图
  930. showPayImg(row) {
  931. // if (!row.paymentScreenshot) {
  932. // this.$message({
  933. // message: '暂无付款截图!',
  934. // type: 'warning',
  935. // })
  936. // return
  937. // } else {
  938. this.showPayImgs = true
  939. this.id = row.id
  940. var arr = row.paymentScreenshot.split('$')
  941. console.log(arr)
  942. this.payImg = []
  943. for (let i = 0; i < arr.length; i++) {
  944. if (arr[i] != '') {
  945. this.payImg.push({
  946. url: arr[i]
  947. })
  948. }
  949. }
  950. // }
  951. },
  952. getWarehouse() {
  953. let _wareHouse = localStorage.getItem('houseSelfCollect_house1')
  954. _wareHouse = JSON.parse(_wareHouse)
  955. selectWarehouseSelf({
  956. compId: localStorage.getItem('ws-pf_compId'),
  957. })
  958. .toPromise()
  959. .then((response) => {
  960. this.warehouseList = response
  961. if (this.$route.query.warehouseName) {
  962. //判断是否在任务页面进来
  963. this.warehouseName = this.$route.query.warehouseName
  964. this.warehouseNameKey = this.$route.query.warehouseName
  965. this.getList()
  966. } else {
  967. for (let index = 0; index < this.warehouseList.length; index++) {
  968. if (_wareHouse && _wareHouse.value == this.warehouseList[index].warehouseName) {
  969. this.warehouseName = this.warehouseList[index].warehouseName
  970. this.warehouseNameKey = this.warehouseList[index].warehouseName
  971. break
  972. } else {
  973. this.warehouseNameKey = this.warehouseList[0].id
  974. if (this.warehouseName) {
  975. this.warehouseNameKey = this.WAREHOUSE[3].payname
  976. } else {
  977. this.WAREHOUSE[3].payname = this.warehouseList[0].id
  978. this.warehouseName = this.warehouseList[0].warehouseName
  979. }
  980. }
  981. }
  982. }
  983. this.getList()
  984. })
  985. },
  986. //上传付款截图
  987. handleAvatarSuccess(e) {
  988. this.imageUrl = e.url
  989. },
  990. handleAvatarSuccess1(file) {
  991. if (this.payImg[0]) {
  992. this.$set(this.payImg[0], 'url', file.url)
  993. } else {
  994. this.payImg[0] = {
  995. url: file.url
  996. }
  997. }
  998. settlementEdit({
  999. id: this.id,
  1000. paymentScreenshot: this.payImg[0].url
  1001. }).toPromise()
  1002. .then((response) => {
  1003. this.showPayImgs = false
  1004. this.$message.success('修改成功')
  1005. this.getList()
  1006. })
  1007. },
  1008. _handleRemove() {
  1009. this.payImg[0].url = ''
  1010. settlementEdit({
  1011. id: this.id,
  1012. paymentScreenshot: this.payImg[0].url
  1013. }).toPromise()
  1014. .then((response) => {
  1015. this.showPayImgs = false
  1016. this.$message.success('修改成功')
  1017. this.getList()
  1018. })
  1019. },
  1020. printSmall() {
  1021. window.open(
  1022. '../../../../../static/payprint.html?type=1&dataList=' +
  1023. JSON.stringify(this.printData)
  1024. )
  1025. },
  1026. printBig() {
  1027. let _list1 = []
  1028. let _list2 = []
  1029. if (this.printType == 1) {
  1030. localStorage.setItem('cwprint', true)
  1031. // 财务批量打印数据
  1032. localStorage.setItem(
  1033. 'selectPrint_selectPrintList',
  1034. JSON.stringify(this.selectPrintList)
  1035. )
  1036. localStorage.setItem(
  1037. 'selectPrint_selectCustomerList',
  1038. JSON.stringify(this.selectCustomerList)
  1039. )
  1040. } else if (this.printType == 0) {
  1041. localStorage.setItem('cwprint', true)
  1042. _list1 = JSON.stringify(this.printData)
  1043. _list2 = JSON.stringify(this.customerList)
  1044. } else {
  1045. _list1 = JSON.stringify(this.printData)
  1046. _list2 = JSON.stringify(this.customerList)
  1047. }
  1048. window.open(
  1049. '../../../../../static/payprint.html?type=2&dataList=' +
  1050. _list1 +
  1051. '&customerList=' +
  1052. _list2 +
  1053. '&printTypeList=' +
  1054. this.ruleForm.type,
  1055. '结算凭证'
  1056. )
  1057. },
  1058. getList() {
  1059. this.payments = {
  1060. amountNotPayable: 0,
  1061. paymentDate: '',
  1062. }
  1063. var searchParam = ''
  1064. if (this.searchType != -1) {
  1065. searchParam = this.searchType
  1066. }
  1067. var startDate = ''
  1068. var endDate = ''
  1069. if (this.value2) {
  1070. startDate = this.value2[0] ? this.value2[0] : ''
  1071. endDate = this.value2[1] ? this.value2[1] : ''
  1072. }
  1073. getpayment({
  1074. currentPage: this.currentPage,
  1075. pageSize: this.pageSize,
  1076. startDate: startDate,
  1077. endDate: endDate,
  1078. searchKeyWord: this.searchKeyWord,
  1079. searchType: searchParam,
  1080. warehouseName: this.warehouseName,
  1081. managementType: 1,
  1082. invoicing: this.invoicing,
  1083. compId: localStorage.getItem('ws-pf_compId'),
  1084. })
  1085. .toPromise()
  1086. .then((response) => {
  1087. this.paymentList = response.records
  1088. this.deptBudgetTotal = response.total
  1089. })
  1090. // getJurisdiction({
  1091. // managementType: 1,
  1092. // warehouseName: this.warehouseName,
  1093. // compId: localStorage.getItem('ws-pf_compId')
  1094. // })
  1095. // .toPromise()
  1096. // .then(response => {
  1097. // this.isShowAdopt = response
  1098. // })
  1099. },
  1100. del(row) {
  1101. this.$confirm(
  1102. '对应的质检和检斤记录将一并删除,是否确定删除操作?',
  1103. '提示', {
  1104. confirmButtonText: '确定',
  1105. cancelButtonText: '取消',
  1106. type: 'warning',
  1107. }
  1108. )
  1109. .then(() => {
  1110. delpayment({
  1111. id: row.id,
  1112. })
  1113. .toPromise()
  1114. .then((response) => {
  1115. this.$message.success('删除成功')
  1116. this.getList()
  1117. })
  1118. })
  1119. .catch(() => {
  1120. return false
  1121. })
  1122. },
  1123. screen(num) {
  1124. if (num == 0) {
  1125. this.searchType = -1
  1126. this.invoicing = num
  1127. } else {
  1128. this.invoicing = ''
  1129. this.searchType = num
  1130. }
  1131. this.currentPage = 1
  1132. this.getList()
  1133. },
  1134. find() {
  1135. this.getList()
  1136. },
  1137. settlement(index, row) {
  1138. if (row.goodsName) {
  1139. localStorage.setItem('paymentManagementReturn', false)
  1140. this.$router.push({
  1141. path: 'settlement',
  1142. query: {
  1143. type: index,
  1144. id: row.id,
  1145. },
  1146. })
  1147. }
  1148. },
  1149. payment() {
  1150. this.imageUrl = ''
  1151. if (this.modification.length == 0) {
  1152. this.$message.warning('请选择要付款的条目')
  1153. } else {
  1154. for (let i = 0; i < this.modification.length; i++) {
  1155. if (this.modification[i].status != '已驳回') {
  1156. if (
  1157. this.modification[i].approveStatus == '待决策人审核' || this.modification[i].approveStatus == '待财务审核' ||
  1158. this.modification[i].status == '全部付款'
  1159. ) {
  1160. this.$message.error(
  1161. '请选择状态为已通过且待结算或者部分付款的条目'
  1162. )
  1163. return false
  1164. } else {}
  1165. } else {
  1166. this.$message.error('状态为已驳回的条目不能付款')
  1167. return false
  1168. }
  1169. }
  1170. let sum = 0
  1171. let count = 0
  1172. for (let i = 0; i < this.modification.length; i++) {
  1173. sum += this.modification[i].amountIngPayable
  1174. count += this.modification[i].amountEdPayable
  1175. }
  1176. this.payments.amountNotPayable = (sum - count).toFixed(2)
  1177. this.paymentForm = true
  1178. }
  1179. },
  1180. paymentSubmit() {
  1181. if (!this.payments.money) {
  1182. this.$message({
  1183. message: '付款金额不能为空',
  1184. type: 'warning',
  1185. })
  1186. return
  1187. }
  1188. if (
  1189. Number(this.payments.money) > Number(this.payments.amountNotPayable)
  1190. ) {
  1191. this.$message({
  1192. message: '付款金额不能超过未付金额',
  1193. type: 'warning',
  1194. })
  1195. return
  1196. }
  1197. if (!this.payments.paymentDate) {
  1198. this.$message({
  1199. message: '付款日期不能为空',
  1200. type: 'warning',
  1201. })
  1202. return
  1203. }
  1204. if (!this.imageUrl) {
  1205. this.$message({
  1206. message: '请上传付款截图 ',
  1207. type: 'warning',
  1208. })
  1209. return
  1210. }
  1211. this.payments.paymentScreenshot = this.imageUrl
  1212. this.payments.cashier = localStorage.getItem('ws-pf_staffName')
  1213. this.payments.paymentManagementList = this.modification
  1214. this.$confirm('确定提交付款信息?', '提示', {
  1215. confirmButtonText: '确定',
  1216. cancelButtonText: '取消',
  1217. type: 'warning',
  1218. })
  1219. .then(() => {
  1220. //付款提交
  1221. paymentCommit(this.payments)
  1222. .toPromise()
  1223. .then((response) => {
  1224. this.$notify.success({
  1225. title: '成功',
  1226. message: '付款成功',
  1227. })
  1228. this.paymentForm = false
  1229. this.getList()
  1230. })
  1231. })
  1232. .catch(() => {
  1233. return false
  1234. })
  1235. },
  1236. reject() {
  1237. if (this.modification.length == 0) {
  1238. this.$message.warning('请选择要驳回的条目')
  1239. } else {
  1240. this.$confirm('是否确定驳回?', '提示', {
  1241. confirmButtonText: '确定',
  1242. cancelButtonText: '取消',
  1243. type: 'warning',
  1244. })
  1245. .then(() => {
  1246. this.audit(this.modification[0], 0, false, '', '')
  1247. })
  1248. .catch(() => {
  1249. return false
  1250. })
  1251. }
  1252. },
  1253. audit(item, index, status, status2, reason) {
  1254. if (index < this.modification.length) {
  1255. if (status == true && item.status == '已驳回') {
  1256. auditpayment({
  1257. compId: localStorage.getItem('ws-pf_compId'),
  1258. id: item.id,
  1259. })
  1260. .toPromise()
  1261. .then((response) => {
  1262. if (index == 0) {
  1263. workflowcontent({
  1264. workflowId: item.workflowId,
  1265. businessKey: item.id,
  1266. type: '付款管理'
  1267. }).toPromise()
  1268. .then((response1) => {
  1269. console.log(response1)
  1270. // this.$message.success('审核成功')
  1271. // this.$router.push({ path: 'tranManagementWarehouseInOuttask' })
  1272. })
  1273. }
  1274. this.audit(
  1275. this.modification[index + 1],
  1276. index + 1,
  1277. status,
  1278. status2,
  1279. reason
  1280. )
  1281. })
  1282. } else {
  1283. posthandle({
  1284. taskId: item.taskId,
  1285. approved: status,
  1286. auditMind: reason != undefined ? '已驳回' : '34',
  1287. needReapply: status2 != undefined ? true : false,
  1288. })
  1289. .toPromise()
  1290. .then((response) => {
  1291. if (index == 0) {
  1292. workflowcontent({
  1293. workflowId: item.workflowId,
  1294. businessKey: item.id,
  1295. type: '付款管理'
  1296. }).toPromise()
  1297. .then((response1) => {
  1298. console.log(response1)
  1299. // this.$message.success('审核成功')
  1300. // this.$router.push({ path: 'tranManagementWarehouseInOuttask' })
  1301. })
  1302. }
  1303. // postqueryhandle({workflowId:item.workflowId}).toPromise()
  1304. // .then((response) => {
  1305. this.audit(
  1306. this.modification[index + 1],
  1307. index + 1,
  1308. status,
  1309. status2,
  1310. reason
  1311. )
  1312. // })
  1313. })
  1314. .catch((req) => {
  1315. this.$message.warning(req.message)
  1316. })
  1317. }
  1318. } else {
  1319. if (status == true) {
  1320. this.$message.success('通过成功')
  1321. this.getList()
  1322. } else if (status == false) {
  1323. this.$message.success('驳回成功')
  1324. this.getList()
  1325. }
  1326. }
  1327. },
  1328. adopt() {
  1329. var that = this
  1330. if (this.modification.length == 0) {
  1331. this.$message.warning('请选择要通过的条目')
  1332. } else {
  1333. this.$confirm('是否确定通过?', '提示', {
  1334. confirmButtonText: '确定',
  1335. cancelButtonText: '取消',
  1336. type: 'warning',
  1337. })
  1338. .then(() => {
  1339. this.audit(this.modification[0], 0, true)
  1340. })
  1341. .catch(() => {
  1342. return false
  1343. })
  1344. }
  1345. },
  1346. print1(row) {
  1347. this.printType = 0
  1348. this.isShowPrintType = true
  1349. this.rowData = row
  1350. localStorage.setItem('cwprint', true)
  1351. },
  1352. print(row) {
  1353. this.printType = 2
  1354. localStorage.setItem('cwprint', false)
  1355. getpaymentexamine({
  1356. id: row.id,
  1357. })
  1358. .toPromise()
  1359. .then((response) => {
  1360. this.printData = response
  1361. if (response.compName == '黑龙江秋收有限公司') {
  1362. this.printData.compName = '黑龙江中天昊元贸易有限公司'
  1363. }
  1364. this.isShowPrint = true
  1365. // if(this.printData.solidGrainPrice){
  1366. // this.printData.solidGrainPrice = (this.printData.tidalGrainPrice * this.printData.netWeight)/this.printData.pureWeight
  1367. // }
  1368. let date = new Date()
  1369. this.printData.currentTime =
  1370. date.getFullYear() +
  1371. '年' +
  1372. Number(date.getMonth() + 1) +
  1373. '月' +
  1374. date.getDate() +
  1375. '日'
  1376. })
  1377. },
  1378. examine() {
  1379. if (this.modification.length == 0) {
  1380. this.$message.warning('请选择要审核的条目')
  1381. } else {
  1382. this.$confirm('审核通过后,任务将发送给财务,是否确定通过?', '提示', {
  1383. confirmButtonText: '确定',
  1384. cancelButtonText: '取消',
  1385. type: 'warning',
  1386. })
  1387. .then(() => {})
  1388. .catch(() => {
  1389. return false
  1390. })
  1391. }
  1392. },
  1393. selectInit(row) {
  1394. //在这里一定要记得类型匹配的上。
  1395. // if (row.status != '已驳回') {
  1396. // if (
  1397. // row.taskId == null &&
  1398. // row.status != '已通过' &&
  1399. // row.status != '部分付款'
  1400. // ) {
  1401. // return false
  1402. // } else {
  1403. // return true
  1404. // }
  1405. // } else {
  1406. // return true
  1407. // }
  1408. return true
  1409. },
  1410. handleSelectionChange(val) {
  1411. this.modification = val
  1412. },
  1413. warehouseChange(e) {
  1414. for (let i = 0; i < this.warehouseList.length; i++) {
  1415. if (this.warehouseList[i].id == this.warehouseNameKey) {
  1416. this.warehouseName = this.warehouseList[i].warehouseName
  1417. localStorage.setItem('houseSelfCollect_house1',
  1418. JSON.stringify({
  1419. value: this.warehouseList[i].warehouseName,
  1420. warehouseId: this.warehouseList[i].id,
  1421. allowEdit: this.warehouseList[i].allowEdit,
  1422. monitorUrl1: this.warehouseList[i].monitorUrl1,
  1423. monitorUrl2: this.warehouseList[i].monitorUrl2,
  1424. warehouseNo: this.warehouseList[i].commonWarehouseNo,
  1425. compId: localStorage.getItem('ws-pf_compId')
  1426. })
  1427. )
  1428. this.WAREHOUSE[3].payname = this.warehouseList[i].id
  1429. }
  1430. }
  1431. this.getList()
  1432. },
  1433. handleSizeChange(val) {
  1434. console.log(`每页 ${val} 条`)
  1435. this.pageSize = val
  1436. this.getList()
  1437. },
  1438. handleCurrentChange(val) {
  1439. this.currentPage = val
  1440. console.log(`当前页: ${val}`)
  1441. this.getList()
  1442. },
  1443. },
  1444. }
  1445. </script>
  1446. <style lang="scss" scoped>
  1447. .ws-info-table {
  1448. border: none;
  1449. }
  1450. .ws-info-table .el-form-item {
  1451. width: 50%;
  1452. border: none;
  1453. }
  1454. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1455. width: 30%;
  1456. min-width: 125px;
  1457. text-align: center;
  1458. background: #ffffff;
  1459. color: #8890b1;
  1460. }
  1461. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1462. border: none;
  1463. }
  1464. /deep/.el-dialog__title {
  1465. font-size: 24px !important;
  1466. }
  1467. /deep/.el-dialog__header {
  1468. text-align: center !important;
  1469. padding: 10px 0 !important;
  1470. height: auto !important;
  1471. // border-bottom: none !important;
  1472. border-top-left-radius: 3px;
  1473. border-top-right-radius: 3px;
  1474. }
  1475. .title {
  1476. font-size: 16px;
  1477. font-weight: 600;
  1478. }
  1479. table,
  1480. table tr th,
  1481. table tr td {
  1482. border: 2px solid #333333;
  1483. padding: 5px 0;
  1484. }
  1485. table {
  1486. width: 100%;
  1487. min-height: 25px;
  1488. line-height: 25px;
  1489. text-align: center;
  1490. border-collapse: collapse;
  1491. border: 3px solid #333333;
  1492. }
  1493. .formItem {
  1494. width: 70% !important;
  1495. }
  1496. /deep/.el-table .el-table__header .cell,
  1497. /deep/.el-table .cell {
  1498. text-align: center;
  1499. line-height: 15px;
  1500. }
  1501. /deep/.el-table--enable-row-transition .el-table__body td {
  1502. text-align: center;
  1503. }
  1504. .title {
  1505. padding: 10px;
  1506. text-align: center;
  1507. }
  1508. .tanchuang {
  1509. margin: 0 auto;
  1510. }
  1511. .tanchuang .ws-info-table {
  1512. display: initial;
  1513. }
  1514. .tanchuang .ws-info-table .el-form-item {
  1515. margin: 0 auto;
  1516. text-align: center;
  1517. }
  1518. .upLoad {
  1519. width: 40%;
  1520. margin: 0 auto;
  1521. // border: 1px solid #8890b1;
  1522. // border-radius: 3px;
  1523. }
  1524. // .avatar{
  1525. // width: 150px;
  1526. // height: 150px;
  1527. // }
  1528. .avatar-uploader {
  1529. position: relative;
  1530. width: 178px;
  1531. }
  1532. .avatar-uploader .el-upload {
  1533. border: 1px dashed #d9d9d9;
  1534. border-radius: 6px;
  1535. cursor: pointer;
  1536. position: relative;
  1537. overflow: hidden;
  1538. width: 178px;
  1539. }
  1540. .avatar-uploader .el-upload:hover {
  1541. border-color: #409eff;
  1542. }
  1543. .avatar-uploader-icon {
  1544. font-size: 28px;
  1545. color: #8c939d;
  1546. width: 178px;
  1547. height: 178px;
  1548. line-height: 178px;
  1549. text-align: center;
  1550. border: 1px solid #8890b1;
  1551. border-radius: 5px;
  1552. }
  1553. .avatar {
  1554. width: 178px;
  1555. height: 178px;
  1556. border: 1px solid #8890b1;
  1557. border-radius: 5px;
  1558. display: block;
  1559. }
  1560. .pay_img {
  1561. width: 50%;
  1562. // display: flex;
  1563. display: inline-block;
  1564. .img {
  1565. height: 350px;
  1566. width: 100%;
  1567. }
  1568. }
  1569. .print-type {
  1570. position: absolute;
  1571. top: 0;
  1572. bottom: 0;
  1573. left: 0;
  1574. right: 0;
  1575. margin: auto;
  1576. width: 200px;
  1577. height: 250px;
  1578. background: white;
  1579. border-radius: 10px;
  1580. z-index: 999;
  1581. }
  1582. .label-width {
  1583. width: 100%;
  1584. }
  1585. .mask {
  1586. background: black;
  1587. width: 100vw;
  1588. height: 100vh;
  1589. position: fixed;
  1590. top: 0;
  1591. z-index: 99;
  1592. opacity: 0.3;
  1593. }
  1594. .print-type-title {
  1595. text-align: center;
  1596. font-size: 18px;
  1597. margin: 20px;
  1598. }
  1599. .bottom-btn {
  1600. margin: 20px 0;
  1601. text-align: center;
  1602. }
  1603. .print-type-checkbox {
  1604. padding-left: 20px;
  1605. }
  1606. .img_css {
  1607. width: 90%;
  1608. height: 220px;
  1609. }
  1610. .text_css {
  1611. color: #5878e8;
  1612. }
  1613. /deep/.base_header_layout {
  1614. height: 48px;
  1615. }
  1616. .warehouse_select {
  1617. width: 100%;
  1618. }
  1619. .el-button {
  1620. margin: 5px;
  1621. }
  1622. .no-messege {
  1623. text-align: center;
  1624. font-size: 30px;
  1625. padding: 50px;
  1626. }
  1627. .my-img {
  1628. width: 200px;
  1629. height: 200px;
  1630. }
  1631. .el-icon-delete {
  1632. font-size: 20px;
  1633. }
  1634. /deep/.base_header_layout .find.el-button--primary {
  1635. width: 30px;
  1636. margin: 0;
  1637. border-top-left-radius: 0px;
  1638. border-bottom-left-radius: 0px;
  1639. }
  1640. /deep/.base_header_layout .findinput input {
  1641. border-top-right-radius: 0px;
  1642. border-bottom-right-radius: 0px;
  1643. }
  1644. </style>