futuresPurchaseContractAdd.vue 54 KB

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