futuresPurchaseContractAdd.vue 56 KB

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