purchaseContractAdd.vue 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714
  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="mildewGrain">
  436. <ws-input
  437. v-model="deptBudgetList.contractProcessInfo.mildewGrain"
  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. addressUrl:'',
  593. finalTradingVolume: 0,
  594. totalContractPrice:0,
  595. contractGoodsInfo: {
  596. goodsName: '',
  597. },
  598. contractProcessInfo: {},
  599. },
  600. acceptanceCheck: {},
  601. pickerBeginDateBefore: {
  602. disabledDate: (time) => {
  603. return time.getTime() > Date.now()
  604. },
  605. },
  606. ruleDeptBudget: {
  607. contractNo: [
  608. { required: true, message: '请输入活动名称', trigger: 'blur' },
  609. {
  610. min: 6,
  611. max: 20,
  612. message: '长度在 6 到 20 个字符',
  613. trigger: 'blur',
  614. },
  615. ],
  616. },
  617. selectIntendedShip: {},
  618. interviewTypeList: {},
  619. }
  620. },
  621. activated() {
  622. this.deptBudgetList.packingMethod = '散装'
  623. this.deptBudgetList.packingMethodKey = 1
  624. this.deptBudgetList.contractGoodsInfo.goodsName = '玉米'
  625. this.deptBudgetList.contractGoodsInfo.goodsNameKey = 1
  626. this.deptBudgetList.contractProcessInfo.grade = '未回收'
  627. this.deptBudgetList.contractProcessInfo.gradeKey = 1
  628. this.deptBudgetList.contractGoodsInfo.grade = '一等品'
  629. this.deptBudgetList.contractGoodsInfo.gradeKey = 1
  630. getstafffind({ roles: 'd6a5c8a52da544309259f91f75de1ec6' })
  631. .toPromise()
  632. .then((response) => {
  633. this.options = response
  634. this.staffList = response
  635. })
  636. this.loaddata()
  637. this.showType = this.isShow
  638. },
  639. methods: {
  640. dataFilter(val) {
  641. this.deptBudgetList.personCharge = val
  642. if (val) {
  643. //val存在
  644. this.options = this.staffList.filter((item) => {
  645. if (
  646. !!~item.staffName.indexOf(val) ||
  647. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  648. ) {
  649. return true
  650. }
  651. })
  652. } else {
  653. //val为空时,还原数组
  654. this.options = this.staffList
  655. }
  656. },
  657. selectstaff(e) {
  658. for (var i = 0; i < this.staffList.length; i++) {
  659. if (this.staffList[i].staffName == e) {
  660. this.deptBudgetList.personPhone = this.staffList[i].staffMobilePhone
  661. this.deptBudgetList.personChargeKey = this.staffList[i].staffId
  662. }
  663. }
  664. },
  665. // 关闭 dialog时 处理文件url 初始化upload组件
  666. handleClose() {
  667. this.dialogViewSpareMoney = false
  668. },
  669. handleChange(value) {
  670. this.selectedOptions = value
  671. },
  672. handleChange1(value) {
  673. this.selectedOptions1 = value
  674. },
  675. weightchange(e) {
  676. this.deptBudgetList.finalTradingVolume = e
  677. },
  678. pricechange(e) {
  679. this.deptBudgetList.totalContractPrice = e*this.deptBudgetList.weight
  680. },
  681. returnsales() {
  682. this.$router.push({ path: 'buyContract' })
  683. },
  684. loaddata() {
  685. // 包装方式
  686. packList({ constId: 'CON1' })
  687. .toPromise()
  688. .then((response) => {
  689. this.packtypeList = response
  690. })
  691. // 验收方式
  692. this.getUnitList()
  693. // 货名
  694. packList({ constId: 'CON2' })
  695. .toPromise()
  696. .then((response) => {
  697. this.goodnameList = response
  698. })
  699. // 品级
  700. packList({ constId: 'CON3' })
  701. .toPromise()
  702. .then((response) => {
  703. this.gradeList = response
  704. })
  705. // 双章
  706. packList({ constId: 'CON4' })
  707. .toPromise()
  708. .then((response) => {
  709. this.ChapterTwoList = response
  710. })
  711. },
  712. onChange() {
  713. this.$refs.upload
  714. .handleSaveBill()
  715. .then(async response => {
  716. this.deptBudgetList.addressUrl = response
  717. })
  718. .catch(res => {
  719. EventBus.$emit('error', (JSON.parse(res) || {}).message)
  720. this.$refs.upload.clearFiles()
  721. })
  722. },
  723. getUnitList() {
  724. xiala({
  725. compId: sessionStorage.getItem('ws-pf_compId'),
  726. constCode: 'TYPEYAN',
  727. })
  728. .toPromise()
  729. .then((response) => {
  730. this.unitList = response
  731. let currItem
  732. this.unitList.forEach((item, index, arr) => {
  733. item.flag = 'delete'
  734. if (this.vModel == item.constKey) {
  735. currItem = item
  736. }
  737. })
  738. //
  739. if (currItem) {
  740. this.selectContract(currItem.constValue)
  741. }
  742. })
  743. },
  744. submit() {
  745. if (!this.deptBudgetList.contractNo) {
  746. this.$message({
  747. message: '合同编号不能为空',
  748. type: 'warning',
  749. })
  750. return
  751. }
  752. if (
  753. this.deptBudgetList.contractNo.length < 6 ||
  754. this.deptBudgetList.contractNo.length > 20
  755. ) {
  756. this.$message({
  757. message: '合同编号长度不符合要求,请输入6到20个字符之内!',
  758. type: 'warning',
  759. })
  760. return
  761. }
  762. if (!this.deptBudgetList.shippingType) {
  763. this.$message({
  764. message: '运输方式不能为空',
  765. type: 'warning',
  766. })
  767. return
  768. }
  769. if (
  770. this.deptBudgetList.shippingType.length < 1 ||
  771. this.deptBudgetList.shippingType.length > 20
  772. ) {
  773. this.$message({
  774. message: '运输方式长度不符合要求,请输入1到20个字符之内!',
  775. type: 'warning',
  776. })
  777. return
  778. }
  779. if (!this.deptBudgetList.buyer) {
  780. this.$message({
  781. message: '买方名称不能为空',
  782. type: 'warning',
  783. })
  784. return
  785. }
  786. if (this.deptBudgetList.buyer.length > 30) {
  787. this.$message({
  788. message: '买方名称长度不符合要求,请输入30个字符之内!',
  789. type: 'warning',
  790. })
  791. return
  792. }
  793. if (!this.deptBudgetList.settlementMethod) {
  794. this.$message({
  795. message: '结算方式不能为空',
  796. type: 'warning',
  797. })
  798. return
  799. }
  800. if (
  801. this.deptBudgetList.settlementMethod.length < 1 ||
  802. this.deptBudgetList.settlementMethod.length > 20
  803. ) {
  804. this.$message({
  805. message: '结算方式长度不符合要求,请输入1到20个字符之内!',
  806. type: 'warning',
  807. })
  808. return
  809. }
  810. if (!this.deptBudgetList.seller) {
  811. this.$message({
  812. message: '请输入卖方名称!',
  813. type: 'warning',
  814. })
  815. return
  816. }
  817. if (this.deptBudgetList.seller.length > 30) {
  818. this.$message({
  819. message: '卖方名称长度不符合要求,请输入30个字符之内!',
  820. type: 'warning',
  821. })
  822. return
  823. }
  824. if (!this.deptBudgetList.buyerPhone) {
  825. this.$message({
  826. message: '请输入买方电话!',
  827. type: 'warning',
  828. })
  829. return
  830. }
  831. if (isNaN(this.deptBudgetList.buyerPhone)) {
  832. this.$message({
  833. message: '输入买方电话有误!',
  834. type: 'warning',
  835. })
  836. return
  837. }
  838. if (
  839. this.deptBudgetList.buyerPhone.length < 7 ||
  840. this.deptBudgetList.buyerPhone.length > 20
  841. ) {
  842. this.$message({
  843. message: '买方电话长度不符合要求,请输入7到20个字符之内!',
  844. type: 'warning',
  845. })
  846. return
  847. }
  848. if (!this.deptBudgetList.sellerPhone) {
  849. this.$message({
  850. message: '请输入卖方电话!',
  851. type: 'warning',
  852. })
  853. return
  854. }
  855. if (isNaN(this.deptBudgetList.sellerPhone)) {
  856. this.$message({
  857. message: '输入卖方电话有误!',
  858. type: 'warning',
  859. })
  860. return
  861. }
  862. if (
  863. this.deptBudgetList.sellerPhone.length < 7 ||
  864. this.deptBudgetList.sellerPhone.length > 20
  865. ) {
  866. this.$message({
  867. message: '卖方电话长度不符合要求,请输入7到20个字符之内!',
  868. type: 'warning',
  869. })
  870. return
  871. }
  872. if (!this.deptBudgetList.acceptanceMethod) {
  873. this.$message({
  874. message: '请选择验收方式',
  875. type: 'warning',
  876. })
  877. return
  878. }
  879. if (!this.deptBudgetList.weight) {
  880. this.$message({
  881. message: '请输入重量!',
  882. type: 'warning',
  883. })
  884. return
  885. }
  886. if (
  887. isNaN(this.deptBudgetList.weight) ||
  888. (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
  889. String(this.deptBudgetList.weight).length -
  890. (String(this.deptBudgetList.weight).indexOf('.') + 1) >
  891. 3) ||
  892. this.deptBudgetList.weight < 0 ||
  893. this.deptBudgetList.weight > 200000
  894. ) {
  895. this.$message({
  896. message: '输入重量有误!',
  897. type: 'warning',
  898. })
  899. return
  900. }
  901. if (!this.deptBudgetList.deliveryDateStart) {
  902. this.$message({
  903. message: '请选择交货日期(起)',
  904. type: 'warning',
  905. })
  906. return
  907. }
  908. if (!this.deptBudgetList.overShort){
  909. this.$message({
  910. message: '请输入溢短装!',
  911. type: 'warning',
  912. })
  913. return
  914. }
  915. if (
  916. isNaN(this.deptBudgetList.overShort) ||
  917. (String(this.deptBudgetList.overShort).indexOf('.') != -1 &&
  918. String(this.deptBudgetList.overShort).length -
  919. (String(this.deptBudgetList.overShort).indexOf('.') + 1) >
  920. 2) ||
  921. this.deptBudgetList.overShort < 0 ||
  922. this.deptBudgetList.overShort > 50
  923. ) {
  924. this.$message({
  925. message: '溢短装输入有误!',
  926. type: 'warning',
  927. })
  928. return
  929. }
  930. if (!this.deptBudgetList.deliveryDateEnd) {
  931. this.$message({
  932. message: '请选择交货日期(止)',
  933. type: 'warning',
  934. })
  935. return
  936. }
  937. //时间
  938. if (
  939. new Date(this.deptBudgetList.deliveryDateStart).getTime() >
  940. new Date(this.deptBudgetList.deliveryDateEnd).getTime()
  941. ) {
  942. this.$message({
  943. message: '交货日期(止)选择错误',
  944. type: 'warning',
  945. })
  946. return
  947. }
  948. if (!this.deptBudgetList.unitContractPrice) {
  949. this.$message({
  950. message: '请输入合同单价!',
  951. type: 'warning',
  952. })
  953. return
  954. }
  955. if (
  956. isNaN(this.deptBudgetList.unitContractPrice) ||
  957. (String(this.deptBudgetList.unitContractPrice).indexOf('.') != -1 &&
  958. String(this.deptBudgetList.unitContractPrice).length -
  959. (String(this.deptBudgetList.unitContractPrice).indexOf('.') + 1) >
  960. 2) ||
  961. this.deptBudgetList.unitContractPrice <= 0 ||
  962. this.deptBudgetList.unitContractPrice > 10000
  963. ) {
  964. this.$message({
  965. message: '合同单价输入有误!',
  966. type: 'warning',
  967. })
  968. return
  969. }
  970. if (!this.deptBudgetList.totalContractPrice) {
  971. this.$message({
  972. message: '请输入合同总价!',
  973. type: 'warning',
  974. })
  975. return
  976. }
  977. if (
  978. isNaN(this.deptBudgetList.totalContractPrice) ||
  979. (String(this.deptBudgetList.totalContractPrice).indexOf('.') != -1 &&
  980. String(this.deptBudgetList.totalContractPrice).length -
  981. (String(this.deptBudgetList.totalContractPrice).indexOf('.') + 1) >
  982. 2) ||
  983. this.deptBudgetList.totalContractPrice <= 0 ||
  984. this.deptBudgetList.totalContractPrice > 1000000000
  985. ) {
  986. this.$message({
  987. message: '合同总价输入有误!',
  988. type: 'warning',
  989. })
  990. return
  991. }
  992. if (this.selectedOptions.length == 0) {
  993. this.$message({
  994. message: '请选择货源所在地区!',
  995. type: 'warning',
  996. })
  997. return
  998. }
  999. if (!this.deptBudgetList.sourceGoods) {
  1000. this.$message({
  1001. message: '请输入货源详细地址!',
  1002. type: 'warning',
  1003. })
  1004. return
  1005. }
  1006. if (this.selectedOptions1.length == 0) {
  1007. this.$message({
  1008. message: '请选择交货所在地区!',
  1009. type: 'warning',
  1010. })
  1011. return
  1012. }
  1013. if (!this.deptBudgetList.placeDelivery) {
  1014. this.$message({
  1015. message: '请输入交货详细地址!',
  1016. type: 'warning',
  1017. })
  1018. return
  1019. }
  1020. if (!this.deptBudgetList.signingDate) {
  1021. this.$message({
  1022. message: '请选择签订日期',
  1023. type: 'warning',
  1024. })
  1025. return
  1026. }
  1027. if (
  1028. isNaN(this.deptBudgetList.finalTradingVolume) ||
  1029. (String(this.deptBudgetList.finalTradingVolume).indexOf('.') != -1 &&
  1030. String(this.deptBudgetList.finalTradingVolume).length -
  1031. (String(this.deptBudgetList.finalTradingVolume).indexOf('.') + 1) >
  1032. 3) ||
  1033. this.deptBudgetList.finalTradingVolume < 0 ||
  1034. this.deptBudgetList.finalTradingVolume > 200000
  1035. ) {
  1036. this.$message({
  1037. message: '最终实际成交量有误!',
  1038. type: 'warning',
  1039. })
  1040. return
  1041. }
  1042. //货物信息
  1043. if (!this.deptBudgetList.contractGoodsInfo.goodsName) {
  1044. this.$message({
  1045. message: '请选择货名',
  1046. type: 'warning',
  1047. })
  1048. return
  1049. }
  1050. if (!this.deptBudgetList.contractGoodsInfo.waterContent) {
  1051. this.$message({
  1052. message: '请输入水分',
  1053. type: 'warning',
  1054. })
  1055. return
  1056. }
  1057. if (
  1058. this.deptBudgetList.contractGoodsInfo.waterContent &&
  1059. String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') != -1 &&
  1060. String(this.deptBudgetList.contractGoodsInfo.waterContent).length -
  1061. (String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') + 1) >
  1062. 2||this.deptBudgetList.contractGoodsInfo.waterContent>40||this.deptBudgetList.contractGoodsInfo.waterContent<0
  1063. ) {
  1064. this.$message({
  1065. message: '水分输入错误',
  1066. type: 'warning',
  1067. })
  1068. return
  1069. }
  1070. if (!this.deptBudgetList.contractGoodsInfo.grade) {
  1071. this.$message({
  1072. message: '请选择品级',
  1073. type: 'warning',
  1074. })
  1075. return
  1076. }
  1077. if (!this.deptBudgetList.contractGoodsInfo.impurity) {
  1078. this.$message({
  1079. message: '请输入杂质',
  1080. type: 'warning',
  1081. })
  1082. return
  1083. }
  1084. if (
  1085. this.deptBudgetList.contractGoodsInfo.impurity &&
  1086. String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') != -1 &&
  1087. String(this.deptBudgetList.contractGoodsInfo.impurity).length -
  1088. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') + 1) >
  1089. 2||this.deptBudgetList.contractGoodsInfo.impurity>40||this.deptBudgetList.contractGoodsInfo.impurity<0
  1090. ) {
  1091. this.$message({
  1092. message: '杂质输入错误',
  1093. type: 'warning',
  1094. })
  1095. return
  1096. }
  1097. if (!this.deptBudgetList.contractGoodsInfo.bulkDensity) {
  1098. this.$message({
  1099. message: '请输入容重',
  1100. type: 'warning',
  1101. })
  1102. return
  1103. }
  1104. if (
  1105. (this.deptBudgetList.contractGoodsInfo.bulkDensity &&
  1106. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') != -1 &&
  1107. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
  1108. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') + 1) >
  1109. 2) || this.deptBudgetList.contractGoodsInfo.bulkDensity > 1000 || this.deptBudgetList.contractGoodsInfo.bulkDensity < 0
  1110. ) {
  1111. this.$message({
  1112. message: '容重输入错误',
  1113. type: 'warning',
  1114. })
  1115. return
  1116. }
  1117. if (!this.deptBudgetList.contractGoodsInfo.mildewGrain) {
  1118. this.$message({
  1119. message: '请输入霉变粒',
  1120. type: 'warning',
  1121. })
  1122. return
  1123. }
  1124. if (
  1125. !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
  1126. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1127. '.'
  1128. ) != -1 &&
  1129. String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
  1130. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1131. '.'
  1132. ) +
  1133. 1) >
  1134. 2||this.deptBudgetList.contractGoodsInfo.mildewGrain>40||this.deptBudgetList.contractGoodsInfo.mildewGrain<0)
  1135. ) {
  1136. this.$message({
  1137. message: '霉变粒输入错误',
  1138. type: 'warning',
  1139. })
  1140. return
  1141. }
  1142. if (!this.deptBudgetList.contractGoodsInfo.jiaorenli) {
  1143. this.$message({
  1144. message: '请输入热损伤',
  1145. type: 'warning',
  1146. })
  1147. return
  1148. }
  1149. if (
  1150. !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
  1151. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
  1152. -1 &&
  1153. String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
  1154. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
  1155. '.'
  1156. ) +
  1157. 1) >
  1158. 2||this.deptBudgetList.contractGoodsInfo.jiaorenli>40||this.deptBudgetList.contractGoodsInfo.jiaorenli<0)
  1159. ) {
  1160. this.$message({
  1161. message: '热损伤输入错误',
  1162. type: 'warning',
  1163. })
  1164. return
  1165. }
  1166. if (!this.deptBudgetList.contractGoodsInfo.imperfectGrain) {
  1167. this.$message({
  1168. message: '请输入不完善粒',
  1169. type: 'warning',
  1170. })
  1171. return
  1172. }
  1173. if (
  1174. !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
  1175. (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
  1176. '.'
  1177. ) != -1 &&
  1178. String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
  1179. (String(
  1180. this.deptBudgetList.contractGoodsInfo.imperfectGrain
  1181. ).indexOf('.') +
  1182. 1) >
  1183. 2||this.deptBudgetList.contractGoodsInfo.imperfectGrain>40||this.deptBudgetList.contractGoodsInfo.imperfectGrain<0)
  1184. ) {
  1185. this.$message({
  1186. message: '不完善粒输入错误',
  1187. type: 'warning',
  1188. })
  1189. return
  1190. }
  1191. // if (
  1192. // (!this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000) ||
  1193. // (this.deptBudgetList.contractProcessInfo.goodsNameKey < 100) ||
  1194. // (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
  1195. // '.'
  1196. // ) != -1 &&
  1197. // String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
  1198. // (String(
  1199. // this.deptBudgetList.contractProcessInfo.goodsNameKey
  1200. // ).indexOf('.') +
  1201. // 1) >
  1202. // 2)
  1203. // ) {
  1204. // this.$message({
  1205. // message: '合同收入金额输入错误',
  1206. // type: 'warning',
  1207. // })
  1208. // return
  1209. // }
  1210. if (
  1211. (this.deptBudgetList.contractProcessInfo.waterContent > 10000000) ||
  1212. (this.deptBudgetList.contractProcessInfo.waterContent < 0) ||
  1213. (String(this.deptBudgetList.contractProcessInfo.waterContent).indexOf(
  1214. '.'
  1215. ) != -1 &&
  1216. String(this.deptBudgetList.contractProcessInfo.waterContent).length -
  1217. (String(
  1218. this.deptBudgetList.contractProcessInfo.waterContent
  1219. ).indexOf('.') +
  1220. 1) >
  1221. 2)
  1222. ) {
  1223. this.$message({
  1224. message: '费用支出输入错误',
  1225. type: 'warning',
  1226. })
  1227. return
  1228. }
  1229. if (
  1230. (this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
  1231. (this.deptBudgetList.contractProcessInfo.goodsName < 0) ||
  1232. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1233. '.'
  1234. ) != -1 &&
  1235. String(this.deptBudgetList.contractProcessInfo.goodsName).length -
  1236. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1237. '.'
  1238. ) +
  1239. 1) >
  1240. 2)
  1241. ) {
  1242. this.$message({
  1243. message: '已开发票金额输入错误',
  1244. type: 'warning',
  1245. })
  1246. return
  1247. }
  1248. if (
  1249. (this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
  1250. (this.deptBudgetList.contractProcessInfo.impurity < 0) ||
  1251. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1252. '.'
  1253. ) != -1 &&
  1254. String(this.deptBudgetList.contractProcessInfo.impurity).length -
  1255. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1256. '.'
  1257. ) +
  1258. 1) >
  1259. 2)
  1260. ) {
  1261. this.$message({
  1262. message: '未开发票金额输入错误',
  1263. type: 'warning',
  1264. })
  1265. return
  1266. }
  1267. if (
  1268. (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) |
  1269. (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
  1270. (String(this.deptBudgetList.contractProcessInfo.mildewGrain).indexOf(
  1271. '.'
  1272. ) != -1 &&
  1273. String(this.deptBudgetList.contractProcessInfo.mildewGrain).length -
  1274. (String(
  1275. this.deptBudgetList.contractProcessInfo.mildewGrain
  1276. ).indexOf('.') +
  1277. 1) >
  1278. 2)
  1279. ) {
  1280. this.$message({
  1281. message: '未回款金额输入错误',
  1282. type: 'warning',
  1283. })
  1284. return
  1285. }
  1286. this.$refs.deptBudgetList.validate((valid) => {
  1287. if (valid) {
  1288. this.deptBudgetList.sourceProvince =
  1289. CodeToText[this.selectedOptions[0]]
  1290. this.deptBudgetList.sourceCity = CodeToText[this.selectedOptions[1]]
  1291. this.deptBudgetList.deliveryProvince =
  1292. CodeToText[this.selectedOptions1[0]]
  1293. this.deptBudgetList.deliveryCity =
  1294. CodeToText[this.selectedOptions1[1]]
  1295. this.deptBudgetList.compId = this.compId
  1296. this.deptBudgetList.contractType = 2
  1297. this.deptBudgetList.goodsType = 1
  1298. if (
  1299. this.deptBudgetList.deliveryProvince == '澳门特别行政区' ||
  1300. this.deptBudgetList.deliveryProvince == '澳门特别行政区'
  1301. ) {
  1302. this.deptBudgetList.deliveryArea = '特别行政区'
  1303. } else {
  1304. this.deptBudgetList.deliveryArea =
  1305. CodeToText[this.selectedOptions1[2]]
  1306. }
  1307. if (
  1308. this.deptBudgetList.sourceProvince == '澳门特别行政区' ||
  1309. this.deptBudgetList.sourceProvince == '澳门特别行政区'
  1310. ) {
  1311. this.deptBudgetList.sourceArea = '特别行政区'
  1312. } else {
  1313. this.deptBudgetList.sourceArea = CodeToText[this.selectedOptions[2]]
  1314. }
  1315. addList(this.deptBudgetList)
  1316. .toPromise()
  1317. .then((response) => {
  1318. this.$message.success('添加成功')
  1319. this.deptBudgetList = {
  1320. deliverType: '1',
  1321. finalTradingVolume: 0,
  1322. totalContractPrice:0,
  1323. contractGoodsInfo: {
  1324. goodsName: '',
  1325. },
  1326. contractProcessInfo: {},
  1327. addressUrl:'',
  1328. }
  1329. this.$router.push({ path: 'buyContract' })
  1330. })
  1331. } else {
  1332. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1333. return false
  1334. }
  1335. })
  1336. },
  1337. resetForm(deptBudgetList) {
  1338. this.$refs[deptBudgetList].resetFields()
  1339. },
  1340. addClick() {
  1341. this.unitList.push({
  1342. flag: 'add',
  1343. constValue: '',
  1344. constKey: '',
  1345. })
  1346. },
  1347. saveClick(item, index) {
  1348. if (Object.is(item.id, 1)) {
  1349. return
  1350. }
  1351. if (Object.is(this.unitList[index].flag, 'delete')) {
  1352. this.$set(this.unitList, index, { flag: 'check' })
  1353. } else {
  1354. this.$set(this.unitList, index, { flag: 'delete' })
  1355. }
  1356. if (!item.constValue) {
  1357. this.unitList.splice(index, 1)
  1358. return
  1359. }
  1360. if (item.flag == 'add') {
  1361. item.constKey = Math.random() * 20
  1362. this.acceptanceCheck.compId = this.compId
  1363. this.acceptanceCheck.constKey = item.constKey
  1364. this.acceptanceCheck.constCode = 'TYPEYAN'
  1365. this.acceptanceCheck.constValue = item.constValue
  1366. this.acceptanceCheck.id = item.id
  1367. addxiala(this.acceptanceCheck)
  1368. .toPromise()
  1369. .then((response) => {
  1370. this.getUnitList()
  1371. })
  1372. } else if (item.flag == 'check') {
  1373. this.acceptanceCheck.compId = this.compId
  1374. this.acceptanceCheck.constKey = item.constKey
  1375. this.acceptanceCheck.constCode = 'TYPEYAN'
  1376. this.acceptanceCheck.constValue = item.constValue
  1377. this.acceptanceCheck.id = item.id
  1378. editxiala(this.acceptanceCheck)
  1379. .toPromise()
  1380. .then((response) => {
  1381. this.getUnitList()
  1382. })
  1383. }
  1384. },
  1385. selectChapterTwo(e) {
  1386. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  1387. if (this.ChapterTwoList[i].constValue == e) {
  1388. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  1389. }
  1390. }
  1391. },
  1392. selectunitList(e) {
  1393. for (var i = 0; i < this.unitList.length; i++) {
  1394. if (this.unitList[i].constValue == e) {
  1395. this.deptBudgetList.acceptanceMethodKey = this.unitList[i].constKey
  1396. }
  1397. }
  1398. },
  1399. selectgrade(e) {
  1400. for (var i = 0; i < this.gradeList.length; i++) {
  1401. if (this.gradeList[i].constValue == e) {
  1402. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  1403. }
  1404. }
  1405. },
  1406. selectgoodsName(e) {
  1407. for (var i = 0; i < this.goodnameList.length; i++) {
  1408. if (this.goodnameList[i].constValue == e) {
  1409. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  1410. this.deptBudgetList.contractGoodsInfo.goodsNameKey = this.goodnameList[i].constKey
  1411. }
  1412. }
  1413. },
  1414. selectpackingMethod(e) {
  1415. for (var i = 0; i < this.packtypeList.length; i++) {
  1416. if (this.packtypeList[i].constValue == e) {
  1417. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  1418. }
  1419. }
  1420. },
  1421. // 编辑
  1422. editClick(item, index) {
  1423. const map = JSON.parse(JSON.stringify(item))
  1424. if (Object.is(item.id, 1)) {
  1425. return
  1426. }
  1427. if (Object.is(this.unitList[index].flag, 'delete')) {
  1428. map.flag = 'check'
  1429. this.$set(this.unitList, index, map)
  1430. } else {
  1431. map.flag = 'delete'
  1432. this.$set(this.unitList, index, map)
  1433. }
  1434. },
  1435. // 删除
  1436. deleteClick(item, index) {
  1437. if (Object.is(item.constKey, 1)) {
  1438. return
  1439. }
  1440. if (!item.constValue) {
  1441. this.unitList.splice(index, 1)
  1442. return
  1443. }
  1444. delxiala({ id: this.unitList[index].id })
  1445. .toPromise()
  1446. .then((response) => {
  1447. this.getUnitList()
  1448. this.pleaseChoose = ''
  1449. })
  1450. },
  1451. },
  1452. }
  1453. </script>
  1454. <style lang="scss" scoped>
  1455. .el-form {
  1456. padding: 0 15%;
  1457. }
  1458. /deep/.ws-info-table .el-form-item {
  1459. border-right: 1px solid #cdd2dc;
  1460. border-bottom: 1px solid #cdd2dc;
  1461. }
  1462. .readonly {
  1463. position: relative;
  1464. }
  1465. .readonly:after {
  1466. content: '*';
  1467. color: #ff2727;
  1468. position: absolute;
  1469. right: 8px;
  1470. z-index: 10;
  1471. top: 21%;
  1472. font-size: 20px;
  1473. }
  1474. .title {
  1475. position: relative;
  1476. }
  1477. .title::before {
  1478. content: '';
  1479. display: inline-block;
  1480. width: 5px;
  1481. height: 30px;
  1482. background: #5473e8;
  1483. position: absolute;
  1484. left: 0;
  1485. }
  1486. .el-button--primary {
  1487. background-color: #5878e8;
  1488. border-color: #5878e8;
  1489. }
  1490. .el-col {
  1491. background: #f6f7fc;
  1492. }
  1493. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1494. padding: 0 25px;
  1495. border-left: 1px solid #cdd2dc;
  1496. background: #fafbfc;
  1497. }
  1498. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1499. width: 140px;
  1500. text-align: center;
  1501. background: #f0f2f6;
  1502. // border: 1px solid #cdd2dc;
  1503. }
  1504. .button-container {
  1505. display: flex;
  1506. flex-wrap: nowrap;
  1507. justify-content: space-between;
  1508. align-items: center;
  1509. background-color: #fff;
  1510. width: 100%;
  1511. height: 50px;
  1512. padding: 0 10px;
  1513. & > div {
  1514. margin-left: 10px;
  1515. display: flex;
  1516. flex-wrap: nowrap;
  1517. flex-direction: row;
  1518. & > span {
  1519. line-height: 50px;
  1520. }
  1521. }
  1522. /deep/.auditFlow-box {
  1523. position: unset;
  1524. margin-left: 10px;
  1525. &/deep/.auditFlow-icon {
  1526. width: auto;
  1527. padding-right: 30px;
  1528. }
  1529. &/deep/.auditFlow-main {
  1530. position: absolute;
  1531. }
  1532. }
  1533. }
  1534. .box-app {
  1535. display: inline-block;
  1536. float: left;
  1537. margin-left: 30px;
  1538. line-height: 50px;
  1539. }
  1540. /deep/.el-dialog {
  1541. .el-form-item {
  1542. margin-bottom: 0 !important;
  1543. .el-input--medium {
  1544. textarea {
  1545. min-height: 100px !important;
  1546. }
  1547. }
  1548. }
  1549. }
  1550. .collapse-bottom {
  1551. margin-bottom: 20px;
  1552. }
  1553. .input-main .textarea .el-textarea__inner {
  1554. width: 100%;
  1555. z-index: 1;
  1556. }
  1557. .bg-left {
  1558. padding-left: 30px;
  1559. }
  1560. .bg-right {
  1561. padding-right: 10px;
  1562. text-align: right;
  1563. }
  1564. .bg-bottom {
  1565. margin: 15px 0px;
  1566. }
  1567. .wenzi h3 {
  1568. display: inline-block;
  1569. left: 10px;
  1570. }
  1571. .wenzi p {
  1572. display: inline-block;
  1573. }
  1574. .upload-demo{
  1575. margin-top: 10px;
  1576. }
  1577. .center {
  1578. width: 70%;
  1579. margin: 0 auto;
  1580. }
  1581. .el-form-item {
  1582. width: 50%;
  1583. }
  1584. .el-form-item__label {
  1585. text-align: center;
  1586. }
  1587. .ce {
  1588. width: 900px;
  1589. margin: 0 auto;
  1590. }
  1591. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  1592. /* height: 82px;*/
  1593. /*}*/
  1594. // 控制select为只读的时候显示样式
  1595. .hide-sel {
  1596. .el-input__inner {
  1597. border: 0px;
  1598. }
  1599. .el-icon-arrow-up {
  1600. display: none;
  1601. }
  1602. .el-textarea__inner {
  1603. background-color: #fff !important;
  1604. border: 0;
  1605. }
  1606. .el-date-editor {
  1607. i {
  1608. display: none;
  1609. }
  1610. }
  1611. .is-disabled {
  1612. .el-input__inner:hover {
  1613. background-color: #fff !important;
  1614. border: 0;
  1615. }
  1616. color: #606266;
  1617. .el-input__inner {
  1618. background-color: #fff !important;
  1619. border: 0;
  1620. color: #606266;
  1621. }
  1622. .el-textarea__inner {
  1623. background-color: #fff !important;
  1624. border: 0;
  1625. color: #606266;
  1626. }
  1627. }
  1628. }
  1629. // 控制select为只读的时候显示样式
  1630. /deep/.ws-class-table-col {
  1631. height: auto;
  1632. padding: 0px 2px;
  1633. /deep/.el-input__inner {
  1634. padding: 0px 2px;
  1635. }
  1636. }
  1637. /deep/.is-disabled {
  1638. .el-input__prefix,
  1639. .el-input__suffix {
  1640. display: none;
  1641. }
  1642. .el-input__inner {
  1643. background-color: #fff;
  1644. border-color: #fff !important;
  1645. color: #000 !important;
  1646. font-size: 14px;
  1647. cursor: text;
  1648. padding: 0 !important;
  1649. }
  1650. }
  1651. .winseaview-view {
  1652. padding: 0 0 20px;
  1653. }
  1654. .container {
  1655. overflow: scroll;
  1656. height: 93vh;
  1657. }
  1658. /deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
  1659. width: 130px;
  1660. }
  1661. .el-textarea {
  1662. width: 101%;
  1663. }
  1664. .addressUrls {
  1665. width: 100%;
  1666. display: flex;
  1667. margin-top: 10px;
  1668. }
  1669. .addressUrls-item {
  1670. position: relative;
  1671. display: flex;
  1672. }
  1673. .icon-guanbi {
  1674. position: absolute;
  1675. right: 8px;
  1676. }
  1677. .addressUrl {
  1678. margin: 0px 10px;
  1679. border-radius: 3px;
  1680. }
  1681. //上传文件成功标识
  1682. /deep/.el-upload-list__item-status-label {
  1683. position: absolute;
  1684. right: 22px;
  1685. top: -1px;
  1686. line-height: inherit;
  1687. display: none;
  1688. }
  1689. </style>