futuresSalesContractAdd.vue 54 KB

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