purchaseOrderList.vue 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057
  1. //采购订单
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="15">
  5. <template slot="left"> </template>
  6. <template slot="right">
  7. <span style="width: 70px; display: inline-block; color: #8890b1"
  8. >状态:</span
  9. >
  10. <ws-select
  11. v-model="searchTypeText"
  12. placeholder=""
  13. class="typeselect"
  14. @change="selecttaskType"
  15. :value="searchType"
  16. >
  17. <ws-option
  18. v-for="item in taskTypeList"
  19. :key="item.value"
  20. :label="item.value"
  21. :value="item.value"
  22. style="color: #8890b1"
  23. />
  24. </ws-select>
  25. <ws-input
  26. v-model="searchKeyWord"
  27. placeholder="可按合同编号或客户查找"
  28. clearable
  29. maxlength="500"
  30. type="input"
  31. ></ws-input>
  32. <ws-button class="find" type="primary" @click="find()"
  33. ><img
  34. width="16"
  35. height="16"
  36. style="
  37. vertical-align: text-top;
  38. position: relative;
  39. top: 0px;
  40. left: -5px;
  41. "
  42. src="../../../public/img/sousuo.png"
  43. alt=""
  44. /></ws-button>
  45. <!-- </div> -->
  46. </template>
  47. </BaseHeaderLayout>
  48. <el-table
  49. :data="warehouseList.records"
  50. size="small"
  51. element-loading-text="正在查询中。。。"
  52. border
  53. fit
  54. highlight-current-row
  55. height="700"
  56. >
  57. <el-table-column type="index" label="序号" width="50"></el-table-column>
  58. <el-table-column
  59. class="table_td"
  60. prop="contractNo"
  61. label="合同编号"
  62. width="100"
  63. >
  64. <template slot-scope="scope">
  65. <div class="record"
  66. @click="lookContract(scope.row)">{{ scope.row.contractNo}}</div>
  67. </template></el-table-column>
  68. <el-table-column
  69. class="table_td"
  70. prop="procurementPlan"
  71. label="采购计划"
  72. width="125"
  73. >
  74. <template slot-scope="scope">
  75. <div class="record"
  76. @click="lookPlan(scope.row)">{{ scope.row.procurementPlan}}</div>
  77. </template></el-table-column>
  78. <el-table-column class="table_td" prop="customer" label="客户">
  79. <template slot-scope="scope">
  80. <div class="record" @click="customer(scope.row)">
  81. {{ scope.row.customer }}
  82. </div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column
  86. class="table_td"
  87. width="100"
  88. prop="unitPrice"
  89. label="单价(元/吨)"
  90. >
  91. <template slot-scope="scope">
  92. {{ scope.row.unitPrice }}
  93. <i
  94. @click="Changepricerecord(scope.row)"
  95. class="iconfont icon-lishi"
  96. ></i>
  97. </template>
  98. </el-table-column>
  99. <el-table-column
  100. class="table_td"
  101. prop="basis"
  102. label="基差(元/吨)"
  103. width="100"
  104. >
  105. <template slot-scope="scope">
  106. <div class="inputChenge">
  107. <!-- readonly -->
  108. <el-input
  109. v-model="scope.row.basis"
  110. v-if="scope.row.identification == 'true'"
  111. ></el-input>
  112. <div v-if="scope.row.identification == 'false'" class="inputs">
  113. {{ scope.row.basis }}
  114. </div>
  115. </div>
  116. <img
  117. width="17"
  118. height="18"
  119. style="vertical-align: text-top; position: relative; top: -1px"
  120. src="../../../public/img/edit.png"
  121. @click="whether(scope.row)"
  122. v-if="scope.row.identification == 'false'"
  123. alt=""
  124. />
  125. <i
  126. class="el-icon-check"
  127. style="line-height: 29px; margin-left: 10px"
  128. v-if="scope.row.identification == 'true'"
  129. @click="varietyClick(scope.row)"
  130. ></i>
  131. </template>
  132. </el-table-column>
  133. <el-table-column
  134. class="table_td"
  135. prop="freezingDeposit"
  136. label="冻结定金(元)"
  137. width="90"
  138. >
  139. </el-table-column>
  140. <el-table-column
  141. class="table_td"
  142. prop="defaultDeposit"
  143. label="拖欠定金(元)"
  144. width="100"
  145. ></el-table-column>
  146. <el-table-column
  147. width="100"
  148. class="table_td"
  149. prop="unloadingCharge"
  150. label="卸车费(元/吨)"
  151. ></el-table-column>
  152. <el-table-column
  153. width="100"
  154. class="table_td"
  155. prop="invoiceFee"
  156. label="发票费(元/吨)"
  157. ></el-table-column>
  158. <el-table-column
  159. class="table_td"
  160. prop="transactionsNumber"
  161. label="合同重量(吨)"
  162. width="100"
  163. ></el-table-column>
  164. <el-table-column
  165. class="table_td"
  166. prop="stockInQuantity"
  167. label="已入库量(吨)"
  168. width="90"
  169. ></el-table-column>
  170. <el-table-column
  171. class="table_td"
  172. prop="openPosition"
  173. label="可平仓量(吨)"
  174. width="90"
  175. >
  176. <template slot-scope="scope">
  177. {{ scope.row.openPosition }}
  178. </template>
  179. </el-table-column>
  180. <el-table-column
  181. class="table_td"
  182. prop="closedPosition"
  183. label="已平仓量(吨)"
  184. width="90"
  185. >
  186. <template slot-scope="scope">
  187. {{ scope.row.closedPosition }}
  188. <i
  189. @click="closedPositionLook(scope.row)"
  190. class="iconfont icon-lishi"
  191. ></i>
  192. </template>
  193. </el-table-column>
  194. <el-table-column
  195. class="table_td"
  196. prop="cumulativeTurnover"
  197. label="已成交量(吨)"
  198. width="90"
  199. >
  200. <template slot-scope="scope">
  201. {{ scope.row.cumulativeTurnover }}
  202. <i
  203. @click="transactionRecord(scope.row)"
  204. class="iconfont icon-lishi"
  205. ></i>
  206. </template>
  207. </el-table-column>
  208. <el-table-column
  209. class="table_td"
  210. label="发票类型"
  211. prop="type"
  212. ></el-table-column>
  213. <el-table-column prop="packingType" label="包装方式">
  214. <template slot-scope="scope">
  215. <el-popover
  216. placement="top"
  217. :width="160"
  218. trigger="hover"
  219. visible-arrow="false"
  220. >
  221. <template>
  222. <span slot="reference">
  223. {{ scope.row.packingType }}
  224. </span>
  225. </template>
  226. <div>
  227. <span
  228. style="margin-left: 6px"
  229. v-if="scope.row.packingType != '散装'"
  230. >
  231. {{ scope.row.baggingNotes }}</span
  232. >
  233. </div>
  234. </el-popover>
  235. </template>
  236. </el-table-column>
  237. <el-table-column prop="status" label="状态">
  238. <template slot-scope="scope">
  239. <el-popover
  240. placement="left"
  241. :width="285"
  242. trigger="click"
  243. visible-arrow="false"
  244. @show="history(scope.row)"
  245. >
  246. <template>
  247. <span slot="reference">
  248. <span
  249. v-if="scope.row.status == '待审核'"
  250. class="executory"
  251. ></span>
  252. <span
  253. v-if="scope.row.status == '已成交'"
  254. class="inExecution"
  255. ></span>
  256. <span v-if="scope.row.status == '已完成'" class="done"></span>
  257. {{ scope.row.status }}
  258. </span>
  259. </template>
  260. </el-popover>
  261. </template>
  262. </el-table-column>
  263. <el-table-column
  264. class="table_td"
  265. label="更新时间"
  266. prop="updateDate"
  267. width="130"
  268. ></el-table-column>
  269. <el-table-column
  270. class="table_td"
  271. label="入库结算"
  272. prop="updateDate"
  273. width="130"
  274. >
  275. <template slot-scope="scope" >
  276. <div
  277. class="record"
  278. @click="nocomplete1(scope.row)"
  279. v-if="scope.row.procurementPlanType != '现货'&&scope.row.receiptUnpaid != null&&scope.row.receiptUnpaid >0">去结算</div>
  280. <div
  281. class="record"
  282. @click="nocomplete1(scope.row)"
  283. v-else-if="scope.row.procurementPlanType != '现货'&&scope.row.receiptUnpaid != null&&scope.row.receiptUnpaid==0">已结算</div>
  284. </template>
  285. </el-table-column >
  286. <el-table-column
  287. class="table_td"
  288. label="平仓结算"
  289. prop="updateDate"
  290. width="130">
  291. <template slot-scope="scope">
  292. <div
  293. class="record"
  294. @click="nocomplete(scope.row)"
  295. v-if="scope.row.procurementPlanType != '现货'&&scope.row.closedUnpaid != null&&scope.row.closedUnpaid >0">去结算</div>
  296. <div
  297. class="record"
  298. @click="nocomplete(scope.row)"
  299. v-else-if="scope.row.procurementPlanType != '现货'&&scope.row.closedUnpaid != null&&scope.row.closedUnpaid ==0">已结算</div>
  300. </template>
  301. </el-table-column >
  302. <el-table-column prop="seller" label="操作" width="310">
  303. <template slot-scope="scope">
  304. <!-- <div v-if="scope.row.procurementPlanType != '现货'"> -->
  305. <div
  306. v-if="
  307. (scope.row.status == '已通过' || scope.row.status == '已成交') &&
  308. scope.row.procurementPlanType != '现货'
  309. "
  310. class="record"
  311. @click="makeabargain(scope.row)"
  312. v-hasPermission="
  313. `procurement.procurementOrder.deal`
  314. "
  315. >
  316. 成交
  317. </div>
  318. <!-- 补充定金 -->
  319. <div
  320. v-if="
  321. scope.row.defaultDeposit > 0 &&
  322. scope.row.procurementPlanType != '现货'
  323. "
  324. class="record"
  325. @click="addthedeposit(scope.row)"
  326. v-hasPermission="
  327. `procurement.procurementOrder.deposit`
  328. "
  329. >
  330. 补充定金
  331. </div>
  332. <div
  333. v-if="
  334. scope.row.freezingDeposit > 0 &&
  335. scope.row.procurementPlanType != '现货'
  336. "
  337. class="record"
  338. @click="unfreeze(scope.row)"
  339. v-hasPermission="
  340. `procurement.procurementOrder.thaw`
  341. "
  342. >
  343. 解冻定金
  344. </div>
  345. <!-- 平仓 -->
  346. <div
  347. v-if="
  348. scope.row.openPosition > 0 &&
  349. scope.row.procurementPlanType != '现货'
  350. "
  351. class="record"
  352. @click="cloaeposition1(scope.row)"
  353. v-hasPermission="
  354. `procurement.procurementOrder.close`
  355. "
  356. >
  357. 平仓
  358. </div>
  359. <div
  360. v-if="
  361. (scope.row.status == '已通过' || scope.row.status == '已成交') &&
  362. scope.row.procurementPlanType != '现货'
  363. "
  364. class="record"
  365. @click="handle(scope.row)"
  366. v-hasPermission="
  367. `procurement.procurementOrder.complete`
  368. "
  369. >
  370. 完成
  371. </div>
  372. <!-- </div> -->
  373. <!-- 审核 -->
  374. <!-- "(scope.row.status == '已通过' || scope.row.status == '已成交') && scope.row.procurementPlanType != '现货'" -->
  375. <div
  376. v-if="scope.row.status == '待审核'"
  377. type="text"
  378. class="record"
  379. @click="aduit(scope.row)"
  380. v-hasPermission="
  381. `procurement.procurementOrder.view`
  382. "
  383. >
  384. 审核
  385. </div>
  386. <div
  387. v-if="scope.row.status == '待审核'"
  388. class="record"
  389. @click="deletehandle(scope.row)"
  390. v-hasPermission="
  391. `procurement.procurementOrder.delete`
  392. "
  393. >
  394. 删除
  395. </div>
  396. </template>
  397. </el-table-column>
  398. </el-table>
  399. <!-- 页数 -->
  400. <el-pagination
  401. @size-change="handleSizeChange"
  402. @current-change="handleCurrentChange"
  403. :current-page="currentPage"
  404. :page-size="pageSize"
  405. layout="total, sizes, prev, pager, next, jumper"
  406. :total="deptBudgetTotal"
  407. ></el-pagination>
  408. <!--成交-->
  409. <el-dialog
  410. width="25%"
  411. title="成交"
  412. :visible.sync="dialogFormVisible1"
  413. :append-to-body="true"
  414. >
  415. <el-form ref="warehouseList">
  416. <el-form-item
  417. label="成交价(元/吨)"
  418. prop="transactionPrice"
  419. :label-width="formLabelWidth"
  420. >
  421. <el-input
  422. v-model="clinchdeal1.transactionPrice"
  423. autocomplete="off"
  424. placeholder="请输入成交价"
  425. class="deal"
  426. ></el-input>
  427. </el-form-item>
  428. <el-form-item
  429. label="成交量(吨)"
  430. prop="transactionsNumber"
  431. :label-width="formLabelWidth"
  432. >
  433. <el-input
  434. v-model="clinchdeal1.turnover"
  435. autocomplete="off"
  436. placeholder="请输入成交量(吨)"
  437. class="deal"
  438. ></el-input>
  439. </el-form-item>
  440. <el-form-item
  441. label="基差(元/吨)"
  442. prop="basis"
  443. :label-width="formLabelWidth"
  444. >
  445. <el-input
  446. v-model="clinchdeal1.basis"
  447. autocomplete="off"
  448. placeholder="请输入基差"
  449. class="deal"
  450. ></el-input>
  451. </el-form-item>
  452. <el-form-item
  453. label="成交日期"
  454. prop="dealDate"
  455. :label-width="formLabelWidth"
  456. class="deal"
  457. >
  458. <el-date-picker
  459. v-model="clinchdeal1.dealDate"
  460. type="date"
  461. placeholder="请选择成交日期"
  462. value-format="yyyy-MM-dd"
  463. class="chengjiaoriqi"
  464. />
  465. </el-form-item>
  466. </el-form>
  467. <div slot="footer" class="dialog-footer">
  468. <el-button @click="dialogFormVisible1 = false">取 消</el-button>
  469. <el-button type="primary" @click="chengjiao()">确 定</el-button>
  470. </div>
  471. </el-dialog>
  472. <el-dialog
  473. width="20%"
  474. title="补充定金"
  475. :visible.sync="dialogFormVisible3"
  476. :append-to-body="true"
  477. >
  478. <el-form :model="form">
  479. <h5 style="margin-left: 30px">{{ replenishlist.customer }}</h5>
  480. <el-form-item label="拖欠定金" :label-width="formLabelWidth">
  481. {{ replenishlist.defaultDeposit }}元
  482. </el-form-item>
  483. <el-form-item label="可用定金" :label-width="formLabelWidth">
  484. {{ replenishlist.totalDeposit - replenishlist.freezingDeposit }}元
  485. </el-form-item>
  486. <el-form-item label="补充金额" :label-width="formLabelWidth">
  487. <el-input
  488. v-model="replenishlist.money"
  489. autocomplete="off"
  490. placeholder="请输入补充金额"
  491. class="deal"
  492. ></el-input>
  493. </el-form-item>
  494. </el-form>
  495. <div slot="footer" class="dialog-footer">
  496. <el-button @click="dialogFormVisible3 = false">取 消</el-button>
  497. <el-button type="primary" @click="replenish">确 定</el-button>
  498. </div>
  499. </el-dialog>
  500. <!--平仓 -->
  501. <el-dialog
  502. width="40%"
  503. title="平仓"
  504. :visible.sync="dialogFormVisible2"
  505. :append-to-body="true"
  506. >
  507. <el-form class="closeposition">
  508. <el-form-item label="成交价格(元/吨)" prop="transactionPrice">
  509. <ws-select
  510. v-model="closePositionList1.transactionPrice"
  511. placeholder
  512. class="deal"
  513. placeholder="请输入成交价"
  514. @change='transaction'
  515. >
  516. <ws-option
  517. v-for="item in transactionRecordList1"
  518. :key="item.constKey"
  519. :label="item.key"
  520. :value="item.key"
  521. />
  522. </ws-select>
  523. </el-form-item>
  524. <el-form-item label="可平仓数量(吨)" prop="openPosition">
  525. <el-input
  526. v-model="closePositionList1.openPosition"
  527. autocomplete="off"
  528. class="deal"
  529. ></el-input>
  530. </el-form-item>
  531. <el-form-item label="平仓数量(吨)" prop="closingQuantity">
  532. <el-input
  533. v-model="closePositionList1.closingQuantity"
  534. autocomplete="off"
  535. placeholder="请输入平仓数量"
  536. class="deal"
  537. ></el-input>
  538. </el-form-item>
  539. <el-form-item label="平仓价格(元/吨)" prop="closeRate">
  540. <el-input
  541. v-model="closePositionList1.closeRate"
  542. autocomplete="off"
  543. placeholder="请输入平仓价格"
  544. class="deal"
  545. ></el-input>
  546. </el-form-item>
  547. <el-form-item label="平仓基差(元/吨)" prop="closingBasis">
  548. <el-input
  549. @input="closingPositionPayable"
  550. v-model="closePositionList1.closingBasis"
  551. autocomplete="off"
  552. placeholder="请输入平仓基差"
  553. class="deal"
  554. ></el-input>
  555. </el-form-item>
  556. <el-form-item label="平仓应付(元)" prop="closingPositionPayable">
  557. <el-input
  558. readonly="readonly"
  559. v-model="closePositionList1.closingPositionPayable"
  560. autocomplete="off"
  561. placeholder="请输入平仓应付"
  562. class="deal"
  563. ></el-input>
  564. </el-form-item>
  565. <el-form-item label="平仓日期" prop="closePositionDate">
  566. <el-date-picker
  567. v-model="closePositionList1.closePositionDate"
  568. type="date"
  569. placeholder="选择平仓日期"
  570. format="yyyy 年 MM 月 dd 日"
  571. value-format="yyyy-MM-dd"
  572. class="pingcangriqi"
  573. />
  574. </el-form-item>
  575. </el-form>
  576. <div slot="footer" class="dialog-footer">
  577. <el-button @click="dialogFormVisible2 = false">取 消</el-button>
  578. <el-button type="primary" @click="closepositionconfirm()"
  579. >确 定</el-button
  580. >
  581. </div>
  582. </el-dialog>
  583. <!--审核-->
  584. <el-dialog
  585. width="40%"
  586. title="审核"
  587. :visible.sync="dialogFormVisible4"
  588. :append-to-body="true"
  589. >
  590. <el-form>
  591. <el-form-item label="交易类型" :label-width="formLabelWidth">
  592. <span>采购</span>
  593. </el-form-item>
  594. <el-form-item label="交易目标" :label-width="formLabelWidth">
  595. {{ aduitlist.tradingTarget }}
  596. </el-form-item>
  597. <el-form-item label="卖方" :label-width="formLabelWidth">
  598. {{ aduitlist.seller }}
  599. </el-form-item>
  600. <el-form-item label="卖方电话" :label-width="formLabelWidth">
  601. {{ aduitlist.sellerPhone }}
  602. </el-form-item>
  603. <el-form-item label="交易数量(吨)" :label-width="formLabelWidth">
  604. {{ aduitlist.transactionsNumber }}
  605. </el-form-item>
  606. <el-form-item label="提交时间" :label-width="formLabelWidth">
  607. {{ aduitlist.createDate }}
  608. </el-form-item>
  609. <el-form-item label="包装方式" :label-width="formLabelWidth">
  610. <ws-select
  611. v-model="aduitlist.packingType"
  612. placeholder
  613. class="deal"
  614. @change="selectpackingType"
  615. >
  616. <ws-option
  617. v-for="item in packingTypeList"
  618. :key="item.constKey"
  619. :label="item.constValue"
  620. :value="item.constValue"
  621. />
  622. </ws-select>
  623. </el-form-item>
  624. <el-form-item
  625. v-if="aduitlist.packingType != '散装'"
  626. label="袋装备注"
  627. :label-width="formLabelWidth"
  628. >
  629. <el-input
  630. maxlength="30"
  631. v-model="aduitlist.baggingNotes"
  632. autocomplete="off"
  633. placeholder="请输入袋装备注,最多30个字"
  634. class="deal"
  635. ></el-input>
  636. </el-form-item>
  637. <el-form-item label="发票类型" :label-width="formLabelWidth">
  638. <ws-select
  639. v-model="aduitlist.type"
  640. placeholder
  641. class="deal"
  642. @change="selectType"
  643. >
  644. <ws-option
  645. v-for="item in invoiceList"
  646. :key="item.constKey"
  647. :label="item.constValue"
  648. :value="item.constValue"
  649. />
  650. </ws-select>
  651. </el-form-item>
  652. <el-form-item label="单价(元/吨)" :label-width="formLabelWidth">
  653. <el-input
  654. v-model="aduitlist.unitPrice"
  655. autocomplete="off"
  656. placeholder="请输入单价"
  657. class="deal"
  658. ></el-input>
  659. </el-form-item>
  660. <el-form-item label="基差(元/吨)" :label-width="formLabelWidth">
  661. <el-input
  662. v-model="aduitlist.basis"
  663. autocomplete="off"
  664. placeholder="请输入基差"
  665. class="deal"
  666. ></el-input>
  667. </el-form-item>
  668. <el-form-item label="发票费用(元/吨)" :label-width="formLabelWidth">
  669. <el-input
  670. v-model="aduitlist.invoiceFee"
  671. autocomplete="off"
  672. placeholder="请输入发票费用"
  673. class="deal"
  674. ></el-input>
  675. </el-form-item>
  676. <el-form-item label="卸车费用(元/吨)" :label-width="formLabelWidth">
  677. <el-input
  678. v-model="aduitlist.unloadingCharge"
  679. autocomplete="off"
  680. placeholder="请输入卸车费用"
  681. class="deal"
  682. ></el-input>
  683. </el-form-item>
  684. <el-form-item label="合同编号" :label-width="formLabelWidth">
  685. <ws-select
  686. v-model="aduitlist.contractNo"
  687. placeholder="请选择合同编号"
  688. class="deal"
  689. >
  690. <ws-option
  691. v-for="item in contractNolist"
  692. :key="item.constKey"
  693. :label="item.contractNo"
  694. :value="item.contractNo"
  695. />
  696. </ws-select>
  697. </el-form-item>
  698. </el-form>
  699. <div slot="footer" class="dialog-footer">
  700. <el-button @click="dialogFormVisible4 = false">取 消</el-button>
  701. <el-button type="primary" @click="aduitconfirm">通过</el-button>
  702. </div>
  703. </el-dialog>
  704. <!--客户信息-->
  705. <el-dialog
  706. width="30%"
  707. title="客户信息"
  708. :visible.sync="dialogFormVisible8"
  709. :append-to-body="true"
  710. >
  711. <el-form class="customer" :model="form">
  712. <div v-if="customerlist.customerTypeFlag == '2'">
  713. <h4>营业执照</h4>
  714. <img width="50%" :src="customerlist.businessLicenseAddressUrl" alt />
  715. <el-form-item label="公司名称" :label-width="formLabelWidth">
  716. {{ customerlist.compName }}
  717. </el-form-item>
  718. <el-form-item label="纳税人识别号" :label-width="formLabelWidth">
  719. {{ customerlist.payTaxesCard }}
  720. </el-form-item>
  721. </div>
  722. <div class="flex">
  723. <div style="flex: 1; text-align: center">
  724. <h4>身份证正面</h4>
  725. <img width="100%" :src="customerlist.cardAddressUrl1" alt />
  726. </div>
  727. <div style="flex: 1; text-align: center">
  728. <h4>身份证反面</h4>
  729. <img width="100%" :src="customerlist.cardAddressUrl2" alt />
  730. </div>
  731. </div>
  732. <el-form-item label="姓名" :label-width="formLabelWidth">
  733. {{ customerlist.customerName }}
  734. </el-form-item>
  735. <el-form-item label="身份证号" :label-width="formLabelWidth">
  736. {{ customerlist.customerNumberCard }}
  737. </el-form-item>
  738. <div class="flex">
  739. <div style="flex: 1; text-align: center">
  740. <h4>银行卡正面</h4>
  741. <img width="100%" :src="customerlist.payeeAddressUrl1" alt />
  742. </div>
  743. <div style="flex: 1; text-align: center">
  744. <h4>银行卡反面</h4>
  745. <img width="100%" :src="customerlist.payeeAddressUrl2" alt />
  746. </div>
  747. </div>
  748. <el-form-item label="银行卡号" :label-width="formLabelWidth">
  749. {{ customerlist.bankCard }}
  750. </el-form-item>
  751. <el-form-item label="开户行" :label-width="formLabelWidth">
  752. {{ customerlist.bankDeposit }}
  753. </el-form-item>
  754. <el-form-item label="开户支行" :label-width="formLabelWidth">
  755. {{ customerlist.bankDepositBranch }}
  756. </el-form-item>
  757. <el-form-item
  758. label="收款人姓名"
  759. :label-width="formLabelWidth"
  760. v-if="customerlist.customerTypeFlag == '1'"
  761. >
  762. {{ customerlist.payeeName }}
  763. </el-form-item>
  764. <el-form-item
  765. label="收款人身份证号"
  766. :label-width="formLabelWidth"
  767. v-if="customerlist.customerTypeFlag == '1'"
  768. >
  769. {{ customerlist.payeeNumberCard }}
  770. </el-form-item>
  771. <el-form-item label="手机号" :label-width="formLabelWidth">
  772. {{ customerlist.customerPhone }}
  773. </el-form-item>
  774. <el-form-item label="联系地址" :label-width="formLabelWidth">
  775. {{ customerlist.compAddress }}
  776. </el-form-item>
  777. </el-form>
  778. <div slot="footer" class="dialog-footer">
  779. <el-button @click="cancel">取 消</el-button>
  780. </div>
  781. </el-dialog>
  782. <!--成交记录-->
  783. <el-dialog
  784. width="40%"
  785. title="成交记录"
  786. :visible.sync="dialogFormVisible6"
  787. :append-to-body="true"
  788. >
  789. <el-table :data="transactionRecordList">
  790. <el-table-column prop="transactionPrice" label="成交价">
  791. </el-table-column>
  792. <el-table-column prop="basis" label="基差"> </el-table-column>
  793. <el-table-column prop="turnover" label="成交量"> </el-table-column>
  794. <el-table-column prop="dealDate" label="成交日期"> </el-table-column>
  795. </el-table>
  796. </el-dialog>
  797. <!-- 平仓记录 -->
  798. <el-dialog
  799. width="40%"
  800. title="平仓记录"
  801. :visible.sync="dialogFormVisible7"
  802. :append-to-body="true"
  803. >
  804. <el-table :data="closePositionList">
  805. <el-table-column prop="transactionPrice" label="成交价">
  806. </el-table-column>
  807. <el-table-column prop="closingPrice" label="平仓价"> </el-table-column>
  808. <el-table-column prop="basis" label="基差"> </el-table-column>
  809. <el-table-column prop="turnover" label="平仓量"> </el-table-column>
  810. <el-table-column prop="dealDate" label="平仓日期"> </el-table-column>
  811. </el-table>
  812. </el-dialog>
  813. <!--改价记录-->
  814. <el-dialog
  815. width="10%"
  816. title="改价记录"
  817. :visible.sync="dialogFormVisible5"
  818. :append-to-body="true"
  819. >
  820. <div v-for="item in pricechange">
  821. <div>
  822. {{ item.priceType }}
  823. </div>
  824. <div class="price">
  825. {{ item.price }}
  826. </div>
  827. <div>{{ item.updateDate }}</div>
  828. </div>
  829. </el-dialog>
  830. </div>
  831. <!-- </div> -->
  832. </template>
  833. <script>
  834. import { packList } from '@/model/contarct/index'
  835. import {
  836. detailsList,
  837. chengList,
  838. getTransactionPriceList,
  839. closePositionList,
  840. aduitpurchase,
  841. aduitcontractno,
  842. editStatus,
  843. deletepurchase,
  844. } from '@/model/purchasingManagement/index'
  845. import { downloadFile } from '@/utils/batchDown'
  846. import Pagination from '@/components/Pagination'
  847. import WsUpload from '@/components/WsUpload'
  848. export default {
  849. name: 'viewSpareMoney',
  850. components: {
  851. WsUpload,
  852. Pagination,
  853. },
  854. watch: {
  855. vesselId(val) {
  856. this.getList()
  857. },
  858. isShow(val) {
  859. this.showType = val
  860. },
  861. },
  862. data() {
  863. return {
  864. dialogFormVisible1: false,
  865. dialogFormVisible2: false,
  866. dialogFormVisible3: false,
  867. dialogFormVisible4: false,
  868. dialogFormVisible5: false,
  869. dialogFormVisible6: false,
  870. dialogFormVisible7: false,
  871. dialogFormVisible8: false,
  872. dialogVisible: false,
  873. dialogImageUrl: '',
  874. form: {
  875. transactionPrice: '',
  876. transactionsNumber: '',
  877. basis: '',
  878. submissionDate: '',
  879. // delivery: false,
  880. // type: [],
  881. // resource: '',
  882. // desc: ''
  883. },
  884. formLabelWidth: '120px',
  885. basischange: false,
  886. barWidth: 0,
  887. barHeight: 0,
  888. retioX: 1,
  889. ratioY: 1,
  890. isTaped: false,
  891. isHover: false,
  892. isShow: !this.autohide,
  893. clinchdeal: {},
  894. clinchdeal1: {},
  895. //弹出框
  896. dialogViewSpareMoney: false,
  897. dialogApproveFormVisible: false,
  898. // 船舶类型
  899. monetaryKey: null,
  900. // 表格显示数据
  901. tableDate: [],
  902. // 是否显示
  903. showType: true,
  904. // 年
  905. year: '',
  906. pickerOptions: {},
  907. value2: '',
  908. deptBudgetTotal: 0,
  909. currentPage: 1,
  910. tranTypeKey: 1,
  911. pageSize: 10,
  912. searchType: '',
  913. searchTypeText: '全部订单',
  914. procurementPlanType: '',
  915. searchKeyWord: '',
  916. contractType: 2,
  917. enter: {
  918. closePositionList: [],
  919. },
  920. taskTypeList: [
  921. { value: '待审核', type: 1 },
  922. { value: '执行中', type: 2 },
  923. { value: '已完成', type: 3 },
  924. { value: '全部订单', type: '' },
  925. ],
  926. // 提交类型
  927. submitType: true,
  928. size: 10,
  929. spanArr: [],
  930. contractNo: '',
  931. customerlist: {},
  932. packingTypeList: [],
  933. inOutTaskNo: '',
  934. compId: sessionStorage.getItem('ws-pf_compId'),
  935. deptCircularPage: {},
  936. warehouseList: [],
  937. deptBudgetList: {},
  938. pcFlag: 1,
  939. invoiceList: [],
  940. contractNolist: [],
  941. pricechange: [],
  942. aduitlist: {
  943. unloadingCharge: 0,
  944. basis: 0,
  945. },
  946. basis: 0,
  947. replenishlist: {},
  948. closePositionList1: {},
  949. transactionRecordList1: [],
  950. transactionRecordList: {},
  951. closePositionList: [],
  952. historyList: [],
  953. pickerBeginDateBefore: {
  954. disabledDate: (time) => {
  955. return time.getTime() > Date.now()
  956. },
  957. },
  958. accessoryTFs: false,
  959. }
  960. },
  961. activated() {
  962. // this.loaddata()
  963. this.getList()
  964. this.showType = this.isShow
  965. },
  966. methods: {
  967. transaction(e){
  968. for (let i = 0; i < this.transactionRecordList1.length; i++) {
  969. if(this.transactionRecordList1[i].key==e){
  970. if(this.closePositionList1.openPosition>this.transactionRecordList1[i].value){
  971. this.closePositionList1.openPosition=this.transactionRecordList1[i].value
  972. }
  973. }
  974. }
  975. },
  976. cancel() {
  977. this.dialogFormVisible8 = false
  978. this.customerlist.cardAddressUrl1 = ''
  979. this.customerlist.cardAddressUrl2 = ''
  980. this.customerlist.customerName = ''
  981. this.customerlist.customerNumberCard = ''
  982. this.customerlist.payeeAddressUrl1 = ''
  983. this.customerlist.payeeAddressUrl2 = ''
  984. this.customerlist.bankCard = ''
  985. this.customerlist.bankDeposit = ''
  986. this.customerlist.bankDepositBranch = ''
  987. this.customerlist.payeeName = ''
  988. this.customerlist.payeeName = ''
  989. this.customerlist.payeeNumberCard = ''
  990. this.customerlist.customerPhone = ''
  991. this.customerlist.compAddress = ''
  992. this.customerlist.businessLicenseAddressUrl = ''
  993. this.customerlist.compName = ''
  994. this.customerlist.payTaxesCard = ''
  995. },
  996. //修改基差
  997. varietyClick(row) {
  998. if (row.basis) {
  999. if (isNaN(row.basis)) {
  1000. this.$message({
  1001. message: '基差非数字!',
  1002. type: 'warning',
  1003. })
  1004. return
  1005. }
  1006. }
  1007. if (!row.basis) {
  1008. this.$message({
  1009. message: '基差不能为空!',
  1010. type: 'warning',
  1011. })
  1012. return
  1013. }
  1014. this.$confirm(`确定要修改基差?`, {
  1015. confirmButtonText: '确定',
  1016. cancelButtonText: '取消',
  1017. type: 'warning',
  1018. })
  1019. .then(() => {
  1020. editStatus({
  1021. flag: 3,
  1022. basis: row.basis,
  1023. id: row.id,
  1024. })
  1025. .toPromise()
  1026. .then((response) => {
  1027. this.$notify.success({
  1028. title: '成功',
  1029. message: '修改成功',
  1030. })
  1031. this.getList()
  1032. })
  1033. .catch((response) => {})
  1034. })
  1035. .catch(() => {
  1036. return false
  1037. })
  1038. },
  1039. whether(row) {
  1040. row.identification = 'true'
  1041. },
  1042. nocomplete1(row) {
  1043. this.$router.push({
  1044. name: 'purchaseReceiptStatisticsList',
  1045. query: {
  1046. compId: sessionStorage.getItem('ws-pf_compId'),
  1047. currentPage: this.currentPage,
  1048. pageSize: this.pageSize
  1049. },
  1050. })
  1051. },
  1052. nocomplete(row) {
  1053. this.$router.push({
  1054. name: 'purchaseClosingCashierList',
  1055. query: {
  1056. compId: sessionStorage.getItem('ws-pf_compId'),
  1057. currentPage: this.currentPage,
  1058. pageSize: this.pageSize
  1059. },
  1060. })
  1061. },
  1062. handle(item) {
  1063. this.$confirm(`状态修改为已完成后不可再进行交易操作,是否确定修改?`, {
  1064. confirmButtonText: '确定',
  1065. cancelButtonText: '取消',
  1066. type: 'warning',
  1067. }).then(() => {
  1068. editStatus({ id: item.id, flag: 2 })
  1069. .toPromise()
  1070. .then((response) => {
  1071. this.$message.success('修改成功')
  1072. this.getList()
  1073. })
  1074. .catch((req) => {
  1075. this.$message.success('修改失败')
  1076. })
  1077. })
  1078. },
  1079. makeabargain(item) {
  1080. this.dialogFormVisible1 = true
  1081. this.clinchdeal.id = item.id
  1082. this.clinchdeal.commonId = item.commonId
  1083. },
  1084. deletehandle(item) {
  1085. this.$confirm(`采购订单删除后不可恢复,是否确定删除?`, {
  1086. confirmButtonText: '确定',
  1087. cancelButtonText: '取消',
  1088. type: 'warning',
  1089. }).then(() => {
  1090. deletepurchase({ id: item.id })
  1091. .toPromise()
  1092. .then((response) => {
  1093. this.$message.success('删除订单成功')
  1094. this.getList()
  1095. })
  1096. .catch((req) => {
  1097. this.$message.success('删除订单失败')
  1098. })
  1099. })
  1100. },
  1101. closepositionconfirm() {
  1102. this.closePositionList1.compId = sessionStorage.getItem('ws-pf_compId')
  1103. if (!this.closePositionList1.transactionPrice) {
  1104. this.$message({
  1105. message: '成交价不能为空!',
  1106. type: 'warning',
  1107. })
  1108. return
  1109. }
  1110. if (!this.closePositionList1.closingQuantity) {
  1111. this.$message({
  1112. message: '平仓数量不能为空!',
  1113. type: 'warning',
  1114. })
  1115. return
  1116. }
  1117. if (
  1118. (this.closePositionList1.closingQuantity &&
  1119. String(this.closePositionList1.closingQuantity).indexOf('.') != -1 &&
  1120. String(this.closePositionList1.closingQuantity).length -
  1121. (String(this.closePositionList1.closingQuantity).indexOf('.') + 1) >
  1122. 2) ||
  1123. this.closePositionList1.closingQuantity >
  1124. this.closePositionList1.openPosition ||
  1125. this.closePositionList1.closingQuantity < 1
  1126. ) {
  1127. this.$message({
  1128. message: '平仓数量超出上限',
  1129. type: 'warning',
  1130. })
  1131. return
  1132. }
  1133. if (!this.closePositionList1.closeRate) {
  1134. this.$message({
  1135. message: '平仓价格不能为空!',
  1136. type: 'warning',
  1137. })
  1138. return
  1139. }
  1140. if (
  1141. (this.closePositionList1.closeRate &&
  1142. String(this.closePositionList1.closeRate).indexOf('.') != -1 &&
  1143. String(this.closePositionList1.closeRate).length -
  1144. (String(this.closePositionList1.closeRate).indexOf('.') + 1) >
  1145. 2) ||
  1146. this.closePositionList1.closeRate > 100000 ||
  1147. this.closePositionList1.closeRate < 0
  1148. ) {
  1149. this.$message({
  1150. message: '平仓价格输入错误',
  1151. type: 'warning',
  1152. })
  1153. return
  1154. }
  1155. if (!this.closePositionList1.closingBasis) {
  1156. this.$message({
  1157. message: '平仓基差不能为空!',
  1158. type: 'warning',
  1159. })
  1160. return
  1161. }
  1162. if (
  1163. (this.closePositionList1.closingBasis &&
  1164. String(this.closePositionList1.closingBasis).indexOf('.') != -1 &&
  1165. String(this.closePositionList1.closingBasis).length -
  1166. (String(this.closePositionList1.closingBasis).indexOf('.') + 1) >
  1167. 2) ||
  1168. this.closePositionList1.closingBasis > 10000 ||
  1169. this.closePositionList1.closingBasis < 1
  1170. ) {
  1171. this.$message({
  1172. message: '平仓基差输入错误',
  1173. type: 'warning',
  1174. })
  1175. return
  1176. }
  1177. if (!this.closePositionList1.closePositionDate) {
  1178. this.$message({
  1179. message: '平仓日期不能为空!',
  1180. type: 'warning',
  1181. })
  1182. return
  1183. }
  1184. this.closePositionList1.closingBasis='-'+Math.abs(this.closePositionList1.closingBasis)
  1185. closePositionList(this.closePositionList1)
  1186. .toPromise()
  1187. .then((response) => {
  1188. this.$message.success('平仓成功')
  1189. this.closePositionList1 = {}
  1190. this.dialogFormVisible2 = false
  1191. this.getList()
  1192. })
  1193. .catch((req) => {
  1194. this.$message.warning('平仓失败')
  1195. })
  1196. },
  1197. //计算平仓应付
  1198. closingPositionPayable() {
  1199. this.closePositionList1.closingPositionPayable =
  1200. (this.closePositionList1.closeRate -
  1201. this.closePositionList1.transactionPrice -
  1202. this.closePositionList1.closingBasis) *
  1203. this.closePositionList1.closingQuantity
  1204. },
  1205. cloaeposition1(item) {
  1206. this.dialogFormVisible2 = true
  1207. this.$set(this.closePositionList1, 'id', item.id)
  1208. this.$set(this.closePositionList1, 'openPosition', item.openPosition)
  1209. this.$set(
  1210. this.closePositionList1,
  1211. 'transactionsNumber',
  1212. item.transactionsNumber
  1213. )
  1214. this.$set(this.closePositionList1, 'contractNo', item.contractNo)
  1215. this.$set(this.closePositionList1, 'planId', item.planId)
  1216. this.$set(this.closePositionList1, 'closeRate', item.closeRate)
  1217. this.$set(this.closePositionList1, 'seller', item.seller)
  1218. this.$set(this.closePositionList1, 'commonId', item.commonId)
  1219. getTransactionPriceList({
  1220. id: item.id,
  1221. })
  1222. .toPromise()
  1223. .then((response) => {
  1224. this.transactionRecordList1 = response
  1225. })
  1226. },
  1227. unfreeze(item) {
  1228. this.$confirm(`确定解冻订单(${item.procurementPlan})的定金?`, {
  1229. confirmButtonText: '确定',
  1230. cancelButtonText: '取消',
  1231. type: 'warning',
  1232. }).then(() => {
  1233. editStatus({ id: item.id, flag: 1 })
  1234. .toPromise()
  1235. .then((response) => {
  1236. this.$message.success('解冻定金成功')
  1237. this.getList()
  1238. })
  1239. .catch((req) => {
  1240. this.$message.success('解冻定金失败')
  1241. })
  1242. })
  1243. },
  1244. replenish() {
  1245. this.dialogFormVisible3 = false
  1246. if (!this.replenishlist.money) {
  1247. this.$message({
  1248. message: '补充金额不能为空!',
  1249. type: 'warning',
  1250. })
  1251. return
  1252. }
  1253. if (
  1254. String(this.replenishlist.money).indexOf('.') != -1 &&
  1255. String(this.replenishlist.money).length -
  1256. (String(this.replenishlist.money).indexOf('.') + 1) >
  1257. 2
  1258. ) {
  1259. this.$message({
  1260. message: '补充金额输入错误!',
  1261. type: 'warning',
  1262. })
  1263. return
  1264. }
  1265. if (this.replenishlist.money > this.replenishlist.defaultDeposit) {
  1266. this.$message({
  1267. message: '补充金额不能超过拖欠定金!',
  1268. type: 'warning',
  1269. })
  1270. return
  1271. }
  1272. if (
  1273. this.replenishlist.money >
  1274. this.replenishlist.totalDeposit - this.replenishlist.freezingDeposit
  1275. ) {
  1276. this.$message({
  1277. message: '补充金额不能超过可用定金!',
  1278. type: 'warning',
  1279. })
  1280. return
  1281. }
  1282. editStatus({
  1283. money: this.replenishlist.money,
  1284. id: this.replenishlist.id,
  1285. flag: 0,
  1286. })
  1287. .toPromise()
  1288. .then((response) => {
  1289. this.$message.success('补充成功')
  1290. this.getList()
  1291. })
  1292. .catch((req) => {
  1293. this.$message.success('补充失败')
  1294. })
  1295. },
  1296. addthedeposit(item) {
  1297. this.dialogFormVisible3 = true
  1298. this.$set(this.replenishlist, 'id', item.id)
  1299. this.$set(this.replenishlist, 'customer', item.customer)
  1300. this.$set(this.replenishlist, 'defaultDeposit', item.defaultDeposit)
  1301. this.$set(this.replenishlist,'totalDeposit', item.customerInfo.totalDeposit)
  1302. this.$set(this.replenishlist, 'freezingDeposit', item.freezingDeposit)
  1303. },
  1304. aduit(item) {
  1305. this.dialogFormVisible4 = true
  1306. this.aduitlist.id = item.id
  1307. this.aduitlist.type = '采购'
  1308. this.$set(this.aduitlist, 'seller', item.seller)
  1309. this.$set(this.aduitlist, 'sellerPhone', item.sellerPhone)
  1310. this.$set(this.aduitlist, 'tradingTarget', item.tradingTarget)
  1311. this.$set(this.aduitlist, 'transactionsNumber', item.transactionsNumber)
  1312. this.$set(this.aduitlist, 'createDate', item.createDate)
  1313. this.$set(this.aduitlist, 'packingType', item.packingType)
  1314. this.$set(this.aduitlist, 'packingTypeKey', item.packingTypeKey)
  1315. this.$set(this.aduitlist, 'taskId', item.taskId)
  1316. this.$set(this.aduitlist, 'type', item.type)
  1317. this.$set(this.aduitlist, 'typeKey', item.typeKey)
  1318. this.$set(this.aduitlist, 'procurementPlanType', item.procurementPlanType)
  1319. this.$set(this.aduitlist, 'basis', Math.abs(item.basis))
  1320. this.$set(this.aduitlist, 'depositRatio', item.customerInfo.depositRatio)
  1321. this.$set(this.aduitlist, 'totalDeposit', item.customerInfo.totalDeposit)
  1322. },
  1323. aduitconfirm() {
  1324. if (!this.aduitlist.unitPrice) {
  1325. this.$message({
  1326. message: '单价不能为空!',
  1327. type: 'warning',
  1328. })
  1329. return
  1330. }
  1331. if (
  1332. !this.aduitlist.basis &&
  1333. this.aduitlist.procurementPlanType != '现货'
  1334. ) {
  1335. this.$message({
  1336. message: '基差不能为空!',
  1337. type: 'warning',
  1338. })
  1339. return
  1340. }
  1341. if (!this.aduitlist.contractNo) {
  1342. this.$message({
  1343. message: '合同编号不能为空!',
  1344. type: 'warning',
  1345. })
  1346. return
  1347. }
  1348. if (
  1349. this.aduitlist.packingTypeKey != 1 &&
  1350. this.aduitlist.baggingNotes.length > 30
  1351. ) {
  1352. this.$message({
  1353. message: '袋装备注最长不能超过30字!',
  1354. type: 'warning',
  1355. })
  1356. return
  1357. }
  1358. if (
  1359. (this.aduitlist.unitPrice &&
  1360. String(this.aduitlist.unitPrice).indexOf('.') != -1 &&
  1361. String(this.aduitlist.unitPrice).length -
  1362. (String(this.aduitlist.unitPrice).indexOf('.') + 1) >
  1363. 2) ||
  1364. this.aduitlist.unitPrice > 100000 ||
  1365. this.aduitlist.unitPrice < 1
  1366. ) {
  1367. this.$message({
  1368. message: '单价输入错误',
  1369. type: 'warning',
  1370. })
  1371. return
  1372. }
  1373. if (
  1374. (this.aduitlist.basis &&
  1375. String(this.aduitlist.basis).indexOf('.') != -1 &&
  1376. String(this.aduitlist.basis).length -
  1377. (String(this.aduitlist.basis).indexOf('.') + 1) >
  1378. 2) ||
  1379. this.aduitlist.basis > 10000 ||
  1380. this.aduitlist.basis < 1
  1381. ) {
  1382. this.$message({
  1383. message: '基差输入错误',
  1384. type: 'warning',
  1385. })
  1386. return
  1387. }
  1388. if (
  1389. (this.aduitlist.unloadingCharge &&
  1390. String(this.aduitlist.unloadingCharge).indexOf('.') != -1 &&
  1391. String(this.aduitlist.unloadingCharge).length -
  1392. (String(this.aduitlist.unloadingCharge).indexOf('.') + 1) >
  1393. 2) ||
  1394. this.aduitlist.unloadingCharge > 1000 ||
  1395. this.aduitlist.unloadingCharge < 0
  1396. ) {
  1397. this.$message({
  1398. message: '卸车费用输入错误',
  1399. type: 'warning',
  1400. })
  1401. return
  1402. }
  1403. this.aduitlist.unloadingCharge = '-' + this.aduitlist.unloadingCharge
  1404. this.aduitlist.basis = '-' + this.aduitlist.basis
  1405. this.aduitlist.procurementPlanType = this.aduitlist.procurementPlanType
  1406. this.aduitlist.freezingDeposit = this.aduitlist.transactionsNumber*this.aduitlist.depositRatio
  1407. this.dialogFormVisible4 = false
  1408. this.$confirm(`审核通过后,将通知客户订单生效,是否确定通过审核?`, {
  1409. confirmButtonText: '确定',
  1410. cancelButtonText: '取消',
  1411. type: 'warning',
  1412. }).then(() => {
  1413. aduitpurchase(this.aduitlist)
  1414. .toPromise()
  1415. .then((response) => {
  1416. this.$message.success('审核成功')
  1417. this.aduitlist = {}
  1418. this.getList()
  1419. })
  1420. })
  1421. },
  1422. Changepricerecord(item) {
  1423. this.dialogFormVisible5 = true
  1424. this.pricechange = item.priceChangeRecordList
  1425. },
  1426. closedPositionLook(item) {
  1427. this.dialogFormVisible7 = true
  1428. this.closePositionList = item.closePositionList
  1429. },
  1430. transactionRecord(item) {
  1431. this.dialogFormVisible6 = true
  1432. this.transactionRecordList = item.transactionRecordList
  1433. },
  1434. customer(item) {
  1435. this.dialogFormVisible8 = true
  1436. if (item.customerInfo) {
  1437. this.customerlist = item.customerInfo
  1438. this.customerlist.cardAddressUrl1 =
  1439. this.customerlist.cardAddressUrl.split(',')[0]
  1440. this.customerlist.cardAddressUrl2 =
  1441. this.customerlist.cardAddressUrl.split(',')[1]
  1442. this.customerlist.payeeAddressUrl1 =
  1443. this.customerlist.payeeAddressUrl.split(',')[0]
  1444. this.customerlist.payeeAddressUrl2 =
  1445. this.customerlist.payeeAddressUrl.split(',')[1]
  1446. }
  1447. },
  1448. //成交
  1449. chengjiao() {
  1450. if (!this.clinchdeal1.transactionPrice) {
  1451. this.$message({
  1452. message: '成交价不能为空',
  1453. type: 'warning',
  1454. })
  1455. return
  1456. }
  1457. if (
  1458. (this.clinchdeal1.transactionPrice &&
  1459. String(this.clinchdeal1.transactionPrice).indexOf('.') != -1 &&
  1460. String(this.clinchdeal1.transactionPrice).length -
  1461. (String(this.clinchdeal1.transactionPrice).indexOf('.') + 1) >
  1462. 2) ||
  1463. this.clinchdeal1.transactionPrice > 100000 ||
  1464. this.clinchdeal1.transactionPrice < 0
  1465. ) {
  1466. this.$message({
  1467. message: '成交价输入错误',
  1468. type: 'warning',
  1469. })
  1470. return
  1471. }
  1472. if (!this.clinchdeal1.turnover) {
  1473. this.$message({
  1474. message: '成交量不能为空',
  1475. type: 'warning',
  1476. })
  1477. return
  1478. }
  1479. if (
  1480. (this.clinchdeal1.turnover &&
  1481. String(this.clinchdeal1.turnover).indexOf('.') != -1 &&
  1482. String(this.clinchdeal1.turnover).length -
  1483. (String(this.clinchdeal1.turnover).indexOf('.') + 1) >
  1484. 2) ||
  1485. this.clinchdeal1.turnover > 1000000 ||
  1486. this.clinchdeal1.turnover < 1
  1487. ) {
  1488. this.$message({
  1489. message: '成交量输入错误',
  1490. type: 'warning',
  1491. })
  1492. return
  1493. }
  1494. if (!this.clinchdeal1.basis) {
  1495. this.$message({
  1496. message: '基差不能为空',
  1497. type: 'warning',
  1498. })
  1499. return
  1500. }
  1501. if (
  1502. (this.clinchdeal1.basis &&
  1503. String(this.clinchdeal1.basis).indexOf('.') != -1 &&
  1504. String(this.clinchdeal1.basis).length -
  1505. (String(this.clinchdeal1.basis).indexOf('.') + 1) >
  1506. 2) ||
  1507. this.clinchdeal1.basis > 10000 ||
  1508. this.clinchdeal1.basis < 1
  1509. ) {
  1510. this.$message({
  1511. message: '基差输入错误',
  1512. type: 'warning',
  1513. })
  1514. return
  1515. }
  1516. if (!this.clinchdeal1.dealDate) {
  1517. this.$message({
  1518. message: '成交日期不能为空',
  1519. type: 'warning',
  1520. })
  1521. return
  1522. }
  1523. this.$confirm(`确定提交成交信息`, {
  1524. cancelButtonText: '取消',
  1525. confirmButtonText: '确定',
  1526. type: 'warning',
  1527. }).then(() => {
  1528. chengList({
  1529. transactionRecord: this.clinchdeal1,
  1530. id: this.clinchdeal.id,
  1531. commonId: this.clinchdeal.commonId,
  1532. compId: sessionStorage.getItem('ws-pf_compId'),
  1533. basis:'-'+Math.abs(this.clinchdeal1.basis)
  1534. })
  1535. .toPromise()
  1536. .then((response) => {
  1537. this.$message.success('成交成功')
  1538. this.dialogFormVisible1 = false
  1539. this.clinchdeal1 = {}
  1540. this.getList()
  1541. })
  1542. .catch(() => {
  1543. return false
  1544. })
  1545. })
  1546. },
  1547. selectpackingType(e) {
  1548. for (var i = 0; i < this.packingTypeList.length; i++) {
  1549. if (this.packingTypeList[i].constValue == e) {
  1550. this.aduitlist.packingTypeKey = this.packingTypeList[i].constKey
  1551. }
  1552. }
  1553. },
  1554. selectType(e) {
  1555. for (var i = 0; i < this.invoiceList.length; i++) {
  1556. if (this.invoiceList[i].constValue == e) {
  1557. this.aduitlist.typeKey = this.invoiceList[i].constKey
  1558. }
  1559. }
  1560. },
  1561. getList() {
  1562. detailsList({
  1563. compId: sessionStorage.getItem('ws-pf_compId'),
  1564. currentPage: this.currentPage,
  1565. pageSize: this.pageSize,
  1566. pcFlag: this.pcFlag,
  1567. searchType: this.searchType,
  1568. searchKeyWord: this.searchKeyWord,
  1569. })
  1570. .toPromise()
  1571. .then((response) => {
  1572. for (var i = 0; i < response.records.length; i++) {
  1573. response.records[i].identification = 'false'
  1574. response.records[i].openPosition =
  1575. response.records[i].cumulativeTurnover -
  1576. response.records[i].closedPosition -
  1577. response.records[i].stockInQuantity
  1578. response.records[i].shouldFreeze =
  1579. response.records[i].depositRatio * response.records[i].transactionsNumber
  1580. }
  1581. this.warehouseList = response
  1582. this.deptCircularPage.currentPage = response.current
  1583. this.deptCircularPage.pageSize = response.size
  1584. this.deptBudgetTotal = response.total
  1585. })
  1586. //包装方式
  1587. packList({ constId: 'PRO2' })
  1588. .toPromise()
  1589. .then((response) => {
  1590. this.packingTypeList = response
  1591. })
  1592. // 发票
  1593. packList({ constId: 'PRO5' })
  1594. .toPromise()
  1595. .then((response) => {
  1596. this.invoiceList = response
  1597. })
  1598. // 合同编号
  1599. aduitcontractno({
  1600. compId: sessionStorage.getItem('ws-pf_compId'),
  1601. flag: 0,
  1602. })
  1603. .toPromise()
  1604. .then((response) => {
  1605. this.contractNolist = response
  1606. })
  1607. },
  1608. handleRemove(file) {
  1609. console.log(file)
  1610. },
  1611. handlePictureCardPreview(file) {
  1612. this.dialogImageUrl = file.url
  1613. this.dialogVisible = true
  1614. },
  1615. handleDownload(file) {
  1616. console.log(file)
  1617. },
  1618. getSpanArr(data) {
  1619. let that = this
  1620. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  1621. that.spanArr = []
  1622. that.pos = 0
  1623. // //遍历数据
  1624. data.forEach((item, index) => {
  1625. //判断是否是第一项
  1626. if (index === 0) {
  1627. this.spanArr.push(1)
  1628. this.pos = 0
  1629. } else {
  1630. //不是第一项时,就根据标识去存储
  1631. if (data[index].warehouseNumViewList.length > 1) {
  1632. 查找到符合条件的数据时每次要把之前存储的数据 + 1
  1633. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  1634. this.spanArr.push(0)
  1635. } else {
  1636. // 没有符合的数据时,要记住当前的index
  1637. this.spanArr.push(1)
  1638. this.pos = index
  1639. }
  1640. }
  1641. })
  1642. },
  1643. //查看计划
  1644. lookPlan(row) {
  1645. this.$router.push({
  1646. path: 'procurementPlanLook',
  1647. query: {
  1648. id: row.planId,
  1649. },
  1650. })
  1651. },
  1652. //查看合同
  1653. lookContract(row) {
  1654. if(row.goodsType==1){
  1655. this.$router.push({
  1656. name: 'purchaseContractExamine',
  1657. query: {
  1658. id: row.contractId,
  1659. },
  1660. })
  1661. }
  1662. else{
  1663. this.$router.push({
  1664. name: 'futuresPurchaseContractExamine',
  1665. query: {
  1666. id: row.contractId,
  1667. },
  1668. })
  1669. }
  1670. },
  1671. //返回
  1672. revert() {
  1673. this.$router.push({ path: 'warehouseManagementList' })
  1674. },
  1675. dateFormat(fmt, date) {
  1676. let ret
  1677. const opt = {
  1678. 'Y+': date.getFullYear().toString(), // 年
  1679. 'm+': (date.getMonth() + 1).toString(), // 月
  1680. 'd+': date.getDate().toString(), // 日
  1681. 'H+': date.getHours().toString(), // 时
  1682. // "M+": date.getMinutes().toString(), // 分
  1683. // "S+": date.getSeconds().toString() // 秒
  1684. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  1685. }
  1686. for (let k in opt) {
  1687. ret = new RegExp('(' + k + ')').exec(fmt)
  1688. if (ret) {
  1689. fmt = fmt.replace(
  1690. ret[1],
  1691. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  1692. )
  1693. }
  1694. }
  1695. return fmt
  1696. },
  1697. handleClose() {
  1698. this.accessoryTFs = false
  1699. },
  1700. handleSizeChange(val) {
  1701. console.log(`每页 ${val} 条`)
  1702. this.pageSize = val
  1703. this.getList()
  1704. },
  1705. handleCurrentChange(val) {
  1706. this.currentPage = val
  1707. console.log(`当前页: ${val}`)
  1708. this.getList()
  1709. },
  1710. selecttaskType(e) {
  1711. for (var i = 0; i < this.taskTypeList.length; i++) {
  1712. if (this.taskTypeList[i].value == e) {
  1713. this.searchType = this.taskTypeList[i].type
  1714. }
  1715. }
  1716. },
  1717. handleExamine(row) {
  1718. this.$router.push({
  1719. name: 'salesContractExamine',
  1720. query: { id: row.id },
  1721. })
  1722. },
  1723. // 关闭 dialog时 处理文件url 初始化upload组件
  1724. handleCloe() {
  1725. this.dialogViewSpareMoney = false
  1726. },
  1727. history(row) {
  1728. billoperatehis({ id: row.id })
  1729. .toPromise()
  1730. .then((response) => {
  1731. this.historyList = response
  1732. })
  1733. },
  1734. //查找
  1735. find() {
  1736. this.currentPage = 1
  1737. this.getList()
  1738. },
  1739. async exportlist() {
  1740. const { data } = await export1(
  1741. {
  1742. compId: sessionStorage.getItem('ws-pf_compId'),
  1743. contractType: this.contractType,
  1744. currentPage: this.currentPage,
  1745. pageSize: this.pageSize,
  1746. searchType: this.searchType,
  1747. searchKeyWord: this.searchKeyWord,
  1748. startDate: this.startDate,
  1749. endDate: this.endDate,
  1750. },
  1751. {},
  1752. { responseType: 'blob' }
  1753. ).toPromise()
  1754. downloadFile({
  1755. res: data,
  1756. fileName: `${
  1757. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  1758. }_采购合同`,
  1759. type: 'xls',
  1760. })
  1761. },
  1762. total() {},
  1763. },
  1764. }
  1765. </script>
  1766. <style lang="scss" scoped>
  1767. .connert {
  1768. width: 90%;
  1769. margin: 0 auto;
  1770. }
  1771. .vertical-text-left {
  1772. width: 62px;
  1773. text-align: right;
  1774. }
  1775. //分页
  1776. .el-pagination {
  1777. padding: 10px 15px;
  1778. margin-bottom: 0;
  1779. text-align: center;
  1780. }
  1781. /deep/.el-pager li.active {
  1782. color: #5878e8;
  1783. cursor: default;
  1784. }
  1785. /deep/.el-pager li:hover {
  1786. color: #5878e8;
  1787. cursor: default;
  1788. }
  1789. .el-button--primary {
  1790. background-color: #5878e8;
  1791. border-color: #5878e8;
  1792. }
  1793. .el-button--default {
  1794. color: #8890b1;
  1795. border-color: #e8eaf1;
  1796. }
  1797. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  1798. width: 30px;
  1799. margin-left: 0;
  1800. border-top-left-radius: 0px;
  1801. border-bottom-left-radius: 0px;
  1802. }
  1803. /deep/.findValue .el-input__inner {
  1804. border-top-right-radius: 0px;
  1805. border-bottom-right-radius: 0px;
  1806. width: 385px;
  1807. margin-left: 53.5%;
  1808. }
  1809. .completed.el-button--default {
  1810. border-color: #5878e8;
  1811. background-color: #f6f7fc;
  1812. color: #5878e8;
  1813. }
  1814. .putstorage.el-button--default,
  1815. .deliverystorage.el-button--default {
  1816. border-color: #8890b1;
  1817. background-color: #fff;
  1818. color: #8890b1;
  1819. }
  1820. /deep/.el-table td,
  1821. /deep/.el-table th.is-leaf {
  1822. border-right: 1px solid #e9ecf7;
  1823. text-align: center;
  1824. }
  1825. /deep/.el-table tr td:first-child,
  1826. /deep/.el-table tr th.is-leaf:first-child {
  1827. border-left: 1px solid #e9ecf7;
  1828. }
  1829. .record,
  1830. .adjustment {
  1831. display: inline-block;
  1832. color: #5878e8;
  1833. padding: 0 4px !important;
  1834. position: relative;
  1835. font-size: 14px;
  1836. }
  1837. .record:after {
  1838. position: absolute;
  1839. content: '';
  1840. display: block;
  1841. top: 5px;
  1842. right: -2px;
  1843. width: 1px;
  1844. height: 12px;
  1845. // background: #e9ecf7;
  1846. }
  1847. .base_header_layout .grid-content {
  1848. margin-top: 80px;
  1849. }
  1850. .el-input--small .el-input__inner {
  1851. margin-left: 20px;
  1852. }
  1853. .el-range-editor--small.el-input__inner {
  1854. height: 32px;
  1855. margin-left: -20%;
  1856. }
  1857. //执行样式
  1858. .executory,
  1859. .inExecution,
  1860. .done {
  1861. width: 6px;
  1862. height: 6px;
  1863. display: inline-block;
  1864. border-radius: 50%;
  1865. position: relative;
  1866. top: -1px;
  1867. font-size: 14px;
  1868. }
  1869. .executory {
  1870. background: #ff9f24;
  1871. }
  1872. .inExecution {
  1873. background: #5878e8;
  1874. }
  1875. .done {
  1876. background: #50cad4;
  1877. }
  1878. .container {
  1879. overflow: scroll;
  1880. height: 93vh;
  1881. }
  1882. .button-container {
  1883. display: flex;
  1884. flex-wrap: nowrap;
  1885. justify-content: space-between;
  1886. align-items: center;
  1887. background-color: #fff;
  1888. width: 100%;
  1889. height: 50px;
  1890. padding: 0 10px;
  1891. & > div {
  1892. margin-left: 10px;
  1893. display: flex;
  1894. flex-wrap: nowrap;
  1895. flex-direction: row;
  1896. & > span {
  1897. line-height: 50px;
  1898. }
  1899. }
  1900. /deep/.auditFlow-box {
  1901. position: unset;
  1902. margin-left: 10px;
  1903. &/deep/.auditFlow-icon {
  1904. width: auto;
  1905. padding-right: 30px;
  1906. }
  1907. &/deep/.auditFlow-main {
  1908. position: absolute;
  1909. }
  1910. }
  1911. }
  1912. .bg-left {
  1913. padding-left: 30px;
  1914. }
  1915. .title {
  1916. position: relative;
  1917. }
  1918. .title::before {
  1919. content: '';
  1920. display: inline-block;
  1921. width: 5px;
  1922. height: 30px;
  1923. background: #5473e8;
  1924. position: absolute;
  1925. left: 0;
  1926. }
  1927. .el-button--primary {
  1928. background-color: #5878e8;
  1929. border-color: #5878e8;
  1930. // margin-left: 85%;
  1931. margin-top: 20px;
  1932. }
  1933. //导航条样式
  1934. .el-col-12 {
  1935. width: 50%;
  1936. height: 60px;
  1937. background: #f6f7fc;
  1938. border-radius: 4px 4px 1px 1px;
  1939. }
  1940. .el-input--small .el-input__inner {
  1941. height: 32px;
  1942. line-height: 32px;
  1943. width: 385px;
  1944. margin-top: 10px;
  1945. }
  1946. .bg-bottom {
  1947. margin-left: 85%;
  1948. }
  1949. .but {
  1950. margin-left: 30%;
  1951. overflow: auto;
  1952. margin-left: -10px;
  1953. }
  1954. /deep/.el-table .el-table__header .cell,
  1955. .el-table .el-table__body .cell {
  1956. text-align: center;
  1957. }
  1958. .el-scrollbar__wrap {
  1959. overflow-y: hidden;
  1960. }
  1961. .deal {
  1962. width: 66%;
  1963. }
  1964. .photo {
  1965. padding: 0% 34%;
  1966. }
  1967. .pingcangriqi {
  1968. width: 66% !important;
  1969. }
  1970. .chengjiaoriqi {
  1971. width: 117% !important;
  1972. }
  1973. .photo1 {
  1974. padding: 0 10%;
  1975. }
  1976. .photo2 {
  1977. padding: 0 55%;
  1978. }
  1979. /deep/.el-form-item--small .el-form-item__label,
  1980. .el-form-item--small .el-form-item__content {
  1981. text-align: center;
  1982. }
  1983. hr {
  1984. width: 91%;
  1985. }
  1986. /deep/.deaal {
  1987. width: 66%;
  1988. margin-left: 9%;
  1989. }
  1990. /deep/.closeposition .el-form-item__label {
  1991. width: 160px;
  1992. }
  1993. .customer .el-form-item {
  1994. border-bottom: 1px solid #ccc;
  1995. }
  1996. /deep/.base_header_layout .grid-content {
  1997. border-radius: 4px;
  1998. height: 36px;
  1999. line-height: 30px;
  2000. display: -webkit-box;
  2001. display: -ms-flexbox;
  2002. display: flex;
  2003. -webkit-box-align: center;
  2004. -ms-flex-align: center;
  2005. align-items: center;
  2006. text-align: justify;
  2007. margin: 0 auto;
  2008. }
  2009. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  2010. width: 30px;
  2011. margin-left: 0;
  2012. border-top-left-radius: 0px;
  2013. border-bottom-left-radius: 0px;
  2014. margin-top: -3px;
  2015. // margin-left: -10px;
  2016. }
  2017. /deep/.typeselect .el-input__inner {
  2018. color: #8890b1;
  2019. }
  2020. .inputChenge {
  2021. width: 50%;
  2022. display: inline-flex;
  2023. }
  2024. .price {
  2025. margin-left: 97px;
  2026. margin-top: -19px;
  2027. }
  2028. .chenglu {
  2029. font-size: 14px;
  2030. font-family: PingFangSC-Medium, PingFang SC;
  2031. font-weight: 500;
  2032. color: #8890b1;
  2033. line-height: 20px;
  2034. }
  2035. </style>