futuresSalesContractAdd.vue 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850
  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. <ws-upload
  555. ref="upload"
  556. :comp-id="compId"
  557. :appendix-ids="deptBudgetList.addressUrl"
  558. :size-limit="size"
  559. @onChange="onChange"
  560. accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
  561. />
  562. </ws-form>
  563. <div style="text-align: right; padding: 10px" class="center">
  564. <el-button
  565. class="bg-bottom"
  566. type="primary"
  567. size="small"
  568. @click="submit(deptBudgetList)"
  569. >提交</el-button
  570. >
  571. </div>
  572. </div>
  573. </template>
  574. <script>
  575. import {
  576. getwarehousename,
  577. packList,
  578. addList,
  579. xiala,
  580. addxiala,
  581. editxiala,
  582. delxiala,
  583. getstaff,
  584. } from '@/model/contarct/index'
  585. import { regionData,provinceAndCityDataPlus, CodeToText, TextToCode } from 'element-china-area-data'
  586. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  587. import WsUpload from '@/components/WsUpload'
  588. export default {
  589. name: 'viewSpareMoney',
  590. components: {
  591. WsUpload,
  592. },
  593. watch: {
  594. vesselId(val) {
  595. this.getVesselData()
  596. },
  597. isShow(val) {
  598. this.showType = val
  599. },
  600. },
  601. data() {
  602. return {
  603. //弹出框
  604. dialogViewSpareMoney: false,
  605. dialogApproveFormVisible: false,
  606. // 船舶类型
  607. monetaryKey: null,
  608. // 表格显示数据
  609. tableDate: [],
  610. // 是否显示
  611. showType: true,
  612. // 年
  613. year: '',
  614. options_: regionData,
  615. options1_:provinceAndCityDataPlus,
  616. selectedOptions: [],
  617. selectedOptions1: [],
  618. // 提交类型
  619. submitType: true,
  620. tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
  621. packtypeList: [],
  622. compId: sessionStorage.getItem('ws-pf_compId'),
  623. rules: {
  624. // contractNo: [
  625. // { required: true, message: '请输入合同编号', trigger: 'blur' },
  626. // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' },
  627. // ],
  628. },
  629. options: [],
  630. staffList: [],
  631. appendixIdsAdd: '',
  632. size: 10,
  633. unitList: [],
  634. goodnameList: [],
  635. value1: '袋装',
  636. value2: '未回收',
  637. gradeList: [],
  638. warehouseNameList: [],
  639. warehouseNameList1: [],
  640. ChapterTwoList: [],
  641. transgeneList: [],
  642. deptBudgetList: {
  643. deliverType: '1',
  644. finalTradingVolume: 0,
  645. contractGoodsInfo: {
  646. goodsName: '',
  647. },
  648. contractProcessInfo: {},
  649. },
  650. acceptanceCheck: {},
  651. pickerBeginDateBefore: {
  652. disabledDate: (time) => {
  653. return time.getTime() > Date.now()
  654. },
  655. },
  656. ruleDeptBudget: {
  657. contractNo: [
  658. { required: true, message: '请输入活动名称', trigger: 'blur' },
  659. {
  660. min: 6,
  661. max: 20,
  662. message: '长度在 6 到 20 个字符',
  663. trigger: 'blur',
  664. },
  665. ],
  666. },
  667. selectIntendedShip: {},
  668. interviewTypeList: {},
  669. }
  670. },
  671. activated() {
  672. //cg.viewBudget
  673. //cg.viewSpareMoney
  674. // this.getVesselData();
  675. this.deptBudgetList.packingMethod = '散装'
  676. this.deptBudgetList.packingMethodKey = 1
  677. this.deptBudgetList.contractGoodsInfo.goodsName = '玉米'
  678. this.deptBudgetList.contractGoodsInfo.goodsNameKey = 1
  679. this.deptBudgetList.contractProcessInfo.grade = '未回收'
  680. this.deptBudgetList.contractProcessInfo.gradeKey = 1
  681. this.deptBudgetList.contractGoodsInfo.grade = '一等品'
  682. this.deptBudgetList.contractGoodsInfo.gradeKey = 1
  683. getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
  684. .toPromise()
  685. .then((response) => {
  686. this.options = response
  687. this.staffList = response
  688. })
  689. this.loaddata()
  690. this.showType = this.isShow
  691. },
  692. methods: {
  693. dataFilter(val) {
  694. this.deptBudgetList.personCharge = val
  695. if (val) {
  696. //val存在
  697. this.options = this.staffList.filter((item) => {
  698. if (
  699. !!~item.staffName.indexOf(val) ||
  700. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  701. ) {
  702. return true
  703. }
  704. })
  705. } else {
  706. //val为空时,还原数组
  707. this.options = this.staffList
  708. }
  709. },
  710. selectstaff(e) {
  711. for (var i = 0; i < this.staffList.length; i++) {
  712. if (this.staffList[i].staffName == e) {
  713. this.deptBudgetList.personPhone = this.staffList[i].staffMobilePhone
  714. this.deptBudgetList.personChargeKey = this.staffList[i].staffId
  715. }
  716. }
  717. },
  718. // 关闭 dialog时 处理文件url 初始化upload组件
  719. handleClose() {
  720. this.dialogViewSpareMoney = false
  721. },
  722. handleChange(value) {
  723. this.selectedOptions = value
  724. this.dataList.deliveryProvince = CodeToText[value[0]]
  725. this.dataList.deliveryCity = CodeToText[value[1]]
  726. this.dataList.deliveryArea = CodeToText[value[2]]
  727. },
  728. handleChange1(value) {
  729. this.selectedOptions1 = value
  730. this.dataList.contractGoodsInfo.outputPrivate = CodeToText[value[0]]
  731. this.dataList.contractGoodsInfo.outputCity = CodeToText[value[1]]
  732. },
  733. weightchange(e) {
  734. this.deptBudgetList.finalTradingVolume = e
  735. },
  736. returnsales() {
  737. this.$router.push({ path: 'futuresSalesContract' })
  738. },
  739. loaddata() {
  740. // 包装方式
  741. packList({ constId: 'PRO2' })
  742. .toPromise()
  743. .then((response) => {
  744. this.packtypeList = response
  745. })
  746. // 验收方式
  747. this.getUnitList()
  748. // 货名
  749. packList({ constId: 'CON2' })
  750. .toPromise()
  751. .then((response) => {
  752. this.goodnameList = response
  753. })
  754. // 品级
  755. packList({ constId: 'CON3' })
  756. .toPromise()
  757. .then((response) => {
  758. this.gradeList = response
  759. })
  760. //转基因
  761. packList({ constId: 'CON7' })
  762. .toPromise()
  763. .then((response) => {
  764. this.transgeneList = response
  765. })
  766. //收货库
  767. getwarehousename({
  768. compId: this.compId,
  769. warehouseType: 1,
  770. })
  771. .toPromise()
  772. .then((response) => {
  773. this.warehouseNameList = response
  774. })
  775. getwarehousename({
  776. compId: this.compId,
  777. warehouseType: 2,
  778. })
  779. .toPromise()
  780. .then((response) => {
  781. this.warehouseNameList1 = response
  782. })
  783. // 双章
  784. packList({ constId: 'CON4' })
  785. .toPromise()
  786. .then((response) => {
  787. this.ChapterTwoList = response
  788. })
  789. },
  790. onChange(files) {
  791. this.$refs.upload
  792. .handleSaveBill()
  793. .then(async response => {
  794. this.deptBudgetList.addressUrl = response
  795. })
  796. .catch(res => {
  797. EventBus.$emit('error', (JSON.parse(res) || {}).message)
  798. this.$refs.upload.clearFiles()
  799. })
  800. },
  801. getUnitList() {
  802. xiala({
  803. compId: sessionStorage.getItem('ws-pf_compId'),
  804. constCode: 'TYPEYAN',
  805. })
  806. .toPromise()
  807. .then((response) => {
  808. this.unitList = response
  809. let currItem
  810. this.unitList.forEach((item, index, arr) => {
  811. item.flag = 'delete'
  812. if (this.vModel == item.constKey) {
  813. currItem = item
  814. }
  815. })
  816. //
  817. if (currItem) {
  818. this.selectContract(currItem.constValue)
  819. }
  820. })
  821. },
  822. submit() {
  823. if (!this.deptBudgetList.contractNo) {
  824. this.$message({
  825. message: '请输入合同编号',
  826. type: 'warning',
  827. })
  828. return
  829. }
  830. if (
  831. this.deptBudgetList.contractNo.length < 6 ||
  832. this.deptBudgetList.contractNo.length > 20
  833. ) {
  834. this.$message({
  835. message: '合同编号长度不符合要求,请输入6到20个字符之内!',
  836. type: 'warning',
  837. })
  838. return
  839. }
  840. if (!this.deptBudgetList.shippingType) {
  841. this.$message({
  842. message: '请输入运输方式!',
  843. type: 'warning',
  844. })
  845. return
  846. }
  847. if (
  848. this.deptBudgetList.shippingType.length < 1 ||
  849. this.deptBudgetList.shippingType.length > 20
  850. ) {
  851. this.$message({
  852. message: '运输方式长度不符合要求,请输入1到20个字符之内!',
  853. type: 'warning',
  854. })
  855. return
  856. }
  857. if (!this.deptBudgetList.buyer) {
  858. this.$message({
  859. message: '请输入买方名称!',
  860. type: 'warning',
  861. })
  862. return
  863. }
  864. if (this.deptBudgetList.buyer.length > 30) {
  865. this.$message({
  866. message: '买方名称长度不符合要求,请输入30个字符之内!',
  867. type: 'warning',
  868. })
  869. return
  870. }
  871. if (!this.deptBudgetList.settlementMethod) {
  872. this.$message({
  873. message: '请输入结算方式!',
  874. type: 'warning',
  875. })
  876. return
  877. }
  878. if (
  879. this.deptBudgetList.settlementMethod.length < 1 ||
  880. this.deptBudgetList.settlementMethod.length > 20
  881. ) {
  882. this.$message({
  883. message: '结算方式长度不符合要求,请输入1到20个字符之内!',
  884. type: 'warning',
  885. })
  886. return
  887. }
  888. if (!this.deptBudgetList.buyerPhone) {
  889. this.$message({
  890. message: '请输入买方电话!',
  891. type: 'warning',
  892. })
  893. return
  894. }
  895. if (isNaN(this.deptBudgetList.buyerPhone)) {
  896. this.$message({
  897. message: '输入买方电话有误!',
  898. type: 'warning',
  899. })
  900. return
  901. }
  902. if (
  903. this.deptBudgetList.buyerPhone.length < 7 ||
  904. this.deptBudgetList.buyerPhone.length > 20
  905. ) {
  906. this.$message({
  907. message: '买方电话长度不符合要求,请输入7到20个字符之内!',
  908. type: 'warning',
  909. })
  910. return
  911. }
  912. if (!this.deptBudgetList.seller) {
  913. this.$message({
  914. message: '请输入卖方名称!',
  915. type: 'warning',
  916. })
  917. return
  918. }
  919. if (this.deptBudgetList.seller.length > 30) {
  920. this.$message({
  921. message: '卖方名称长度不符合要求,请输入30个字符之内!',
  922. type: 'warning',
  923. })
  924. return
  925. }
  926. if (!this.deptBudgetList.sellerPhone) {
  927. this.$message({
  928. message: '请输入卖方电话!',
  929. type: 'warning',
  930. })
  931. return
  932. }
  933. if (isNaN(this.deptBudgetList.sellerPhone)) {
  934. this.$message({
  935. message: '输入卖方电话有误!',
  936. type: 'warning',
  937. })
  938. return
  939. }
  940. if (
  941. this.deptBudgetList.buyerPhone.length < 7 ||
  942. this.deptBudgetList.buyerPhone.length > 20
  943. ) {
  944. this.$message({
  945. message: '卖方电话长度不符合要求,请输入7到20个字符之内!',
  946. type: 'warning',
  947. })
  948. return
  949. }
  950. if (!this.deptBudgetList.acceptanceMethod) {
  951. this.$message({
  952. message: '请选择验收方式',
  953. type: 'warning',
  954. })
  955. return
  956. }
  957. if (!this.deptBudgetList.weight) {
  958. this.$message({
  959. message: '请输入交易数量!',
  960. type: 'warning',
  961. })
  962. return
  963. }
  964. if (
  965. isNaN(this.deptBudgetList.weight) ||
  966. (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
  967. String(this.deptBudgetList.weight).length -
  968. (String(this.deptBudgetList.weight).indexOf('.') + 1) >
  969. 3) ||
  970. this.deptBudgetList.weight < 0 ||
  971. this.deptBudgetList.weight > 200000
  972. ) {
  973. this.$message({
  974. message: '输入交易数量有误!',
  975. type: 'warning',
  976. })
  977. return
  978. }
  979. if (!this.deptBudgetList.measurementStandard) {
  980. this.$message({
  981. message: '请输入计量标准!',
  982. type: 'warning',
  983. })
  984. return
  985. }
  986. if (
  987. this.deptBudgetList.measurementStandard.length < 1 ||
  988. this.deptBudgetList.measurementStandard.length > 20
  989. ) {
  990. this.$message({
  991. message: '计量标准长度不符合要求,请输入1到20个字符之内!',
  992. type: 'warning',
  993. })
  994. return
  995. }
  996. if (!String(this.deptBudgetList.basisPrice)) {
  997. this.$message({
  998. message: '请输入基差!',
  999. type: 'warning',
  1000. })
  1001. return
  1002. }
  1003. if (
  1004. isNaN(this.deptBudgetList.basisPrice) ||
  1005. (String(this.deptBudgetList.basisPrice).indexOf('.') != -1 &&
  1006. String(this.deptBudgetList.basisPrice).length -
  1007. (String(this.deptBudgetList.basisPrice).indexOf('.') + 1) >
  1008. 3) ||
  1009. this.deptBudgetList.basisPrice < 0 ||
  1010. this.deptBudgetList.basisPrice > 10000
  1011. ) {
  1012. this.$message({
  1013. message: '基差输入错误!',
  1014. type: 'warning',
  1015. })
  1016. return
  1017. }
  1018. if (!this.deptBudgetList.receiveWarehouse) {
  1019. this.$message({
  1020. message: '请选择出货库!',
  1021. type: 'warning',
  1022. })
  1023. return
  1024. }
  1025. if (!this.deptBudgetList.transactionsPlace) {
  1026. this.$message({
  1027. message: '请输入交易所!',
  1028. type: 'warning',
  1029. })
  1030. return
  1031. }
  1032. if (
  1033. this.deptBudgetList.transactionsPlace.length < 2 ||
  1034. this.deptBudgetList.transactionsPlace.length > 15
  1035. ) {
  1036. this.$message({
  1037. message: '交易所长度不符合要求,请输入2到15个字符之内!',
  1038. type: 'warning',
  1039. })
  1040. return
  1041. }
  1042. if (this.selectedOptions.length == 0) {
  1043. this.$message({
  1044. message: '请选择交货所在地区!',
  1045. type: 'warning',
  1046. })
  1047. return
  1048. }
  1049. if (!this.deptBudgetList.contractNumber) {
  1050. this.$message({
  1051. message: '请输入合约号!',
  1052. type: 'warning',
  1053. })
  1054. return
  1055. }
  1056. if (
  1057. this.deptBudgetList.contractNumber.length < 2 ||
  1058. this.deptBudgetList.contractNumber.length > 15
  1059. ) {
  1060. this.$message({
  1061. message: '合约号长度不符合要求,请输入2到15个字符之内!',
  1062. type: 'warning',
  1063. })
  1064. return
  1065. }
  1066. if (!this.deptBudgetList.placeDelivery) {
  1067. this.$message({
  1068. message: '请输入交货详细地址!',
  1069. type: 'warning',
  1070. })
  1071. return
  1072. }
  1073. if (!this.deptBudgetList.pointPrice) {
  1074. this.$message({
  1075. message: '请输入点价!',
  1076. type: 'warning',
  1077. })
  1078. return
  1079. }
  1080. if (
  1081. isNaN(this.deptBudgetList.pointPrice) ||
  1082. (String(this.deptBudgetList.pointPrice).indexOf('.') != -1 &&
  1083. String(this.deptBudgetList.pointPrice).length -
  1084. (String(this.deptBudgetList.pointPrice).indexOf('.') + 1) >
  1085. 3) ||
  1086. this.deptBudgetList.pointPrice < 0 ||
  1087. this.deptBudgetList.pointPrice > 100000
  1088. ) {
  1089. this.$message({
  1090. message: '输入点价有误!',
  1091. type: 'warning',
  1092. })
  1093. return
  1094. }
  1095. if (!this.deptBudgetList.signingDate) {
  1096. this.$message({
  1097. message: '请选择签订日期',
  1098. type: 'warning',
  1099. })
  1100. return
  1101. }
  1102. if (!this.deptBudgetList.pointPriceDate) {
  1103. this.$message({
  1104. message: '请选择点价日期',
  1105. type: 'warning',
  1106. })
  1107. return
  1108. }
  1109. if (!this.deptBudgetList.deliveryDateStart) {
  1110. this.$message({
  1111. message: '请选择交货日期(起)',
  1112. type: 'warning',
  1113. })
  1114. return
  1115. }
  1116. if (!this.deptBudgetList.deliveryDateEnd) {
  1117. this.$message({
  1118. message: '请选择交货日期(止)',
  1119. type: 'warning',
  1120. })
  1121. return
  1122. }
  1123. //时间
  1124. if (
  1125. new Date(this.deptBudgetList.deliveryDateStart).getTime() >
  1126. new Date(this.deptBudgetList.deliveryDateEnd).getTime()
  1127. ) {
  1128. this.$message({
  1129. message: '交货日期(止)选择错误',
  1130. type: 'warning',
  1131. })
  1132. return
  1133. }
  1134. //货物信息
  1135. if (this.selectedOptions1.length == 0) {
  1136. this.$message({
  1137. message: '请选择产地!',
  1138. type: 'warning',
  1139. })
  1140. return
  1141. }
  1142. if (!this.deptBudgetList.contractGoodsInfo.goodsName) {
  1143. this.$message({
  1144. message: '请选择货名',
  1145. type: 'warning',
  1146. })
  1147. return
  1148. }
  1149. if (!this.deptBudgetList.contractGoodsInfo.waterContent) {
  1150. this.$message({
  1151. message: '请输入水分',
  1152. type: 'warning',
  1153. })
  1154. return
  1155. }
  1156. if (
  1157. this.deptBudgetList.contractGoodsInfo.waterContent &&
  1158. String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') != -1 &&
  1159. String(this.deptBudgetList.contractGoodsInfo.waterContent).length -
  1160. (String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') + 1) >
  1161. 2||this.deptBudgetList.contractGoodsInfo.waterContent>40||this.deptBudgetList.contractGoodsInfo.waterContent<0
  1162. ) {
  1163. this.$message({
  1164. message: '水分输入错误',
  1165. type: 'warning',
  1166. })
  1167. return
  1168. }
  1169. if (!this.deptBudgetList.contractGoodsInfo.grade) {
  1170. this.$message({
  1171. message: '请选择品级',
  1172. type: 'warning',
  1173. })
  1174. return
  1175. }
  1176. if (!this.deptBudgetList.contractGoodsInfo.transgene) {
  1177. this.$message({
  1178. message: '请选择转基因',
  1179. type: 'warning',
  1180. })
  1181. return
  1182. }
  1183. if (!this.deptBudgetList.contractGoodsInfo.impurity) {
  1184. this.$message({
  1185. message: '请输入杂质',
  1186. type: 'warning',
  1187. })
  1188. return
  1189. }
  1190. if (
  1191. this.deptBudgetList.contractGoodsInfo.impurity &&
  1192. String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') != -1 &&
  1193. String(this.deptBudgetList.contractGoodsInfo.impurity).length -
  1194. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') + 1) >
  1195. 2||this.deptBudgetList.contractGoodsInfo.impurity>40||this.deptBudgetList.contractGoodsInfo.impurity<0
  1196. ) {
  1197. this.$message({
  1198. message: '杂质输入错误',
  1199. type: 'warning',
  1200. })
  1201. return
  1202. }
  1203. if (!this.deptBudgetList.contractGoodsInfo.bulkDensity) {
  1204. this.$message({
  1205. message: '请输入容重',
  1206. type: 'warning',
  1207. })
  1208. return
  1209. }
  1210. if (
  1211. (this.deptBudgetList.contractGoodsInfo.bulkDensity &&
  1212. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') != -1 &&
  1213. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
  1214. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') + 1) >
  1215. 2) || this.deptBudgetList.contractGoodsInfo.bulkDensity > 1000 || this.deptBudgetList.contractGoodsInfo.bulkDensity < 0
  1216. ) {
  1217. this.$message({
  1218. message: '容重输入错误',
  1219. type: 'warning',
  1220. })
  1221. return
  1222. }
  1223. if (!this.deptBudgetList.contractGoodsInfo.mildewGrain) {
  1224. this.$message({
  1225. message: '请输入霉变粒',
  1226. type: 'warning',
  1227. })
  1228. return
  1229. }
  1230. if (
  1231. !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
  1232. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1233. '.'
  1234. ) != -1 &&
  1235. String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
  1236. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1237. '.'
  1238. ) +
  1239. 1) >
  1240. 2||this.deptBudgetList.contractGoodsInfo.mildewGrain>40||this.deptBudgetList.contractGoodsInfo.mildewGrain<0)
  1241. ) {
  1242. this.$message({
  1243. message: '霉变粒输入错误',
  1244. type: 'warning',
  1245. })
  1246. return
  1247. }
  1248. if (!this.deptBudgetList.contractGoodsInfo.jiaorenli) {
  1249. this.$message({
  1250. message: '请输入热损伤',
  1251. type: 'warning',
  1252. })
  1253. return
  1254. }
  1255. if (
  1256. !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
  1257. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
  1258. -1 &&
  1259. String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
  1260. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
  1261. '.'
  1262. ) +
  1263. 1) >
  1264. 2||this.deptBudgetList.contractGoodsInfo.jiaorenli>40||this.deptBudgetList.contractGoodsInfo.jiaorenli<0)
  1265. ) {
  1266. this.$message({
  1267. message: '热损伤输入错误',
  1268. type: 'warning',
  1269. })
  1270. return
  1271. }
  1272. if (!this.deptBudgetList.contractGoodsInfo.imperfectGrain) {
  1273. this.$message({
  1274. message: '请输入不完善粒',
  1275. type: 'warning',
  1276. })
  1277. return
  1278. }
  1279. if (
  1280. !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
  1281. (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
  1282. '.'
  1283. ) != -1 &&
  1284. String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
  1285. (String(
  1286. this.deptBudgetList.contractGoodsInfo.imperfectGrain
  1287. ).indexOf('.') +
  1288. 1) >
  1289. 2||this.deptBudgetList.contractGoodsInfo.imperfectGrain>40||this.deptBudgetList.contractGoodsInfo.imperfectGrain<0)
  1290. ) {
  1291. this.$message({
  1292. message: '不完善粒输入错误',
  1293. type: 'warning',
  1294. })
  1295. return
  1296. }
  1297. if (!this.deptBudgetList.contractGoodsInfo.protein) {
  1298. this.$message({
  1299. message: '请输入蛋白',
  1300. type: 'warning',
  1301. })
  1302. return
  1303. }
  1304. if (
  1305. !this.deptBudgetList.contractGoodsInfo.protein ||
  1306. (String(this.deptBudgetList.contractGoodsInfo.protein).indexOf(
  1307. '.'
  1308. ) != -1 &&
  1309. String(this.deptBudgetList.contractGoodsInfo.protein).length -
  1310. (String(
  1311. this.deptBudgetList.contractGoodsInfo.protein
  1312. ).indexOf('.') +
  1313. 1) >
  1314. 2||this.deptBudgetList.contractGoodsInfo.protein>70||this.deptBudgetList.contractGoodsInfo.protein<0)
  1315. ) {
  1316. this.$message({
  1317. message: '蛋白输入错误',
  1318. type: 'warning',
  1319. })
  1320. return
  1321. }
  1322. if (
  1323. this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000 ||
  1324. this.deptBudgetList.contractProcessInfo.goodsNameKey < 0 ||
  1325. (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
  1326. '.'
  1327. ) != -1 &&
  1328. String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
  1329. (String(
  1330. this.deptBudgetList.contractProcessInfo.goodsNameKey
  1331. ).indexOf('.') +
  1332. 1) >
  1333. 2)
  1334. )
  1335. {
  1336. this.$message({
  1337. message: '合同收入金额输入错误',
  1338. type: 'warning',
  1339. })
  1340. return
  1341. }
  1342. if (
  1343. this.deptBudgetList.contractProcessInfo.waterContent > 10000000 ||
  1344. this.deptBudgetList.contractProcessInfo.waterContent < 0 ||
  1345. (String(this.deptBudgetList.contractProcessInfo.waterContent).indexOf(
  1346. '.'
  1347. ) != -1 &&
  1348. String(this.deptBudgetList.contractProcessInfo.waterContent).length -
  1349. (String(
  1350. this.deptBudgetList.contractProcessInfo.waterContent
  1351. ).indexOf('.') +
  1352. 1) >
  1353. 2)
  1354. ) {
  1355. this.$message({
  1356. message: '费用金额输入错误',
  1357. type: 'warning',
  1358. })
  1359. return
  1360. }
  1361. if (
  1362. this.deptBudgetList.contractProcessInfo.goodsName > 1000000000 ||
  1363. this.deptBudgetList.contractProcessInfo.goodsName < 0 ||
  1364. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1365. '.'
  1366. ) != -1 &&
  1367. String(this.deptBudgetList.contractProcessInfo.goodsName).length -
  1368. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1369. '.'
  1370. ) +
  1371. 1) >
  1372. 2)
  1373. ) {
  1374. this.$message({
  1375. message: '已开发票金额输入错误',
  1376. type: 'warning',
  1377. })
  1378. return
  1379. }
  1380. if (
  1381. this.deptBudgetList.contractProcessInfo.impurity > 1000000000 ||
  1382. this.deptBudgetList.contractProcessInfo.impurity < 0 ||
  1383. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1384. '.'
  1385. ) != -1 &&
  1386. String(this.deptBudgetList.contractProcessInfo.impurity).length -
  1387. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1388. '.'
  1389. ) +
  1390. 1) >
  1391. 2)
  1392. ) {
  1393. this.$message({
  1394. message: '未开发票金额输入错误',
  1395. type: 'warning',
  1396. })
  1397. return
  1398. }
  1399. if (
  1400. (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) ||
  1401. (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
  1402. (String(this.deptBudgetList.contractProcessInfo.mildewGrain).indexOf(
  1403. '.'
  1404. ) != -1 &&
  1405. String(this.deptBudgetList.contractProcessInfo.mildewGrain).length -
  1406. (String(
  1407. this.deptBudgetList.contractProcessInfo.mildewGrain
  1408. ).indexOf('.') +
  1409. 1) >
  1410. 2)
  1411. ) {
  1412. this.$message({
  1413. message: '未回款金额输入错误',
  1414. type: 'warning',
  1415. })
  1416. return
  1417. }
  1418. var that = this
  1419. this.$refs.deptBudgetList.validate((valid) => {
  1420. if (valid) {
  1421. this.deptBudgetList.contractGoodsInfo.outputPrivate = CodeToText[this.selectedOptions1[0]]
  1422. this.deptBudgetList.contractGoodsInfo.outputCity = CodeToText[this.selectedOptions1[1]]
  1423. this.deptBudgetList.deliveryProvince = CodeToText[this.selectedOptions[0]]
  1424. this.deptBudgetList.deliveryCity = CodeToText[this.selectedOptions[1]]
  1425. this.deptBudgetList.compId = this.compId
  1426. this.deptBudgetList.contractType = 1
  1427. this.deptBudgetList.goodsType = 2
  1428. if(this.deptBudgetList.deliveryProvince =="澳门特别行政区" || this.deptBudgetList.deliveryProvince == "澳门特别行政区"){
  1429. this.deptBudgetList.deliveryArea = "特别行政区"
  1430. }else{
  1431. this.deptBudgetList.deliveryArea = CodeToText[this.selectedOptions[2]]
  1432. }
  1433. addList(this.deptBudgetList)
  1434. .toPromise()
  1435. .then((response) => {
  1436. this.$message.success('添加成功')
  1437. this.deptBudgetList = {
  1438. deliverType: '1',
  1439. finalTradingVolume: 0,
  1440. contractGoodsInfo: {
  1441. goodsName: '',
  1442. },
  1443. contractProcessInfo: {},
  1444. }
  1445. this.$router.push({ path: 'futuresSalesContract' })
  1446. })
  1447. .catch((req) => {
  1448. EventBus.$emit('error', req.message)
  1449. })
  1450. } else {
  1451. // for (let key in that.rules) {
  1452. // EventBus.$emit('error', that.rules[key][0].message)
  1453. // return false
  1454. // }
  1455. return false
  1456. }
  1457. })
  1458. },
  1459. resetForm(deptBudgetList) {
  1460. this.$refs[deptBudgetList].resetFields()
  1461. },
  1462. addClick() {
  1463. this.unitList.push({
  1464. flag: 'add',
  1465. constValue: '',
  1466. constKey: '',
  1467. })
  1468. },
  1469. saveClick(item, index) {
  1470. if (Object.is(item.id, 1)) {
  1471. return
  1472. }
  1473. if (Object.is(this.unitList[index].flag, 'delete')) {
  1474. this.$set(this.unitList, index, { flag: 'check' })
  1475. } else {
  1476. this.$set(this.unitList, index, { flag: 'delete' })
  1477. }
  1478. if (!item.constValue) {
  1479. this.unitList.splice(index, 1)
  1480. return
  1481. }
  1482. if (item.flag == 'add') {
  1483. item.constKey = Math.random() * 20
  1484. this.acceptanceCheck.compId = this.compId
  1485. this.acceptanceCheck.constKey = item.constKey
  1486. this.acceptanceCheck.constCode = 'TYPEYAN'
  1487. this.acceptanceCheck.constValue = item.constValue
  1488. this.acceptanceCheck.id = item.id
  1489. addxiala(this.acceptanceCheck)
  1490. .toPromise()
  1491. .then((response) => {
  1492. this.getUnitList()
  1493. })
  1494. } else if (item.flag == 'check') {
  1495. this.acceptanceCheck.compId = this.compId
  1496. this.acceptanceCheck.constKey = item.constKey
  1497. this.acceptanceCheck.constCode = 'TYPEYAN'
  1498. this.acceptanceCheck.constValue = item.constValue
  1499. this.acceptanceCheck.id = item.id
  1500. editxiala(this.acceptanceCheck)
  1501. .toPromise()
  1502. .then((response) => {
  1503. this.getUnitList()
  1504. })
  1505. }
  1506. },
  1507. selectChapterTwo(e) {
  1508. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  1509. if (this.ChapterTwoList[i].constValue == e) {
  1510. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  1511. }
  1512. }
  1513. },
  1514. selectunitList(e) {
  1515. for (var i = 0; i < this.unitList.length; i++) {
  1516. if (this.unitList[i].constValue == e) {
  1517. this.deptBudgetList.acceptanceMethodKey = this.unitList[i].constKey
  1518. }
  1519. }
  1520. },
  1521. selectgrade(e) {
  1522. for (var i = 0; i < this.gradeList.length; i++) {
  1523. if (this.gradeList[i].constValue == e) {
  1524. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  1525. }
  1526. }
  1527. },
  1528. selecttransgene(e) {
  1529. for (var i = 0; i < this.transgeneList.length; i++) {
  1530. if (this.transgeneList[i].constValue == e) {
  1531. this.deptBudgetList.gradeKey = this.transgeneList[i].constKey
  1532. }
  1533. }
  1534. },
  1535. selectgoodsName(e) {
  1536. for (var i = 0; i < this.goodnameList.length; i++) {
  1537. if (this.goodnameList[i].constValue == e) {
  1538. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  1539. }
  1540. }
  1541. },
  1542. selectwarehouseName() {},
  1543. selectpackingMethod(e) {
  1544. for (var i = 0; i < this.packtypeList.length; i++) {
  1545. if (this.packtypeList[i].constValue == e) {
  1546. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  1547. }
  1548. }
  1549. },
  1550. // 编辑
  1551. editClick(item, index) {
  1552. const map = JSON.parse(JSON.stringify(item))
  1553. if (Object.is(item.id, 1)) {
  1554. return
  1555. }
  1556. if (Object.is(this.unitList[index].flag, 'delete')) {
  1557. map.flag = 'check'
  1558. this.$set(this.unitList, index, map)
  1559. } else {
  1560. map.flag = 'delete'
  1561. this.$set(this.unitList, index, map)
  1562. }
  1563. },
  1564. // 删除
  1565. deleteClick(item, index) {
  1566. if (Object.is(item.constKey, 1)) {
  1567. return
  1568. }
  1569. if (!item.constValue) {
  1570. this.unitList.splice(index, 1)
  1571. return
  1572. }
  1573. delxiala({ id: this.unitList[index].id })
  1574. .toPromise()
  1575. .then((response) => {
  1576. this.getUnitList()
  1577. this.pleaseChoose = ''
  1578. })
  1579. },
  1580. },
  1581. }
  1582. </script>
  1583. <style lang="scss" scoped>
  1584. .el-form {
  1585. padding: 0 15%;
  1586. }
  1587. /deep/.ws-info-table .el-form-item {
  1588. border-right: 1px solid #cdd2dc;
  1589. border-bottom: 1px solid #cdd2dc;
  1590. }
  1591. .readonly {
  1592. position: relative;
  1593. }
  1594. .upload-demo{
  1595. margin-top: 10px;
  1596. }
  1597. .readonly:after {
  1598. content: '*';
  1599. color: #ff2727;
  1600. position: absolute;
  1601. right: 8px;
  1602. z-index: 10;
  1603. top: 21%;
  1604. font-size: 20px;
  1605. }
  1606. .title {
  1607. position: relative;
  1608. }
  1609. .title::before {
  1610. content: '';
  1611. display: inline-block;
  1612. width: 5px;
  1613. height: 30px;
  1614. background: #5473e8;
  1615. position: absolute;
  1616. left: 0;
  1617. }
  1618. .el-button--primary {
  1619. background-color: #5878e8;
  1620. border-color: #5878e8;
  1621. }
  1622. .el-col {
  1623. background: #f6f7fc;
  1624. }
  1625. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1626. padding: 0 25px;
  1627. border-left: 1px solid #cdd2dc;
  1628. background: #fafbfc;
  1629. }
  1630. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1631. width: 140px;
  1632. text-align: center;
  1633. background: #f0f2f6;
  1634. // border: 1px solid #cdd2dc;
  1635. }
  1636. .button-container {
  1637. display: flex;
  1638. flex-wrap: nowrap;
  1639. justify-content: space-between;
  1640. align-items: center;
  1641. background-color: #fff;
  1642. width: 100%;
  1643. height: 50px;
  1644. padding: 0 10px;
  1645. & > div {
  1646. margin-left: 10px;
  1647. display: flex;
  1648. flex-wrap: nowrap;
  1649. flex-direction: row;
  1650. & > span {
  1651. line-height: 50px;
  1652. }
  1653. }
  1654. /deep/.auditFlow-box {
  1655. position: unset;
  1656. margin-left: 10px;
  1657. &/deep/.auditFlow-icon {
  1658. width: auto;
  1659. padding-right: 30px;
  1660. }
  1661. &/deep/.auditFlow-main {
  1662. position: absolute;
  1663. }
  1664. }
  1665. }
  1666. .box-app {
  1667. display: inline-block;
  1668. float: left;
  1669. margin-left: 30px;
  1670. line-height: 50px;
  1671. }
  1672. /deep/.el-dialog {
  1673. .el-form-item {
  1674. margin-bottom: 0 !important;
  1675. .el-input--medium {
  1676. textarea {
  1677. min-height: 100px !important;
  1678. }
  1679. }
  1680. }
  1681. }
  1682. .collapse-bottom {
  1683. margin-bottom: 20px;
  1684. }
  1685. .input-main .textarea .el-textarea__inner {
  1686. width: 100%;
  1687. z-index: 1;
  1688. }
  1689. .bg-left {
  1690. padding-left: 30px;
  1691. }
  1692. .bg-right {
  1693. padding-right: 10px;
  1694. text-align: right;
  1695. }
  1696. .bg-bottom {
  1697. margin: 15px 0px;
  1698. }
  1699. .wenzi h3 {
  1700. display: inline-block;
  1701. left: 10px;
  1702. }
  1703. .wenzi p {
  1704. display: inline-block;
  1705. }
  1706. .center {
  1707. width: 70%;
  1708. margin: 0 auto;
  1709. }
  1710. .el-form-item {
  1711. width: 50%;
  1712. }
  1713. .el-form-item__label {
  1714. text-align: center;
  1715. }
  1716. .ce {
  1717. width: 900px;
  1718. margin: 0 auto;
  1719. }
  1720. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  1721. /* height: 82px;*/
  1722. /*}*/
  1723. // 控制select为只读的时候显示样式
  1724. .hide-sel {
  1725. .el-input__inner {
  1726. border: 0px;
  1727. }
  1728. .el-icon-arrow-up {
  1729. display: none;
  1730. }
  1731. .el-textarea__inner {
  1732. background-color: #fff !important;
  1733. border: 0;
  1734. }
  1735. .el-date-editor {
  1736. i {
  1737. display: none;
  1738. }
  1739. }
  1740. .is-disabled {
  1741. .el-input__inner:hover {
  1742. background-color: #fff !important;
  1743. border: 0;
  1744. }
  1745. color: #606266;
  1746. .el-input__inner {
  1747. background-color: #fff !important;
  1748. border: 0;
  1749. color: #606266;
  1750. }
  1751. .el-textarea__inner {
  1752. background-color: #fff !important;
  1753. border: 0;
  1754. color: #606266;
  1755. }
  1756. }
  1757. }
  1758. // 控制select为只读的时候显示样式
  1759. /deep/.ws-class-table-col {
  1760. height: auto;
  1761. padding: 0px 2px;
  1762. /deep/.el-input__inner {
  1763. padding: 0px 2px;
  1764. }
  1765. }
  1766. /deep/.is-disabled {
  1767. .el-input__prefix,
  1768. .el-input__suffix {
  1769. display: none;
  1770. }
  1771. .el-input__inner {
  1772. background-color: #fff;
  1773. border-color: #fff !important;
  1774. color: #000 !important;
  1775. font-size: 14px;
  1776. cursor: text;
  1777. padding: 0 !important;
  1778. }
  1779. }
  1780. .winseaview-view {
  1781. padding: 0 0 20px;
  1782. }
  1783. .container {
  1784. overflow: scroll;
  1785. height: 93vh;
  1786. }
  1787. /deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
  1788. width: 130px;
  1789. }
  1790. .el-textarea {
  1791. width: 101%;
  1792. }
  1793. .addressUrls {
  1794. width: 100%;
  1795. display: flex;
  1796. margin-top: 10px;
  1797. }
  1798. .addressUrls-item {
  1799. position: relative;
  1800. display: flex;
  1801. }
  1802. .icon-guanbi {
  1803. position: absolute;
  1804. right: 8px;
  1805. }
  1806. .addressUrl {
  1807. margin: 0px 10px;
  1808. border-radius: 3px;
  1809. }
  1810. //上传文件成功标识
  1811. /deep/.el-upload-list__item-status-label {
  1812. position: absolute;
  1813. right: 22px;
  1814. top: -1px;
  1815. line-height: inherit;
  1816. display: none;
  1817. }
  1818. </style>