purchaseOrderList.vue 57 KB

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