purchaseContractAdd.vue 46 KB

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