salesContractAdd.vue 50 KB

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