futuresPurchaseContractAdd.vue 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779
  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.seller) {
  891. this.$message({
  892. message: '请输入卖方名称!',
  893. type: 'warning',
  894. })
  895. return
  896. }
  897. if (this.deptBudgetList.seller.length > 30) {
  898. this.$message({
  899. message: '卖方名称长度不符合要求,请输入30个字符之内!',
  900. type: 'warning',
  901. })
  902. return
  903. }
  904. if (!this.deptBudgetList.buyerPhone) {
  905. this.$message({
  906. message: '请输入买方电话!',
  907. type: 'warning',
  908. })
  909. return
  910. }
  911. if (isNaN(this.deptBudgetList.buyerPhone)) {
  912. this.$message({
  913. message: '输入买方电话有误!',
  914. type: 'warning',
  915. })
  916. return
  917. }
  918. if (
  919. this.deptBudgetList.buyerPhone.length < 7 ||
  920. this.deptBudgetList.buyerPhone.length > 20
  921. ) {
  922. this.$message({
  923. message: '买方电话长度不符合要求,请输入7到20个字符之内!',
  924. type: 'warning',
  925. })
  926. return
  927. }
  928. if (!this.deptBudgetList.sellerPhone) {
  929. this.$message({
  930. message: '请输入卖方电话!',
  931. type: 'warning',
  932. })
  933. return
  934. }
  935. if (isNaN(this.deptBudgetList.sellerPhone)) {
  936. this.$message({
  937. message: '输入卖方电话有误!',
  938. type: 'warning',
  939. })
  940. return
  941. }
  942. if (
  943. this.deptBudgetList.buyerPhone.length < 7 ||
  944. this.deptBudgetList.buyerPhone.length > 20
  945. ) {
  946. this.$message({
  947. message: '卖方电话长度不符合要求,请输入7到20个字符之内!',
  948. type: 'warning',
  949. })
  950. return
  951. }
  952. if (!this.deptBudgetList.weight) {
  953. this.$message({
  954. message: '请输入交易数量!',
  955. type: 'warning',
  956. })
  957. return
  958. }
  959. if (
  960. isNaN(this.deptBudgetList.weight) ||
  961. (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
  962. String(this.deptBudgetList.weight).length -
  963. (String(this.deptBudgetList.weight).indexOf('.') + 1) >
  964. 3) ||
  965. this.deptBudgetList.weight < 0 ||
  966. this.deptBudgetList.weight > 200000
  967. ) {
  968. this.$message({
  969. message: '输入交易数量有误!',
  970. type: 'warning',
  971. })
  972. return
  973. }
  974. if (!this.deptBudgetList.basisPrice) {
  975. this.$message({
  976. message: '请输入基差!',
  977. type: 'warning',
  978. })
  979. return
  980. }
  981. if (
  982. isNaN(this.deptBudgetList.basisPrice) ||
  983. (String(this.deptBudgetList.basisPrice).indexOf('.') != -1 &&
  984. String(this.deptBudgetList.basisPrice).length -
  985. (String(this.deptBudgetList.basisPrice).indexOf('.') + 1) >
  986. 3) ||
  987. this.deptBudgetList.basisPrice < 0 ||
  988. this.deptBudgetList.basisPrice > 10000
  989. ) {
  990. this.$message({
  991. message: '基差输入错误!',
  992. type: 'warning',
  993. })
  994. return
  995. }
  996. if (!this.deptBudgetList.transactionsPlace) {
  997. this.$message({
  998. message: '请输入交易所!',
  999. type: 'warning',
  1000. })
  1001. return
  1002. }
  1003. if (
  1004. this.deptBudgetList.transactionsPlace.length < 2 ||
  1005. this.deptBudgetList.transactionsPlace.length > 15
  1006. ) {
  1007. this.$message({
  1008. message: '交易所长度不符合要求,请输入2到15个字符之内!',
  1009. type: 'warning',
  1010. })
  1011. return
  1012. }
  1013. if (!this.deptBudgetList.contractNumber) {
  1014. this.$message({
  1015. message: '请输入合约号!',
  1016. type: 'warning',
  1017. })
  1018. return
  1019. }
  1020. if (
  1021. this.deptBudgetList.contractNumber.length < 2 ||
  1022. this.deptBudgetList.contractNumber.length > 15
  1023. ) {
  1024. this.$message({
  1025. message: '合约号长度不符合要求,请输入2到15个字符之内!',
  1026. type: 'warning',
  1027. })
  1028. return
  1029. }
  1030. if (!this.deptBudgetList.pointPrice) {
  1031. this.$message({
  1032. message: '请输入点价!',
  1033. type: 'warning',
  1034. })
  1035. return
  1036. }
  1037. if (
  1038. isNaN(this.deptBudgetList.pointPrice) ||
  1039. (String(this.deptBudgetList.pointPrice).indexOf('.') != -1 &&
  1040. String(this.deptBudgetList.pointPrice).length -
  1041. (String(this.deptBudgetList.pointPrice).indexOf('.') + 1) >
  1042. 3) ||
  1043. this.deptBudgetList.pointPrice < 0 ||
  1044. this.deptBudgetList.pointPrice > 100000
  1045. ) {
  1046. this.$message({
  1047. message: '输入点价有误!',
  1048. type: 'warning',
  1049. })
  1050. return
  1051. }
  1052. if (!this.deptBudgetList.warehousingFee) {
  1053. this.$message({
  1054. message: '请输入入库费!',
  1055. type: 'warning',
  1056. })
  1057. return
  1058. }
  1059. if (
  1060. isNaN(this.deptBudgetList.warehousingFee) ||
  1061. (String(this.deptBudgetList.warehousingFee).indexOf('.') != -1 &&
  1062. String(this.deptBudgetList.warehousingFee).length -
  1063. (String(this.deptBudgetList.warehousingFee).indexOf('.') + 1) >
  1064. 3) ||
  1065. this.deptBudgetList.warehousingFee < 0 ||
  1066. this.deptBudgetList.warehousingFee > 1000
  1067. ) {
  1068. this.$message({
  1069. message: '入库费输入错误!',
  1070. type: 'warning',
  1071. })
  1072. return
  1073. }
  1074. if (!this.deptBudgetList.measurementStandard) {
  1075. this.$message({
  1076. message: '请输入计量标准!',
  1077. type: 'warning',
  1078. })
  1079. return
  1080. }
  1081. if (
  1082. this.deptBudgetList.measurementStandard.length < 1 ||
  1083. this.deptBudgetList.measurementStandard.length > 20
  1084. ) {
  1085. this.$message({
  1086. message: '计量标准长度不符合要求,请输入1到20个字符之内!',
  1087. type: 'warning',
  1088. })
  1089. return
  1090. }
  1091. if (!this.deptBudgetList.settlementMethod) {
  1092. this.$message({
  1093. message: '请输入结算方式!',
  1094. type: 'warning',
  1095. })
  1096. return
  1097. }
  1098. if (!this.deptBudgetList.placeDelivery) {
  1099. this.$message({
  1100. message: '请输入交货详细地址!',
  1101. type: 'warning',
  1102. })
  1103. return
  1104. }
  1105. if (this.selectedOptions1.length == 0) {
  1106. this.$message({
  1107. message: '请选择交货所在地区!',
  1108. type: 'warning',
  1109. })
  1110. return
  1111. }
  1112. if (!this.deptBudgetList.deliveryDateStart) {
  1113. this.$message({
  1114. message: '请选择交货日期(起)',
  1115. type: 'warning',
  1116. })
  1117. return
  1118. }
  1119. if (!this.deptBudgetList.deliveryDateEnd) {
  1120. this.$message({
  1121. message: '请选择交货日期(止)',
  1122. type: 'warning',
  1123. })
  1124. return
  1125. }
  1126. //时间
  1127. if (
  1128. new Date(this.deptBudgetList.deliveryDateStart).getTime() >
  1129. new Date(this.deptBudgetList.deliveryDateEnd).getTime()
  1130. ) {
  1131. this.$message({
  1132. message: '交货日期(止)选择错误',
  1133. type: 'warning',
  1134. })
  1135. return
  1136. }
  1137. if (!this.deptBudgetList.signingDate) {
  1138. this.$message({
  1139. message: '请选择签订日期',
  1140. type: 'warning',
  1141. })
  1142. return
  1143. }
  1144. if (!this.deptBudgetList.contractGoodsInfo.goodsName) {
  1145. this.$message({
  1146. message: '请选择货名',
  1147. type: 'warning',
  1148. })
  1149. return
  1150. }
  1151. if (!this.deptBudgetList.contractGoodsInfo.waterContent) {
  1152. this.$message({
  1153. message: '请输入水分',
  1154. type: 'warning',
  1155. })
  1156. return
  1157. }
  1158. if (!this.deptBudgetList.contractGoodsInfo.grade) {
  1159. this.$message({
  1160. message: '请选择品级',
  1161. type: 'warning',
  1162. })
  1163. return
  1164. }
  1165. if (
  1166. !this.deptBudgetList.contractGoodsInfo.impurity ||
  1167. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') !=
  1168. -1 &&
  1169. String(this.deptBudgetList.contractGoodsInfo.impurity).length -
  1170. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf(
  1171. '.'
  1172. ) +
  1173. 1) >
  1174. 2)
  1175. ) {
  1176. this.$message({
  1177. message: '杂质输入错误',
  1178. type: 'warning',
  1179. })
  1180. return
  1181. }
  1182. if (
  1183. !this.deptBudgetList.contractGoodsInfo.bulkDensity ||
  1184. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
  1185. '.'
  1186. ) != -1 &&
  1187. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
  1188. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
  1189. '.'
  1190. ) +
  1191. 1) >
  1192. 2)
  1193. ) {
  1194. this.$message({
  1195. message: '容重输入错误',
  1196. type: 'warning',
  1197. })
  1198. return
  1199. }
  1200. if (
  1201. !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
  1202. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1203. '.'
  1204. ) != -1 &&
  1205. String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
  1206. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1207. '.'
  1208. ) +
  1209. 1) >
  1210. 2)
  1211. ) {
  1212. this.$message({
  1213. message: '霉变粒输入错误',
  1214. type: 'warning',
  1215. })
  1216. return
  1217. }
  1218. if (
  1219. !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
  1220. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
  1221. -1 &&
  1222. String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
  1223. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
  1224. '.'
  1225. ) +
  1226. 1) >
  1227. 2)
  1228. ) {
  1229. this.$message({
  1230. message: '热损伤输入错误',
  1231. type: 'warning',
  1232. })
  1233. return
  1234. }
  1235. if (
  1236. !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
  1237. (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
  1238. '.'
  1239. ) != -1 &&
  1240. String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
  1241. (String(
  1242. this.deptBudgetList.contractGoodsInfo.imperfectGrain
  1243. ).indexOf('.') +
  1244. 1) >
  1245. 2)
  1246. ) {
  1247. this.$message({
  1248. message: '不完整粒输入错误',
  1249. type: 'warning',
  1250. })
  1251. return
  1252. }
  1253. if (
  1254. !this.deptBudgetList.contractGoodsInfo.protein ||
  1255. (String(this.deptBudgetList.contractGoodsInfo.protein).indexOf(
  1256. '.'
  1257. ) != -1 &&
  1258. String(this.deptBudgetList.contractGoodsInfo.protein).length -
  1259. (String(
  1260. this.deptBudgetList.contractGoodsInfo.protein
  1261. ).indexOf('.') +
  1262. 1) >
  1263. 2)
  1264. ) {
  1265. this.$message({
  1266. message: '蛋白输入错误',
  1267. type: 'warning',
  1268. })
  1269. return
  1270. }
  1271. if (
  1272. this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000 ||
  1273. this.deptBudgetList.contractProcessInfo.goodsNameKey < 0 ||
  1274. (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
  1275. '.'
  1276. ) != -1 &&
  1277. String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
  1278. (String(
  1279. this.deptBudgetList.contractProcessInfo.goodsNameKey
  1280. ).indexOf('.') +
  1281. 1) >
  1282. 2)
  1283. ) {
  1284. this.$message({
  1285. message: '合同收入金额输入错误',
  1286. type: 'warning',
  1287. })
  1288. return
  1289. }
  1290. if (
  1291. this.deptBudgetList.contractProcessInfo.waterContent > 10000000 ||
  1292. this.deptBudgetList.contractProcessInfo.waterContent < 0 ||
  1293. (String(this.deptBudgetList.contractProcessInfo.waterContent).indexOf(
  1294. '.'
  1295. ) != -1 &&
  1296. String(this.deptBudgetList.contractProcessInfo.waterContent).length -
  1297. (String(
  1298. this.deptBudgetList.contractProcessInfo.waterContent
  1299. ).indexOf('.') +
  1300. 1) >
  1301. 2)
  1302. ) {
  1303. this.$message({
  1304. message: '费用金额输入错误',
  1305. type: 'warning',
  1306. })
  1307. return
  1308. }
  1309. if (
  1310. this.deptBudgetList.contractProcessInfo.goodsName > 1000000000 ||
  1311. this.deptBudgetList.contractProcessInfo.goodsName < 0 ||
  1312. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1313. '.'
  1314. ) != -1 &&
  1315. String(this.deptBudgetList.contractProcessInfo.goodsName).length -
  1316. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1317. '.'
  1318. ) +
  1319. 1) >
  1320. 2)
  1321. ) {
  1322. this.$message({
  1323. message: '已开发票金额输入错误',
  1324. type: 'warning',
  1325. })
  1326. return
  1327. }
  1328. if (
  1329. this.deptBudgetList.contractProcessInfo.impurity > 1000000000 ||
  1330. this.deptBudgetList.contractProcessInfo.impurity < 0 ||
  1331. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1332. '.'
  1333. ) != -1 &&
  1334. String(this.deptBudgetList.contractProcessInfo.impurity).length -
  1335. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1336. '.'
  1337. ) +
  1338. 1) >
  1339. 2)
  1340. ) {
  1341. this.$message({
  1342. message: '未开发票金额输入错误',
  1343. type: 'warning',
  1344. })
  1345. return
  1346. }
  1347. var that = this
  1348. this.$refs.deptBudgetList.validate((valid) => {
  1349. if (valid) {
  1350. this.deptBudgetList.contractGoodsInfo.outputPrivate = CodeToText[this.selectedOptions1[0]]
  1351. this.deptBudgetList.contractGoodsInfo.outputCity = CodeToText[this.selectedOptions1[1]]
  1352. this.deptBudgetList.deliveryProvince = CodeToText[this.selectedOptions[0]]
  1353. this.deptBudgetList.deliveryCity = CodeToText[this.selectedOptions[1]]
  1354. this.deptBudgetList.compId = this.compId
  1355. this.deptBudgetList.contractType = 2
  1356. this.deptBudgetList.goodsType = 2
  1357. if(this.deptBudgetList.deliveryProvince =="澳门特别行政区" || this.deptBudgetList.deliveryProvince == "澳门特别行政区"){
  1358. this.deptBudgetList.deliveryArea = "特别行政区"
  1359. }else{
  1360. this.deptBudgetList.deliveryArea = CodeToText[this.selectedOptions[2]]
  1361. }
  1362. this.deptBudgetList.addressUrl = this.addressUrls.toString()
  1363. addList(this.deptBudgetList)
  1364. .toPromise()
  1365. .then((response) => {
  1366. this.$message.success('添加成功')
  1367. this.deptBudgetList = {
  1368. deliverType: '1',
  1369. finalTradingVolume: 0,
  1370. contractGoodsInfo: {
  1371. goodsName: '',
  1372. },
  1373. contractProcessInfo: {},
  1374. }
  1375. this.$router.push({ path: 'futuresPurchaseContract' })
  1376. })
  1377. .catch((req) => {
  1378. EventBus.$emit('error', req.message)
  1379. })
  1380. } else {
  1381. // for (let key in that.rules) {
  1382. // EventBus.$emit('error', that.rules[key][0].message)
  1383. // return false
  1384. // }
  1385. return false
  1386. }
  1387. })
  1388. },
  1389. resetForm(deptBudgetList) {
  1390. this.$refs[deptBudgetList].resetFields()
  1391. },
  1392. addClick() {
  1393. this.unitList.push({
  1394. flag: 'add',
  1395. constValue: '',
  1396. constKey: '',
  1397. })
  1398. },
  1399. saveClick(item, index) {
  1400. if (Object.is(item.id, 1)) {
  1401. return
  1402. }
  1403. if (Object.is(this.unitList[index].flag, 'delete')) {
  1404. this.$set(this.unitList, index, { flag: 'check' })
  1405. } else {
  1406. this.$set(this.unitList, index, { flag: 'delete' })
  1407. }
  1408. if (!item.constValue) {
  1409. this.unitList.splice(index, 1)
  1410. return
  1411. }
  1412. if (item.flag == 'add') {
  1413. item.constKey = Math.random() * 20
  1414. this.acceptanceCheck.compId = this.compId
  1415. this.acceptanceCheck.constKey = item.constKey
  1416. this.acceptanceCheck.constCode = 'TYPEYAN'
  1417. this.acceptanceCheck.constValue = item.constValue
  1418. this.acceptanceCheck.id = item.id
  1419. addxiala(this.acceptanceCheck)
  1420. .toPromise()
  1421. .then((response) => {
  1422. this.getUnitList()
  1423. })
  1424. } else if (item.flag == 'check') {
  1425. this.acceptanceCheck.compId = this.compId
  1426. this.acceptanceCheck.constKey = item.constKey
  1427. this.acceptanceCheck.constCode = 'TYPEYAN'
  1428. this.acceptanceCheck.constValue = item.constValue
  1429. this.acceptanceCheck.id = item.id
  1430. editxiala(this.acceptanceCheck)
  1431. .toPromise()
  1432. .then((response) => {
  1433. this.getUnitList()
  1434. })
  1435. }
  1436. },
  1437. selectChapterTwo(e) {
  1438. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  1439. if (this.ChapterTwoList[i].constValue == e) {
  1440. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  1441. }
  1442. }
  1443. },
  1444. selectunitList(e) {
  1445. for (var i = 0; i < this.unitList.length; i++) {
  1446. if (this.unitList[i].constValue == e) {
  1447. this.deptBudgetList.acceptanceMethodKey = this.unitList[i].constKey
  1448. }
  1449. }
  1450. },
  1451. selectgrade(e) {
  1452. for (var i = 0; i < this.gradeList.length; i++) {
  1453. if (this.gradeList[i].constValue == e) {
  1454. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  1455. }
  1456. }
  1457. },
  1458. selecttransgene(e) {
  1459. for (var i = 0; i < this.transgeneList.length; i++) {
  1460. if (this.transgeneList[i].constValue == e) {
  1461. this.deptBudgetList.gradeKey = this.transgeneList[i].constKey
  1462. }
  1463. }
  1464. },
  1465. selectgoodsName(e) {
  1466. for (var i = 0; i < this.goodnameList.length; i++) {
  1467. if (this.goodnameList[i].constValue == e) {
  1468. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  1469. }
  1470. }
  1471. },
  1472. selectwarehouseName() {},
  1473. selectpackingMethod(e) {
  1474. for (var i = 0; i < this.packtypeList.length; i++) {
  1475. if (this.packtypeList[i].constValue == e) {
  1476. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  1477. }
  1478. }
  1479. },
  1480. // 编辑
  1481. editClick(item, index) {
  1482. const map = JSON.parse(JSON.stringify(item))
  1483. if (Object.is(item.id, 1)) {
  1484. return
  1485. }
  1486. if (Object.is(this.unitList[index].flag, 'delete')) {
  1487. map.flag = 'check'
  1488. this.$set(this.unitList, index, map)
  1489. } else {
  1490. map.flag = 'delete'
  1491. this.$set(this.unitList, index, map)
  1492. }
  1493. },
  1494. // 删除
  1495. deleteClick(item, index) {
  1496. if (Object.is(item.constKey, 1)) {
  1497. return
  1498. }
  1499. if (!item.constValue) {
  1500. this.unitList.splice(index, 1)
  1501. return
  1502. }
  1503. delxiala({ id: this.unitList[index].id })
  1504. .toPromise()
  1505. .then((response) => {
  1506. this.getUnitList()
  1507. this.pleaseChoose = ''
  1508. })
  1509. },
  1510. },
  1511. }
  1512. </script>
  1513. <style lang="scss" scoped>
  1514. .el-form {
  1515. padding: 0 15%;
  1516. }
  1517. /deep/.ws-info-table .el-form-item {
  1518. border-right: 1px solid #cdd2dc;
  1519. border-bottom: 1px solid #cdd2dc;
  1520. }
  1521. .readonly {
  1522. position: relative;
  1523. }
  1524. .readonly:after {
  1525. content: '*';
  1526. color: #ff2727;
  1527. position: absolute;
  1528. right: 8px;
  1529. z-index: 10;
  1530. top: 21%;
  1531. font-size: 20px;
  1532. }
  1533. .title {
  1534. position: relative;
  1535. }
  1536. .title::before {
  1537. content: '';
  1538. display: inline-block;
  1539. width: 5px;
  1540. height: 30px;
  1541. background: #5473e8;
  1542. position: absolute;
  1543. left: 0;
  1544. }
  1545. .el-button--primary {
  1546. background-color: #5878e8;
  1547. border-color: #5878e8;
  1548. }
  1549. .el-col {
  1550. background: #f6f7fc;
  1551. }
  1552. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1553. padding: 0 25px;
  1554. border-left: 1px solid #cdd2dc;
  1555. background: #fafbfc;
  1556. }
  1557. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1558. width: 140px;
  1559. text-align: center;
  1560. background: #f0f2f6;
  1561. // border: 1px solid #cdd2dc;
  1562. }
  1563. .button-container {
  1564. display: flex;
  1565. flex-wrap: nowrap;
  1566. justify-content: space-between;
  1567. align-items: center;
  1568. background-color: #fff;
  1569. width: 100%;
  1570. height: 50px;
  1571. padding: 0 10px;
  1572. & > div {
  1573. margin-left: 10px;
  1574. display: flex;
  1575. flex-wrap: nowrap;
  1576. flex-direction: row;
  1577. & > span {
  1578. line-height: 50px;
  1579. }
  1580. }
  1581. /deep/.auditFlow-box {
  1582. position: unset;
  1583. margin-left: 10px;
  1584. &/deep/.auditFlow-icon {
  1585. width: auto;
  1586. padding-right: 30px;
  1587. }
  1588. &/deep/.auditFlow-main {
  1589. position: absolute;
  1590. }
  1591. }
  1592. }
  1593. .box-app {
  1594. display: inline-block;
  1595. float: left;
  1596. margin-left: 30px;
  1597. line-height: 50px;
  1598. }
  1599. /deep/.el-dialog {
  1600. .el-form-item {
  1601. margin-bottom: 0 !important;
  1602. .el-input--medium {
  1603. textarea {
  1604. min-height: 100px !important;
  1605. }
  1606. }
  1607. }
  1608. }
  1609. .collapse-bottom {
  1610. margin-bottom: 20px;
  1611. }
  1612. .input-main .textarea .el-textarea__inner {
  1613. width: 100%;
  1614. z-index: 1;
  1615. }
  1616. .bg-left {
  1617. padding-left: 30px;
  1618. }
  1619. .bg-right {
  1620. padding-right: 10px;
  1621. text-align: right;
  1622. }
  1623. .bg-bottom {
  1624. margin: 15px 0px;
  1625. }
  1626. .wenzi h3 {
  1627. display: inline-block;
  1628. left: 10px;
  1629. }
  1630. .wenzi p {
  1631. display: inline-block;
  1632. }
  1633. .center {
  1634. width: 70%;
  1635. margin: 0 auto;
  1636. }
  1637. .el-form-item {
  1638. width: 50%;
  1639. }
  1640. .el-form-item__label {
  1641. text-align: center;
  1642. }
  1643. .ce {
  1644. width: 900px;
  1645. margin: 0 auto;
  1646. }
  1647. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  1648. /* height: 82px;*/
  1649. /*}*/
  1650. // 控制select为只读的时候显示样式
  1651. .hide-sel {
  1652. .el-input__inner {
  1653. border: 0px;
  1654. }
  1655. .el-icon-arrow-up {
  1656. display: none;
  1657. }
  1658. .el-textarea__inner {
  1659. background-color: #fff !important;
  1660. border: 0;
  1661. }
  1662. .el-date-editor {
  1663. i {
  1664. display: none;
  1665. }
  1666. }
  1667. .is-disabled {
  1668. .el-input__inner:hover {
  1669. background-color: #fff !important;
  1670. border: 0;
  1671. }
  1672. color: #606266;
  1673. .el-input__inner {
  1674. background-color: #fff !important;
  1675. border: 0;
  1676. color: #606266;
  1677. }
  1678. .el-textarea__inner {
  1679. background-color: #fff !important;
  1680. border: 0;
  1681. color: #606266;
  1682. }
  1683. }
  1684. }
  1685. // 控制select为只读的时候显示样式
  1686. /deep/.ws-class-table-col {
  1687. height: auto;
  1688. padding: 0px 2px;
  1689. /deep/.el-input__inner {
  1690. padding: 0px 2px;
  1691. }
  1692. }
  1693. /deep/.is-disabled {
  1694. .el-input__prefix,
  1695. .el-input__suffix {
  1696. display: none;
  1697. }
  1698. .el-input__inner {
  1699. background-color: #fff;
  1700. border-color: #fff !important;
  1701. color: #000 !important;
  1702. font-size: 14px;
  1703. cursor: text;
  1704. padding: 0 !important;
  1705. }
  1706. }
  1707. .winseaview-view {
  1708. padding: 0 0 20px;
  1709. }
  1710. .container {
  1711. overflow: scroll;
  1712. height: 93vh;
  1713. }
  1714. /deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
  1715. width: 130px;
  1716. }
  1717. .el-textarea {
  1718. width: 101%;
  1719. }
  1720. .addressUrls {
  1721. width: 100%;
  1722. display: flex;
  1723. margin-top: 10px;
  1724. }
  1725. .addressUrls-item {
  1726. position: relative;
  1727. display: flex;
  1728. }
  1729. .icon-guanbi {
  1730. position: absolute;
  1731. right: 8px;
  1732. }
  1733. .addressUrl {
  1734. margin: 0px 10px;
  1735. border-radius: 3px;
  1736. }
  1737. //上传文件成功标识
  1738. /deep/.el-upload-list__item-status-label {
  1739. position: absolute;
  1740. right: 22px;
  1741. top: -1px;
  1742. line-height: inherit;
  1743. display: none;
  1744. }
  1745. </style>