futuresSalesContractAdd.vue 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772
  1. <!--期货销售合同添加-->
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="12">
  6. <h2 class="bg-left title">创建销售合同</h2>
  7. </el-col>
  8. <el-col :span="12" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="returnsales()"
  14. ><img
  15. width="6"
  16. height="10"
  17. style="vertical-align: bottom; margin-right: 3px"
  18. src="../../../public/img/lujing.png"
  19. alt=""
  20. />返回</el-button
  21. >
  22. </el-col>
  23. </el-row>
  24. <ws-form ref="deptBudgetList" :rules="rules" :model="deptBudgetList">
  25. <div class="remark">
  26. <h3>基本信息</h3>
  27. <p style="color: #8890b1">
  28. 注:基本信息和货物信息均为必填项,“*” 标记的条目提交后不可修改。
  29. </p>
  30. </div>
  31. <ws-info-table>
  32. <!--合同编号-->
  33. <ws-form-item
  34. label="合同编号"
  35. span="1"
  36. prop="contractNo"
  37. class="readonly"
  38. required
  39. >
  40. <ws-input
  41. v-model="deptBudgetList.contractNo"
  42. placeholder="请输入合同编号"
  43. maxlength="20"
  44. size="small"
  45. />
  46. </ws-form-item>
  47. <!--运输方式-->
  48. <ws-form-item label="运输方式" span="1" prop="shippingType">
  49. <ws-input
  50. v-model="deptBudgetList.shippingType"
  51. placeholder="请输入运输方式"
  52. maxlength="100"
  53. size="small"
  54. />
  55. </ws-form-item>
  56. <!--买方-->
  57. <ws-form-item label="买方" span="1" prop="buyer" >
  58. <ws-input
  59. v-model="deptBudgetList.buyer"
  60. placeholder="请输入买方名称"
  61. maxlength="100"
  62. size="small"
  63. />
  64. </ws-form-item>
  65. <!--结算方式-->
  66. <ws-form-item label="结算方式" span="1" prop="settlementMethod">
  67. <ws-input
  68. v-model="deptBudgetList.settlementMethod"
  69. placeholder="请输入结算方式"
  70. maxlength="100"
  71. size="small"
  72. />
  73. </ws-form-item>
  74. <!--买方电话-->
  75. <ws-form-item label="买方电话" span="1" prop="contractNo">
  76. <ws-input
  77. v-model.number="deptBudgetList.buyerPhone"
  78. placeholder="请输入买方电话"
  79. maxlength="100"
  80. size="small"
  81. />
  82. </ws-form-item>
  83. <ws-form-item label="交货方式" span="1" prop="seller" class="readonly">
  84. <el-radio v-model="deptBudgetList.deliverType" label="1"
  85. >我方自提</el-radio
  86. >
  87. <el-radio v-model="deptBudgetList.deliverType" label="2"
  88. >对方送货</el-radio
  89. >
  90. </ws-form-item>
  91. <!--卖方-->
  92. <ws-form-item label="卖方" span="1" prop="seller" >
  93. <ws-input
  94. v-model="deptBudgetList.seller"
  95. placeholder="请输入卖方名称"
  96. maxlength="100"
  97. size="small"
  98. />
  99. </ws-form-item>
  100. <!--包装方式-->
  101. <ws-form-item label="包装方式" span="1" prop="packingMethod">
  102. <ws-select
  103. v-model="deptBudgetList.packingMethod"
  104. placeholder=""
  105. class="typeselect"
  106. :value="value1"
  107. @change="selectpackingMethod"
  108. >
  109. <ws-option
  110. v-for="item in packtypeList"
  111. :key="item.constKey"
  112. :label="item.constValue"
  113. :value="item.constValue"
  114. />
  115. </ws-select>
  116. </ws-form-item>
  117. <!--卖方电话-->
  118. <ws-form-item label="卖方电话" span="1" prop="sellerPhone">
  119. <ws-input
  120. v-model="deptBudgetList.sellerPhone"
  121. placeholder="请输入卖方电话"
  122. maxlength="100"
  123. size="small"
  124. />
  125. </ws-form-item>
  126. <!--验收方式-->
  127. <ws-form-item label="验收方式" span="1" prop="acceptanceMethod">
  128. <el-select
  129. v-model="deptBudgetList.acceptanceMethod"
  130. placeholder="请选择验收方式"
  131. style="width: 100%"
  132. filterable
  133. @change="selectunitList"
  134. >
  135. <el-option
  136. v-for="(item, index) in unitList"
  137. :key="item.constValue"
  138. :label="item.constValue"
  139. :value="item.constValue"
  140. >
  141. <span class="unit-left" style="float: left">
  142. <span v-if="item.flag == 'delete'"> {{ item.constValue }}</span>
  143. <!-- 新增文本框 -->
  144. <div
  145. style="width: 160px"
  146. v-if="item.flag !== 'delete'"
  147. @click.stop
  148. >
  149. <ws-input
  150. v-model="item.constValue"
  151. clearable
  152. maxlength="10"
  153. style="width: 100%"
  154. ></ws-input>
  155. </div>
  156. </span>
  157. <span style="float: right; color: #8492a6; font-size: 13px">
  158. <!-- 对号 -->
  159. <i
  160. class="el-icon-check"
  161. style="line-height: 29px; margin-left: 10px"
  162. v-if="item.flag !== 'delete'"
  163. @click.stop="saveClick(item, index)"
  164. ></i>
  165. <!-- 编辑 -->
  166. <i
  167. class="el-icon-edit"
  168. style="line-height: 29px; margin-left: 10px"
  169. v-if="item.flag == 'delete'"
  170. @click.stop="editClick(item, index)"
  171. ></i>
  172. <!-- 删除 -->
  173. <i
  174. class="el-icon-delete"
  175. style="line-height: 29px"
  176. @click.stop="deleteClick(item, index)"
  177. ></i>
  178. </span>
  179. </el-option>
  180. <!-- 新增按钮 -->
  181. <el-option value="" label="">
  182. <div
  183. style="
  184. text-align: right;
  185. border-top: 1px solid #dcdfe6;
  186. padding: 5px;
  187. "
  188. >
  189. <ws-button type="primary" @click.stop="addClick">{{
  190. $t('button.add')
  191. }}</ws-button>
  192. </div>
  193. </el-option>
  194. </el-select>
  195. </ws-form-item>
  196. <!--交易数量(吨)-->
  197. <ws-form-item label="交易数量(吨)" span="1" prop="weight">
  198. <ws-input
  199. @input="weightchange"
  200. v-model="deptBudgetList.weight"
  201. placeholder="请输入重量(吨)"
  202. maxlength="100"
  203. size="small"
  204. />
  205. </ws-form-item>
  206. <!--计量标准-->
  207. <ws-form-item label="计量标准" span="1" prop="measurementStandard">
  208. <ws-input
  209. v-model="deptBudgetList.measurementStandard"
  210. placeholder="请输入计量标准,如库内磅单"
  211. maxlength="100"
  212. size="small"
  213. />
  214. </ws-form-item>
  215. <!--基差(元/吨)-->
  216. <ws-form-item label="基差(元/吨)" span="1" prop="basisPrice">
  217. <ws-input
  218. v-model="deptBudgetList.basisPrice"
  219. placeholder="请输入基差(元/吨)"
  220. maxlength="100"
  221. size="small"
  222. />
  223. </ws-form-item>
  224. <!--出货库-->
  225. <el-form-item label="出货库" span="1" prop="receiveWarehouse">
  226. <el-select
  227. v-model="deptBudgetList.receiveWarehouse"
  228. placeholder="请选择出货库"
  229. class="typeselect"
  230. @change="selectwarehouseName"
  231. >
  232. <el-option
  233. v-for="item in warehouseNameList"
  234. :key="item.constKey"
  235. :label="item.warehouseName"
  236. :value="item.warehouseName"
  237. />
  238. </el-select>
  239. </el-form-item>
  240. <!--交易所-->
  241. <ws-form-item label="交易所" span="1" prop="transactionsPlace">
  242. <ws-input
  243. v-model="deptBudgetList.transactionsPlace"
  244. placeholder="请输入交易所"
  245. maxlength="100"
  246. size="small"
  247. />
  248. </ws-form-item>
  249. <!--交货所在地区-->
  250. <ws-form-item label="交货所在地区" span="1" prop="sourceGoods">
  251. <el-cascader
  252. :options="options_"
  253. v-model="selectedOptions"
  254. clearable
  255. size="large"
  256. placeholder="请选择交货所在地区"
  257. style="width: 200%"
  258. @change="handleChange"
  259. />
  260. </ws-form-item>
  261. <!--合约号-->
  262. <ws-form-item label="合约号" span="1" prop="contractNumber">
  263. <ws-input
  264. v-model="deptBudgetList.contractNumber"
  265. placeholder="请输入合约号"
  266. maxlength="100"
  267. size="small"
  268. />
  269. </ws-form-item>
  270. <!--交货详细地址-->
  271. <ws-form-item label="交货详细地址" span="1" prop="placeDelivery">
  272. <ws-input
  273. v-model="deptBudgetList.placeDelivery"
  274. placeholder="请输入交货详细地址"
  275. maxlength="20"
  276. size="small"
  277. />
  278. </ws-form-item>
  279. <!--点价(元/吨)-->
  280. <ws-form-item label="点价(元/吨)" span="1" prop="pointPrice">
  281. <ws-input
  282. v-model="deptBudgetList.pointPrice"
  283. placeholder="请输入合约点价"
  284. maxlength="100"
  285. size="small"
  286. />
  287. </ws-form-item>
  288. <!--签订日期-->
  289. <ws-form-item label="签订日期" span="1" prop="signingDate">
  290. <ws-date-picker
  291. v-model="deptBudgetList.signingDate"
  292. type="date"
  293. placeholder="请选择合同签订日期"
  294. value-format="yyyy-MM-dd"
  295. />
  296. </ws-form-item>
  297. <!--点价日期-->
  298. <ws-form-item label="点价日期" span="1" prop="pointPriceDate">
  299. <ws-date-picker
  300. v-model="deptBudgetList.pointPriceDate"
  301. type="date"
  302. placeholder="请选择点价日期"
  303. value-format="yyyy-MM-dd"
  304. />
  305. </ws-form-item>
  306. <!--交货日期(起)-->
  307. <ws-form-item label="交货日期(起)" span="1" prop="deliveryDateStart">
  308. <ws-date-picker
  309. v-model="deptBudgetList.deliveryDateStart"
  310. type="date"
  311. placeholder="请选择交货日期(起)"
  312. value-format="yyyy-MM-dd"
  313. />
  314. </ws-form-item>
  315. <!--临时仓库负责人-->
  316. <ws-form-item
  317. v-show="deptBudgetList.deliverType == 1"
  318. label="临时仓库负责人"
  319. span="1"
  320. prop="packingMethod"
  321. >
  322. <el-select
  323. v-model="deptBudgetList.personCharge"
  324. placeholder="请选择临时仓库负责人"
  325. filterable
  326. :filter-method="dataFilter"
  327. @change="selectstaff"
  328. >
  329. <el-option
  330. v-for="item in options"
  331. :key="item.value"
  332. :label="item.staffName"
  333. :value="item.staffName"
  334. />
  335. </el-select>
  336. </ws-form-item>
  337. <!--交货日期(止)-->
  338. <ws-form-item label="交货日期(止)" span="1" prop="deliveryDateEnd">
  339. <ws-date-picker
  340. v-model="deptBudgetList.deliveryDateEnd"
  341. type="date"
  342. placeholder="请选择交货日期(止)"
  343. value-format="yyyy-MM-dd"
  344. />
  345. </ws-form-item>
  346. </ws-info-table>
  347. <div class="wenzi">
  348. <h3>货物信息</h3>
  349. </div>
  350. <!--货物信息-->
  351. <ws-info-table>
  352. <!--货名-->
  353. <ws-form-item label="货名" span="1" prop="goodsName" class="readonly">
  354. <ws-select
  355. v-model="deptBudgetList.contractGoodsInfo.goodsName"
  356. placeholder=""
  357. class="typeselect"
  358. @change="selectgoodsName"
  359. >
  360. <ws-option
  361. v-for="item in goodnameList"
  362. :key="item.constKey"
  363. :label="item.constValue"
  364. :value="item.constValue"
  365. />
  366. </ws-select>
  367. </ws-form-item>
  368. <!--水分(%)<=-->
  369. <ws-form-item label="水分(%)" span="1" prop="waterContent">
  370. <ws-input
  371. v-model="deptBudgetList.contractGoodsInfo.waterContent"
  372. placeholder="请输入水分占比"
  373. maxlength="100"
  374. size="small"
  375. />
  376. </ws-form-item>
  377. <!--品级-->
  378. <ws-form-item label="品级" span="1" prop="grade">
  379. <ws-select
  380. v-model="deptBudgetList.contractGoodsInfo.grade"
  381. placeholder="请选择品级"
  382. class="typeselect"
  383. @change="selectgrade"
  384. >
  385. <ws-option
  386. v-for="item in gradeList"
  387. :key="item.constKey"
  388. :label="item.constValue"
  389. :value="item.constValue"
  390. />
  391. </ws-select>
  392. </ws-form-item>
  393. <!--杂质(%)<=-->
  394. <ws-form-item label="杂质(%)" span="1" prop="impurity">
  395. <ws-input
  396. v-model="deptBudgetList.contractGoodsInfo.impurity"
  397. placeholder="请输入杂质占比(%)"
  398. maxlength="100"
  399. size="small"
  400. />
  401. </ws-form-item>
  402. <!--容量(克/升)>=-->
  403. <ws-form-item label="容量(克/升)" span="1" prop="bulkDensity">
  404. <ws-input
  405. v-model="deptBudgetList.contractGoodsInfo.bulkDensity"
  406. placeholder="请输入容重"
  407. maxlength="100"
  408. size="small"
  409. />
  410. </ws-form-item>
  411. <!--霉变粒(%)<=-->
  412. <ws-form-item label="霉变粒(%)" span="1" prop="mildewGrain">
  413. <ws-input
  414. v-model="deptBudgetList.contractGoodsInfo.mildewGrain"
  415. placeholder="请输入霉变粒占比(%)"
  416. maxlength="100"
  417. size="small"
  418. />
  419. </ws-form-item>
  420. <!--热损伤(%)<=-->
  421. <ws-form-item label="热损伤(%)" span="1" prop="jiaorenli">
  422. <ws-input
  423. v-model="deptBudgetList.contractGoodsInfo.jiaorenli"
  424. placeholder="请输入输入热损伤占比(%)"
  425. maxlength="100"
  426. size="small"
  427. />
  428. </ws-form-item>
  429. <!--不完整粒(%)<=-->
  430. <ws-form-item label="不完整粒(%)" span="1" prop="imperfectGrain">
  431. <ws-input
  432. v-model="deptBudgetList.contractGoodsInfo.imperfectGrain"
  433. placeholder="请输入不完整粒占比(%)"
  434. maxlength="100"
  435. size="small"
  436. />
  437. </ws-form-item>
  438. <!--蛋白(%)>=-->
  439. <ws-form-item label="蛋白(%)" span="1" prop="protein">
  440. <ws-input
  441. v-model="deptBudgetList.contractGoodsInfo.protein"
  442. placeholder="请输入蛋白占比(%)"
  443. maxlength="100"
  444. size="small"
  445. />
  446. </ws-form-item>
  447. <!--转基因-->
  448. <ws-form-item label="转基因" span="1" prop="transgene">
  449. <ws-select
  450. v-model="deptBudgetList.contractGoodsInfo.transgene"
  451. placeholder="请选择转基因要求"
  452. class="typeselect"
  453. @change="selecttransgene"
  454. >
  455. <ws-option
  456. v-for="item in transgeneList"
  457. :key="item.constKey"
  458. :label="item.constValue"
  459. :value="item.constValue"
  460. />
  461. </ws-select>
  462. </ws-form-item>
  463. <!--产地-->
  464. <ws-form-item label="产地" span="1" prop="protein">
  465. <el-cascader
  466. :options="options1_"
  467. v-model="selectedOptions1"
  468. clearable
  469. size="large"
  470. placeholder="请选择产地"
  471. @change="handleChange1"
  472. style="width:200%"
  473. />
  474. </ws-form-item>
  475. </ws-info-table>
  476. <div class="wenzi">
  477. <h3>流程信息</h3>
  478. </div>
  479. <!--流程信息-->
  480. <ws-info-table>
  481. <!--合同收入(元)-->
  482. <ws-form-item label="合同收入(元)" span="1" prop="goodsNameKey">
  483. <ws-input
  484. v-model="deptBudgetList.contractProcessInfo.goodsNameKey"
  485. placeholder="请输入合同收入(元)"
  486. maxlength="100"
  487. size="small"
  488. />
  489. </ws-form-item>
  490. <!--已开发票(元)-->
  491. <ws-form-item label="已开发票(元)" span="1" prop="goodsName">
  492. <ws-input
  493. v-model="deptBudgetList.contractProcessInfo.goodsName"
  494. placeholder="请输入已开发票(元)"
  495. maxlength="100"
  496. size="small"
  497. />
  498. </ws-form-item>
  499. <!--费用支出(元)-->
  500. <ws-form-item label="费用支出(元)" span="1" prop="waterContent">
  501. <ws-input
  502. v-model="deptBudgetList.contractProcessInfo.waterContent"
  503. placeholder="请输入费用支出(元)"
  504. maxlength="100"
  505. size="small"
  506. />
  507. </ws-form-item>
  508. <!--未开发票(元)-->
  509. <ws-form-item label="未开发票(元)" span="1" prop="impurity">
  510. <ws-input
  511. v-model="deptBudgetList.contractProcessInfo.impurity"
  512. placeholder="请输入未开发票(元)"
  513. maxlength="100"
  514. size="small"
  515. />
  516. </ws-form-item>
  517. <!--未回款(元)-->
  518. <ws-form-item label="未回款(元)" span="1" prop="mildewGrain">
  519. <ws-input
  520. v-model="deptBudgetList.contractProcessInfo.mildewGrain"
  521. placeholder="请输入未回款(元)"
  522. maxlength="100"
  523. size="small"
  524. />
  525. </ws-form-item>
  526. <!--双章原件回收情况-->
  527. <ws-form-item label="双章原件回收情况" span="1" prop="grade">
  528. <ws-select
  529. v-model="deptBudgetList.contractProcessInfo.grade"
  530. placeholder=""
  531. class="typeselect"
  532. @change="selectChapterTwo"
  533. >
  534. <ws-option
  535. v-for="item in ChapterTwoList"
  536. :key="item.constKey"
  537. :label="item.constValue"
  538. :value="item.constValue"
  539. />
  540. </ws-select>
  541. </ws-form-item>
  542. </ws-info-table>
  543. <div class="wenzi">
  544. <h3>备注信息</h3>
  545. </div>
  546. <!--备注信息-->
  547. <ws-input
  548. v-model="deptBudgetList.remarks"
  549. type="textarea"
  550. row="3"
  551. placeholder="请输入备注信息,不超过200字"
  552. maxlength="200"
  553. />
  554. <el-upload
  555. class="upload-demo"
  556. action="https://www.zthymaoyi.com/upload/admin"
  557. :on-success="
  558. (res, file) => {
  559. uploadSuccessHandle(res)
  560. }
  561. "
  562. multiple
  563. :limit="3"
  564. :file-list="fileList"
  565. >
  566. <el-button size="small" type="primary">点击上传</el-button>
  567. <div slot="tip" class="el-upload__tip">
  568. 推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip, .rar,单个文件大小不超过10M
  569. </div>
  570. </el-upload>
  571. </ws-form>
  572. <div style="text-align: right; padding: 10px" class="center">
  573. <el-button
  574. class="bg-bottom"
  575. type="primary"
  576. size="small"
  577. @click="submit(deptBudgetList)"
  578. >提交</el-button
  579. >
  580. </div>
  581. </div>
  582. </template>
  583. <script>
  584. import {
  585. getwarehousename,
  586. packList,
  587. addList,
  588. xiala,
  589. addxiala,
  590. editxiala,
  591. delxiala,
  592. getstaff,
  593. } from '@/model/contarct/index'
  594. import { regionData,provinceAndCityDataPlus, CodeToText, TextToCode } from 'element-china-area-data'
  595. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  596. import WsUpload from '@/components/WsUpload'
  597. export default {
  598. name: 'viewSpareMoney',
  599. components: {
  600. WsUpload,
  601. },
  602. watch: {
  603. vesselId(val) {
  604. this.getVesselData()
  605. },
  606. isShow(val) {
  607. this.showType = val
  608. },
  609. },
  610. data() {
  611. return {
  612. //弹出框
  613. dialogViewSpareMoney: false,
  614. dialogApproveFormVisible: false,
  615. // 船舶类型
  616. monetaryKey: null,
  617. // 表格显示数据
  618. tableDate: [],
  619. // 是否显示
  620. showType: true,
  621. // 年
  622. year: '',
  623. options_: regionData,
  624. options1_:provinceAndCityDataPlus,
  625. selectedOptions: [],
  626. selectedOptions1: [],
  627. // 提交类型
  628. submitType: true,
  629. tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
  630. packtypeList: [],
  631. compId: sessionStorage.getItem('ws-pf_compId'),
  632. rules: {
  633. // contractNo: [
  634. // { required: true, message: '请输入合同编号', trigger: 'blur' },
  635. // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' },
  636. // ],
  637. },
  638. options: [],
  639. staffList: [],
  640. appendixIdsAdd: '',
  641. size: 10,
  642. // uploadSuccess: {},
  643. // onChange:{},
  644. unitList: [],
  645. goodnameList: [],
  646. value1: '袋装',
  647. value2: '未回收',
  648. gradeList: [],
  649. warehouseNameList: [],
  650. warehouseNameList1: [],
  651. ChapterTwoList: [],
  652. transgeneList: [],
  653. deptBudgetList: {
  654. deliverType: '1',
  655. finalTradingVolume: 0,
  656. contractGoodsInfo: {
  657. goodsName: '',
  658. },
  659. contractProcessInfo: {},
  660. },
  661. acceptanceCheck: {},
  662. pickerBeginDateBefore: {
  663. disabledDate: (time) => {
  664. return time.getTime() > Date.now()
  665. },
  666. },
  667. ruleDeptBudget: {
  668. contractNo: [
  669. { required: true, message: '请输入活动名称', trigger: 'blur' },
  670. {
  671. min: 6,
  672. max: 20,
  673. message: '长度在 6 到 20 个字符',
  674. trigger: 'blur',
  675. },
  676. ],
  677. },
  678. selectIntendedShip: {},
  679. interviewTypeList: {},
  680. addressUrls: [],
  681. fileList:[],
  682. }
  683. },
  684. activated() {
  685. //cg.viewBudget
  686. //cg.viewSpareMoney
  687. // this.getVesselData();
  688. this.deptBudgetList.packingMethod = '散装'
  689. this.deptBudgetList.packingMethodKey = 1
  690. this.deptBudgetList.contractGoodsInfo.goodsName = '玉米'
  691. this.deptBudgetList.contractGoodsInfo.goodsNameKey = 1
  692. this.deptBudgetList.contractProcessInfo.grade = '未回收'
  693. this.deptBudgetList.contractProcessInfo.gradeKey = 1
  694. this.deptBudgetList.contractGoodsInfo.grade = '一等品'
  695. this.deptBudgetList.contractGoodsInfo.gradeKey = 1
  696. this.deptBudgetList.contractGoodsInfo.transgene = '不限'
  697. this.deptBudgetList.contractGoodsInfo.gradeKey = 1
  698. getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
  699. .toPromise()
  700. .then((response) => {
  701. this.options = response
  702. this.staffList = response
  703. })
  704. this.loaddata()
  705. this.showType = this.isShow
  706. },
  707. methods: {
  708. close(index) {
  709. this.addressUrls.splice(index, 1)
  710. },
  711. dataFilter(val) {
  712. this.deptBudgetList.personCharge = val
  713. if (val) {
  714. //val存在
  715. this.options = this.staffList.filter((item) => {
  716. if (
  717. !!~item.staffName.indexOf(val) ||
  718. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  719. ) {
  720. return true
  721. }
  722. })
  723. } else {
  724. //val为空时,还原数组
  725. this.options = this.staffList
  726. }
  727. },
  728. selectstaff(e) {
  729. for (var i = 0; i < this.staffList.length; i++) {
  730. if (this.staffList[i].staffName == e) {
  731. this.deptBudgetList.personPhone = this.staffList[i].staffMobilePhone
  732. this.deptBudgetList.personChargeKey = this.staffList[i].staffId
  733. }
  734. }
  735. },
  736. // 关闭 dialog时 处理文件url 初始化upload组件
  737. handleClose() {
  738. this.dialogViewSpareMoney = false
  739. },
  740. handleChange(value) {
  741. this.selectedOptions = value
  742. this.dataList.deliveryProvince = CodeToText[value[0]]
  743. this.dataList.deliveryCity = CodeToText[value[1]]
  744. this.dataList.deliveryArea = CodeToText[value[2]]
  745. },
  746. handleChange1(value) {
  747. this.selectedOptions1 = value
  748. this.dataList.contractGoodsInfo.outputPrivate = CodeToText[value[0]]
  749. this.dataList.contractGoodsInfo.outputCity = CodeToText[value[1]]
  750. },
  751. weightchange(e) {
  752. this.deptBudgetList.finalTradingVolume = e
  753. },
  754. returnsales() {
  755. this.$router.push({ path: 'futuresSalesContract' })
  756. },
  757. loaddata() {
  758. // 包装方式
  759. packList({ constId: 'CON1' })
  760. .toPromise()
  761. .then((response) => {
  762. this.packtypeList = response
  763. })
  764. // 验收方式
  765. this.getUnitList()
  766. // 货名
  767. packList({ constId: 'CON2' })
  768. .toPromise()
  769. .then((response) => {
  770. this.goodnameList = response
  771. })
  772. // 品级
  773. packList({ constId: 'CON3' })
  774. .toPromise()
  775. .then((response) => {
  776. this.gradeList = response
  777. })
  778. //转基因
  779. packList({ constId: 'CON7' })
  780. .toPromise()
  781. .then((response) => {
  782. this.transgeneList = response
  783. })
  784. //收货库
  785. getwarehousename({
  786. compId: this.compId,
  787. warehouseType: 1,
  788. })
  789. .toPromise()
  790. .then((response) => {
  791. this.warehouseNameList = response
  792. })
  793. getwarehousename({
  794. compId: this.compId,
  795. warehouseType: 2,
  796. })
  797. .toPromise()
  798. .then((response) => {
  799. this.warehouseNameList1 = response
  800. })
  801. // 双章
  802. packList({ constId: 'CON4' })
  803. .toPromise()
  804. .then((response) => {
  805. this.ChapterTwoList = response
  806. })
  807. },
  808. // 上传附件
  809. uploadSuccessHandle(e) {
  810. console.log(e)
  811. this.addressUrls.push(e.url)
  812. // this.deptBudgetList.addressUrl = this.addressUrls.toString
  813. },
  814. onChange(files) {
  815. this.fileNum = files
  816. this.$refs.upload.handleSaveBill().then((res) => {
  817. console.log(files)
  818. })
  819. },
  820. getUnitList() {
  821. xiala({
  822. compId: sessionStorage.getItem('ws-pf_compId'),
  823. constCode: 'TYPEYAN',
  824. })
  825. .toPromise()
  826. .then((response) => {
  827. this.unitList = response
  828. let currItem
  829. this.unitList.forEach((item, index, arr) => {
  830. item.flag = 'delete'
  831. if (this.vModel == item.constKey) {
  832. currItem = item
  833. }
  834. })
  835. //
  836. if (currItem) {
  837. this.selectContract(currItem.constValue)
  838. }
  839. })
  840. },
  841. submit() {
  842. if (!this.deptBudgetList.contractNo) {
  843. this.$message({
  844. message: '请输入合同编号',
  845. type: 'warning',
  846. })
  847. return
  848. }
  849. if (
  850. this.deptBudgetList.contractNo.length < 6 ||
  851. this.deptBudgetList.contractNo.length > 20
  852. ) {
  853. this.$message({
  854. message: '合同编号长度不符合要求,请输入6到20个字符之内!',
  855. type: 'warning',
  856. })
  857. return
  858. }
  859. if (!this.deptBudgetList.shippingType) {
  860. this.$message({
  861. message: '请输入运输方式!',
  862. type: 'warning',
  863. })
  864. return
  865. }
  866. if (
  867. this.deptBudgetList.shippingType.length < 1 ||
  868. this.deptBudgetList.shippingType.length > 20
  869. ) {
  870. this.$message({
  871. message: '运输方式长度不符合要求,请输入1到20个字符之内!',
  872. type: 'warning',
  873. })
  874. return
  875. }
  876. if (!this.deptBudgetList.buyer) {
  877. this.$message({
  878. message: '请输入买方名称!',
  879. type: 'warning',
  880. })
  881. return
  882. }
  883. if (this.deptBudgetList.buyer.length > 30) {
  884. this.$message({
  885. message: '买方名称长度不符合要求,请输入30个字符之内!',
  886. type: 'warning',
  887. })
  888. return
  889. }
  890. if (!this.deptBudgetList.seller) {
  891. this.$message({
  892. message: '请输入卖方名称!',
  893. type: 'warning',
  894. })
  895. return
  896. }
  897. if (this.deptBudgetList.seller.length > 30) {
  898. this.$message({
  899. message: '卖方名称长度不符合要求,请输入30个字符之内!',
  900. type: 'warning',
  901. })
  902. return
  903. }
  904. if (!this.deptBudgetList.buyerPhone) {
  905. this.$message({
  906. message: '请输入买方电话!',
  907. type: 'warning',
  908. })
  909. return
  910. }
  911. if (isNaN(this.deptBudgetList.buyerPhone)) {
  912. this.$message({
  913. message: '输入买方电话有误!',
  914. type: 'warning',
  915. })
  916. return
  917. }
  918. if (
  919. this.deptBudgetList.buyerPhone.length < 7 ||
  920. this.deptBudgetList.buyerPhone.length > 20
  921. ) {
  922. this.$message({
  923. message: '买方电话长度不符合要求,请输入7到20个字符之内!',
  924. type: 'warning',
  925. })
  926. return
  927. }
  928. if (!this.deptBudgetList.sellerPhone) {
  929. this.$message({
  930. message: '请输入卖方电话!',
  931. type: 'warning',
  932. })
  933. return
  934. }
  935. if (isNaN(this.deptBudgetList.sellerPhone)) {
  936. this.$message({
  937. message: '输入卖方电话有误!',
  938. type: 'warning',
  939. })
  940. return
  941. }
  942. if (
  943. this.deptBudgetList.buyerPhone.length < 7 ||
  944. this.deptBudgetList.buyerPhone.length > 20
  945. ) {
  946. this.$message({
  947. message: '卖方电话长度不符合要求,请输入7到20个字符之内!',
  948. type: 'warning',
  949. })
  950. return
  951. }
  952. if (!this.deptBudgetList.weight) {
  953. this.$message({
  954. message: '请输入交易数量!',
  955. type: 'warning',
  956. })
  957. return
  958. }
  959. if (
  960. isNaN(this.deptBudgetList.weight) ||
  961. (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
  962. String(this.deptBudgetList.weight).length -
  963. (String(this.deptBudgetList.weight).indexOf('.') + 1) >
  964. 3) ||
  965. this.deptBudgetList.weight < 0 ||
  966. this.deptBudgetList.weight > 200000
  967. ) {
  968. this.$message({
  969. message: '输入交易数量有误!',
  970. type: 'warning',
  971. })
  972. return
  973. }
  974. if (!this.deptBudgetList.basisPrice) {
  975. this.$message({
  976. message: '请输入基差!',
  977. type: 'warning',
  978. })
  979. return
  980. }
  981. if (
  982. isNaN(this.deptBudgetList.basisPrice) ||
  983. (String(this.deptBudgetList.basisPrice).indexOf('.') != -1 &&
  984. String(this.deptBudgetList.basisPrice).length -
  985. (String(this.deptBudgetList.basisPrice).indexOf('.') + 1) >
  986. 3) ||
  987. this.deptBudgetList.basisPrice < 0 ||
  988. this.deptBudgetList.basisPrice > 10000
  989. ) {
  990. this.$message({
  991. message: '基差输入错误!',
  992. type: 'warning',
  993. })
  994. return
  995. }
  996. if (!this.deptBudgetList.transactionsPlace) {
  997. this.$message({
  998. message: '请输入交易所!',
  999. type: 'warning',
  1000. })
  1001. return
  1002. }
  1003. if (
  1004. this.deptBudgetList.transactionsPlace.length < 2 ||
  1005. this.deptBudgetList.transactionsPlace.length > 15
  1006. ) {
  1007. this.$message({
  1008. message: '交易所长度不符合要求,请输入2到15个字符之内!',
  1009. type: 'warning',
  1010. })
  1011. return
  1012. }
  1013. if (!this.deptBudgetList.contractNumber) {
  1014. this.$message({
  1015. message: '请输入合约号!',
  1016. type: 'warning',
  1017. })
  1018. return
  1019. }
  1020. if (
  1021. this.deptBudgetList.contractNumber.length < 2 ||
  1022. this.deptBudgetList.contractNumber.length > 15
  1023. ) {
  1024. this.$message({
  1025. message: '合约号长度不符合要求,请输入2到15个字符之内!',
  1026. type: 'warning',
  1027. })
  1028. return
  1029. }
  1030. if (!this.deptBudgetList.pointPrice) {
  1031. this.$message({
  1032. message: '请输入点价!',
  1033. type: 'warning',
  1034. })
  1035. return
  1036. }
  1037. if (
  1038. isNaN(this.deptBudgetList.pointPrice) ||
  1039. (String(this.deptBudgetList.pointPrice).indexOf('.') != -1 &&
  1040. String(this.deptBudgetList.pointPrice).length -
  1041. (String(this.deptBudgetList.pointPrice).indexOf('.') + 1) >
  1042. 3) ||
  1043. this.deptBudgetList.pointPrice < 0 ||
  1044. this.deptBudgetList.pointPrice > 100000
  1045. ) {
  1046. this.$message({
  1047. message: '输入点价有误!',
  1048. type: 'warning',
  1049. })
  1050. return
  1051. }
  1052. if (!this.deptBudgetList.measurementStandard) {
  1053. this.$message({
  1054. message: '请输入计量标准!',
  1055. type: 'warning',
  1056. })
  1057. return
  1058. }
  1059. if (
  1060. this.deptBudgetList.measurementStandard.length < 1 ||
  1061. this.deptBudgetList.measurementStandard.length > 20
  1062. ) {
  1063. this.$message({
  1064. message: '计量标准长度不符合要求,请输入1到20个字符之内!',
  1065. type: 'warning',
  1066. })
  1067. return
  1068. }
  1069. if (!this.deptBudgetList.settlementMethod) {
  1070. this.$message({
  1071. message: '请输入结算方式!',
  1072. type: 'warning',
  1073. })
  1074. return
  1075. }
  1076. if (!this.deptBudgetList.placeDelivery) {
  1077. this.$message({
  1078. message: '请输入交货详细地址!',
  1079. type: 'warning',
  1080. })
  1081. return
  1082. }
  1083. if (this.selectedOptions.length == 0) {
  1084. this.$message({
  1085. message: '请选择交货所在地区!',
  1086. type: 'warning',
  1087. })
  1088. return
  1089. }
  1090. if (this.selectedOptions1.length == 0) {
  1091. this.$message({
  1092. message: '请选择产地!',
  1093. type: 'warning',
  1094. })
  1095. return
  1096. }
  1097. if (!this.deptBudgetList.deliveryDateStart) {
  1098. this.$message({
  1099. message: '请选择交货日期(起)',
  1100. type: 'warning',
  1101. })
  1102. return
  1103. }
  1104. if (!this.deptBudgetList.deliveryDateEnd) {
  1105. this.$message({
  1106. message: '请选择交货日期(止)',
  1107. type: 'warning',
  1108. })
  1109. return
  1110. }
  1111. //时间
  1112. if (
  1113. new Date(this.deptBudgetList.deliveryDateStart).getTime() >
  1114. new Date(this.deptBudgetList.deliveryDateEnd).getTime()
  1115. ) {
  1116. this.$message({
  1117. message: '交货日期(止)选择错误',
  1118. type: 'warning',
  1119. })
  1120. return
  1121. }
  1122. if (!this.deptBudgetList.signingDate) {
  1123. this.$message({
  1124. message: '请选择签订日期',
  1125. type: 'warning',
  1126. })
  1127. return
  1128. }
  1129. if (!this.deptBudgetList.contractGoodsInfo.goodsName) {
  1130. this.$message({
  1131. message: '请选择货名',
  1132. type: 'warning',
  1133. })
  1134. return
  1135. }
  1136. if (!this.deptBudgetList.contractGoodsInfo.waterContent) {
  1137. this.$message({
  1138. message: '请输入水分',
  1139. type: 'warning',
  1140. })
  1141. return
  1142. }
  1143. if (!this.deptBudgetList.contractGoodsInfo.grade) {
  1144. this.$message({
  1145. message: '请选择品级',
  1146. type: 'warning',
  1147. })
  1148. return
  1149. }
  1150. if (!this.deptBudgetList.contractGoodsInfo.transgene) {
  1151. this.$message({
  1152. message: '请选择转基因',
  1153. type: 'warning',
  1154. })
  1155. return
  1156. }
  1157. if (
  1158. !this.deptBudgetList.contractGoodsInfo.impurity ||
  1159. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') !=
  1160. -1 &&
  1161. String(this.deptBudgetList.contractGoodsInfo.impurity).length -
  1162. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf(
  1163. '.'
  1164. ) +
  1165. 1) >
  1166. 2)
  1167. ) {
  1168. this.$message({
  1169. message: '杂质输入错误',
  1170. type: 'warning',
  1171. })
  1172. return
  1173. }
  1174. if (
  1175. !this.deptBudgetList.contractGoodsInfo.bulkDensity ||
  1176. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
  1177. '.'
  1178. ) != -1 &&
  1179. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
  1180. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
  1181. '.'
  1182. ) +
  1183. 1) >
  1184. 2)
  1185. ) {
  1186. this.$message({
  1187. message: '容重输入错误',
  1188. type: 'warning',
  1189. })
  1190. return
  1191. }
  1192. if (
  1193. !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
  1194. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1195. '.'
  1196. ) != -1 &&
  1197. String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
  1198. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1199. '.'
  1200. ) +
  1201. 1) >
  1202. 2)
  1203. ) {
  1204. this.$message({
  1205. message: '霉变粒输入错误',
  1206. type: 'warning',
  1207. })
  1208. return
  1209. }
  1210. if (
  1211. !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
  1212. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
  1213. -1 &&
  1214. String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
  1215. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
  1216. '.'
  1217. ) +
  1218. 1) >
  1219. 2)
  1220. ) {
  1221. this.$message({
  1222. message: '热损伤输入错误',
  1223. type: 'warning',
  1224. })
  1225. return
  1226. }
  1227. if (
  1228. !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
  1229. (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
  1230. '.'
  1231. ) != -1 &&
  1232. String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
  1233. (String(
  1234. this.deptBudgetList.contractGoodsInfo.imperfectGrain
  1235. ).indexOf('.') +
  1236. 1) >
  1237. 2)
  1238. ) {
  1239. this.$message({
  1240. message: '不完整粒输入错误',
  1241. type: 'warning',
  1242. })
  1243. return
  1244. }
  1245. if (
  1246. !this.deptBudgetList.contractGoodsInfo.protein ||
  1247. (String(this.deptBudgetList.contractGoodsInfo.protein).indexOf(
  1248. '.'
  1249. ) != -1 &&
  1250. String(this.deptBudgetList.contractGoodsInfo.protein).length -
  1251. (String(
  1252. this.deptBudgetList.contractGoodsInfo.protein
  1253. ).indexOf('.') +
  1254. 1) >
  1255. 2)
  1256. ) {
  1257. this.$message({
  1258. message: '蛋白输入错误',
  1259. type: 'warning',
  1260. })
  1261. return
  1262. }
  1263. if (
  1264. this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000 ||
  1265. this.deptBudgetList.contractProcessInfo.goodsNameKey < 0 ||
  1266. (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
  1267. '.'
  1268. ) != -1 &&
  1269. String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
  1270. (String(
  1271. this.deptBudgetList.contractProcessInfo.goodsNameKey
  1272. ).indexOf('.') +
  1273. 1) >
  1274. 2)
  1275. )
  1276. {
  1277. this.$message({
  1278. message: '合同收入金额输入错误',
  1279. type: 'warning',
  1280. })
  1281. return
  1282. }
  1283. if (
  1284. this.deptBudgetList.contractProcessInfo.waterContent > 10000000 ||
  1285. this.deptBudgetList.contractProcessInfo.waterContent < 0 ||
  1286. (String(this.deptBudgetList.contractProcessInfo.waterContent).indexOf(
  1287. '.'
  1288. ) != -1 &&
  1289. String(this.deptBudgetList.contractProcessInfo.waterContent).length -
  1290. (String(
  1291. this.deptBudgetList.contractProcessInfo.waterContent
  1292. ).indexOf('.') +
  1293. 1) >
  1294. 2)
  1295. ) {
  1296. this.$message({
  1297. message: '费用金额输入错误',
  1298. type: 'warning',
  1299. })
  1300. return
  1301. }
  1302. if (
  1303. this.deptBudgetList.contractProcessInfo.goodsName > 1000000000 ||
  1304. this.deptBudgetList.contractProcessInfo.goodsName < 0 ||
  1305. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1306. '.'
  1307. ) != -1 &&
  1308. String(this.deptBudgetList.contractProcessInfo.goodsName).length -
  1309. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1310. '.'
  1311. ) +
  1312. 1) >
  1313. 2)
  1314. ) {
  1315. this.$message({
  1316. message: '已开发票金额输入错误',
  1317. type: 'warning',
  1318. })
  1319. return
  1320. }
  1321. if (
  1322. this.deptBudgetList.contractProcessInfo.impurity > 1000000000 ||
  1323. this.deptBudgetList.contractProcessInfo.impurity < 0 ||
  1324. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1325. '.'
  1326. ) != -1 &&
  1327. String(this.deptBudgetList.contractProcessInfo.impurity).length -
  1328. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1329. '.'
  1330. ) +
  1331. 1) >
  1332. 2)
  1333. ) {
  1334. this.$message({
  1335. message: '未开发票金额输入错误',
  1336. type: 'warning',
  1337. })
  1338. return
  1339. }
  1340. var that = this
  1341. this.$refs.deptBudgetList.validate((valid) => {
  1342. if (valid) {
  1343. this.deptBudgetList.contractGoodsInfo.outputPrivate = CodeToText[this.selectedOptions1[0]]
  1344. this.deptBudgetList.contractGoodsInfo.outputCity = CodeToText[this.selectedOptions1[1]]
  1345. this.deptBudgetList.deliveryProvince = CodeToText[this.selectedOptions[0]]
  1346. this.deptBudgetList.deliveryCity = CodeToText[this.selectedOptions[1]]
  1347. this.deptBudgetList.compId = this.compId
  1348. this.deptBudgetList.contractType = 1
  1349. this.deptBudgetList.goodsType = 2
  1350. if(this.deptBudgetList.deliveryProvince =="澳门特别行政区" || this.deptBudgetList.deliveryProvince == "澳门特别行政区"){
  1351. this.deptBudgetList.deliveryArea = "特别行政区"
  1352. }else{
  1353. this.deptBudgetList.deliveryArea = CodeToText[this.selectedOptions[2]]
  1354. }
  1355. this.deptBudgetList.addressUrl = this.addressUrls.toString()
  1356. addList(this.deptBudgetList)
  1357. .toPromise()
  1358. .then((response) => {
  1359. this.$message.success('添加成功')
  1360. this.deptBudgetList = {
  1361. deliverType: '1',
  1362. finalTradingVolume: 0,
  1363. contractGoodsInfo: {
  1364. goodsName: '',
  1365. },
  1366. contractProcessInfo: {},
  1367. }
  1368. this.$router.push({ path: 'futuresSalesContract' })
  1369. })
  1370. .catch((req) => {
  1371. EventBus.$emit('error', req.message)
  1372. })
  1373. } else {
  1374. // for (let key in that.rules) {
  1375. // EventBus.$emit('error', that.rules[key][0].message)
  1376. // return false
  1377. // }
  1378. return false
  1379. }
  1380. })
  1381. },
  1382. resetForm(deptBudgetList) {
  1383. this.$refs[deptBudgetList].resetFields()
  1384. },
  1385. addClick() {
  1386. this.unitList.push({
  1387. flag: 'add',
  1388. constValue: '',
  1389. constKey: '',
  1390. })
  1391. },
  1392. saveClick(item, index) {
  1393. if (Object.is(item.id, 1)) {
  1394. return
  1395. }
  1396. if (Object.is(this.unitList[index].flag, 'delete')) {
  1397. this.$set(this.unitList, index, { flag: 'check' })
  1398. } else {
  1399. this.$set(this.unitList, index, { flag: 'delete' })
  1400. }
  1401. if (!item.constValue) {
  1402. this.unitList.splice(index, 1)
  1403. return
  1404. }
  1405. if (item.flag == 'add') {
  1406. item.constKey = Math.random() * 20
  1407. this.acceptanceCheck.compId = this.compId
  1408. this.acceptanceCheck.constKey = item.constKey
  1409. this.acceptanceCheck.constCode = 'TYPEYAN'
  1410. this.acceptanceCheck.constValue = item.constValue
  1411. this.acceptanceCheck.id = item.id
  1412. addxiala(this.acceptanceCheck)
  1413. .toPromise()
  1414. .then((response) => {
  1415. this.getUnitList()
  1416. })
  1417. } else if (item.flag == 'check') {
  1418. this.acceptanceCheck.compId = this.compId
  1419. this.acceptanceCheck.constKey = item.constKey
  1420. this.acceptanceCheck.constCode = 'TYPEYAN'
  1421. this.acceptanceCheck.constValue = item.constValue
  1422. this.acceptanceCheck.id = item.id
  1423. editxiala(this.acceptanceCheck)
  1424. .toPromise()
  1425. .then((response) => {
  1426. this.getUnitList()
  1427. })
  1428. }
  1429. },
  1430. selectChapterTwo(e) {
  1431. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  1432. if (this.ChapterTwoList[i].constValue == e) {
  1433. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  1434. }
  1435. }
  1436. },
  1437. selectunitList(e) {
  1438. for (var i = 0; i < this.unitList.length; i++) {
  1439. if (this.unitList[i].constValue == e) {
  1440. this.deptBudgetList.acceptanceMethodKey = this.unitList[i].constKey
  1441. }
  1442. }
  1443. },
  1444. selectgrade(e) {
  1445. for (var i = 0; i < this.gradeList.length; i++) {
  1446. if (this.gradeList[i].constValue == e) {
  1447. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  1448. }
  1449. }
  1450. },
  1451. selecttransgene(e) {
  1452. for (var i = 0; i < this.transgeneList.length; i++) {
  1453. if (this.transgeneList[i].constValue == e) {
  1454. this.deptBudgetList.gradeKey = this.transgeneList[i].constKey
  1455. }
  1456. }
  1457. },
  1458. selectgoodsName(e) {
  1459. for (var i = 0; i < this.goodnameList.length; i++) {
  1460. if (this.goodnameList[i].constValue == e) {
  1461. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  1462. }
  1463. }
  1464. },
  1465. selectwarehouseName() {},
  1466. selectpackingMethod(e) {
  1467. for (var i = 0; i < this.packtypeList.length; i++) {
  1468. if (this.packtypeList[i].constValue == e) {
  1469. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  1470. }
  1471. }
  1472. },
  1473. // 编辑
  1474. editClick(item, index) {
  1475. const map = JSON.parse(JSON.stringify(item))
  1476. if (Object.is(item.id, 1)) {
  1477. return
  1478. }
  1479. if (Object.is(this.unitList[index].flag, 'delete')) {
  1480. map.flag = 'check'
  1481. this.$set(this.unitList, index, map)
  1482. } else {
  1483. map.flag = 'delete'
  1484. this.$set(this.unitList, index, map)
  1485. }
  1486. },
  1487. // 删除
  1488. deleteClick(item, index) {
  1489. if (Object.is(item.constKey, 1)) {
  1490. return
  1491. }
  1492. if (!item.constValue) {
  1493. this.unitList.splice(index, 1)
  1494. return
  1495. }
  1496. delxiala({ id: this.unitList[index].id })
  1497. .toPromise()
  1498. .then((response) => {
  1499. this.getUnitList()
  1500. this.pleaseChoose = ''
  1501. })
  1502. },
  1503. },
  1504. }
  1505. </script>
  1506. <style lang="scss" scoped>
  1507. .el-form {
  1508. padding: 0 15%;
  1509. }
  1510. /deep/.ws-info-table .el-form-item {
  1511. border-right: 1px solid #cdd2dc;
  1512. border-bottom: 1px solid #cdd2dc;
  1513. }
  1514. .readonly {
  1515. position: relative;
  1516. }
  1517. .readonly:after {
  1518. content: '*';
  1519. color: #ff2727;
  1520. position: absolute;
  1521. right: 8px;
  1522. z-index: 10;
  1523. top: 21%;
  1524. font-size: 20px;
  1525. }
  1526. .title {
  1527. position: relative;
  1528. }
  1529. .title::before {
  1530. content: '';
  1531. display: inline-block;
  1532. width: 5px;
  1533. height: 30px;
  1534. background: #5473e8;
  1535. position: absolute;
  1536. left: 0;
  1537. }
  1538. .el-button--primary {
  1539. background-color: #5878e8;
  1540. border-color: #5878e8;
  1541. }
  1542. .el-col {
  1543. background: #f6f7fc;
  1544. }
  1545. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1546. padding: 0 25px;
  1547. border-left: 1px solid #cdd2dc;
  1548. background: #fafbfc;
  1549. }
  1550. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1551. width: 140px;
  1552. text-align: center;
  1553. background: #f0f2f6;
  1554. // border: 1px solid #cdd2dc;
  1555. }
  1556. .button-container {
  1557. display: flex;
  1558. flex-wrap: nowrap;
  1559. justify-content: space-between;
  1560. align-items: center;
  1561. background-color: #fff;
  1562. width: 100%;
  1563. height: 50px;
  1564. padding: 0 10px;
  1565. & > div {
  1566. margin-left: 10px;
  1567. display: flex;
  1568. flex-wrap: nowrap;
  1569. flex-direction: row;
  1570. & > span {
  1571. line-height: 50px;
  1572. }
  1573. }
  1574. /deep/.auditFlow-box {
  1575. position: unset;
  1576. margin-left: 10px;
  1577. &/deep/.auditFlow-icon {
  1578. width: auto;
  1579. padding-right: 30px;
  1580. }
  1581. &/deep/.auditFlow-main {
  1582. position: absolute;
  1583. }
  1584. }
  1585. }
  1586. .box-app {
  1587. display: inline-block;
  1588. float: left;
  1589. margin-left: 30px;
  1590. line-height: 50px;
  1591. }
  1592. /deep/.el-dialog {
  1593. .el-form-item {
  1594. margin-bottom: 0 !important;
  1595. .el-input--medium {
  1596. textarea {
  1597. min-height: 100px !important;
  1598. }
  1599. }
  1600. }
  1601. }
  1602. .collapse-bottom {
  1603. margin-bottom: 20px;
  1604. }
  1605. .input-main .textarea .el-textarea__inner {
  1606. width: 100%;
  1607. z-index: 1;
  1608. }
  1609. .bg-left {
  1610. padding-left: 30px;
  1611. }
  1612. .bg-right {
  1613. padding-right: 10px;
  1614. text-align: right;
  1615. }
  1616. .bg-bottom {
  1617. margin: 15px 0px;
  1618. }
  1619. .wenzi h3 {
  1620. display: inline-block;
  1621. left: 10px;
  1622. }
  1623. .wenzi p {
  1624. display: inline-block;
  1625. }
  1626. .center {
  1627. width: 70%;
  1628. margin: 0 auto;
  1629. }
  1630. .el-form-item {
  1631. width: 50%;
  1632. }
  1633. .el-form-item__label {
  1634. text-align: center;
  1635. }
  1636. .ce {
  1637. width: 900px;
  1638. margin: 0 auto;
  1639. }
  1640. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  1641. /* height: 82px;*/
  1642. /*}*/
  1643. // 控制select为只读的时候显示样式
  1644. .hide-sel {
  1645. .el-input__inner {
  1646. border: 0px;
  1647. }
  1648. .el-icon-arrow-up {
  1649. display: none;
  1650. }
  1651. .el-textarea__inner {
  1652. background-color: #fff !important;
  1653. border: 0;
  1654. }
  1655. .el-date-editor {
  1656. i {
  1657. display: none;
  1658. }
  1659. }
  1660. .is-disabled {
  1661. .el-input__inner:hover {
  1662. background-color: #fff !important;
  1663. border: 0;
  1664. }
  1665. color: #606266;
  1666. .el-input__inner {
  1667. background-color: #fff !important;
  1668. border: 0;
  1669. color: #606266;
  1670. }
  1671. .el-textarea__inner {
  1672. background-color: #fff !important;
  1673. border: 0;
  1674. color: #606266;
  1675. }
  1676. }
  1677. }
  1678. // 控制select为只读的时候显示样式
  1679. /deep/.ws-class-table-col {
  1680. height: auto;
  1681. padding: 0px 2px;
  1682. /deep/.el-input__inner {
  1683. padding: 0px 2px;
  1684. }
  1685. }
  1686. /deep/.is-disabled {
  1687. .el-input__prefix,
  1688. .el-input__suffix {
  1689. display: none;
  1690. }
  1691. .el-input__inner {
  1692. background-color: #fff;
  1693. border-color: #fff !important;
  1694. color: #000 !important;
  1695. font-size: 14px;
  1696. cursor: text;
  1697. padding: 0 !important;
  1698. }
  1699. }
  1700. .winseaview-view {
  1701. padding: 0 0 20px;
  1702. }
  1703. .container {
  1704. overflow: scroll;
  1705. height: 93vh;
  1706. }
  1707. /deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
  1708. width: 130px;
  1709. }
  1710. .el-textarea {
  1711. width: 101%;
  1712. }
  1713. .addressUrls {
  1714. width: 100%;
  1715. display: flex;
  1716. margin-top: 10px;
  1717. }
  1718. .addressUrls-item {
  1719. position: relative;
  1720. display: flex;
  1721. }
  1722. .icon-guanbi {
  1723. position: absolute;
  1724. right: 8px;
  1725. }
  1726. .addressUrl {
  1727. margin: 0px 10px;
  1728. border-radius: 3px;
  1729. }
  1730. //上传文件成功标识
  1731. /deep/.el-upload-list__item-status-label {
  1732. position: absolute;
  1733. right: 22px;
  1734. top: -1px;
  1735. line-height: inherit;
  1736. display: none;
  1737. }
  1738. </style>