salesContractAdd.vue 49 KB

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