futuresPurchaseContractAdd.vue 55 KB

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