purchaseContractAdd.vue 49 KB

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