stockPurchaseReceiptReportList.vue 42 KB

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