purchaseContractAdd.vue 51 KB

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