purchaseContractAdd.vue 51 KB

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