purchaseContractAdd.vue 54 KB

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