purchaseContractAdd.vue 47 KB

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