purchaseContractAdd.vue 53 KB

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