futuresPurchaseContractAdd.vue 56 KB

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