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