salesContractAdd.vue 50 KB

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