purchaseContractAdd.vue 47 KB

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