futuresPurchaseContractAdd.vue 55 KB

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