salesContractAdd.vue 50 KB

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