futuresSalesContractAdd.vue 54 KB

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