warehouseManagementAdd.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111
  1. //添加仓库
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="12">
  6. <h2 class="bg-left title">创建仓库</h2>
  7. </el-col>
  8. <el-col :span="12" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="returnsales()"
  14. ><img
  15. width="6"
  16. height="10"
  17. style="vertical-align: bottom; margin-right: 3px"
  18. src="../../../public/img/lujing.png"
  19. alt=""
  20. />返回</el-button
  21. >
  22. </el-col>
  23. </el-row>
  24. <ws-form
  25. class="position"
  26. ref="deptBudgetList"
  27. :rules="rules"
  28. :model="deptBudgetList"
  29. >
  30. <el-radio-group v-model="radio">
  31. <el-radio :label="1">常用仓库</el-radio>
  32. <el-radio :label="2">临时仓库</el-radio>
  33. </el-radio-group>
  34. <div class="small-title">基本信息</div>
  35. <ws-info-table>
  36. <!--仓库名称-->
  37. <ws-form-item label="仓库名称" span="1" prop="warehouseName">
  38. <ws-input
  39. v-model="deptBudgetList.warehouseName"
  40. placeholder="请输入仓库名"
  41. maxlength="20"
  42. size="small"
  43. />
  44. </ws-form-item>
  45. <!--负责人-->
  46. <ws-form-item label="负责人" span="1" prop="personCharge">
  47. <el-select
  48. v-model="deptBudgetList.personCharge"
  49. placeholder="请选择负责人"
  50. filterable
  51. clearable
  52. :filter-method="dataFilter"
  53. @change="selectstaff"
  54. >
  55. <el-option
  56. v-for="item in options"
  57. :key="item.value"
  58. :label="item.staffName"
  59. :value="item.staffName"
  60. />
  61. </el-select>
  62. </ws-form-item>
  63. <!--负责人电话-->
  64. <ws-form-item label="负责人电话" span="1" prop="personPhone">
  65. <ws-input
  66. v-model="deptBudgetList.personPhone"
  67. placeholder="请输入负责人手机号码"
  68. maxlength="100"
  69. size="small"
  70. />
  71. </ws-form-item>
  72. <!--其他负责人-->
  73. <ws-form-item label="其他负责人" span="1" prop="otherPersonCharge">
  74. <el-select
  75. v-model="deptBudgetList.otherPersonCharge"
  76. placeholder="请选择其他负责人"
  77. @change="selectstaffOther"
  78. multiple
  79. >
  80. <el-option
  81. v-for="item in optionsOther"
  82. :key="item.value"
  83. :label="item.staffName"
  84. :value="item.staffName + ' ' + item.staffMobilePhone "
  85. />
  86. </el-select>
  87. </ws-form-item>
  88. <!--仓库所在地-->
  89. <ws-form-item label="仓库所在地" span="1" prop="acceptanceMethod">
  90. <el-cascader
  91. :options="options_"
  92. v-model="selectedOptions"
  93. clearable
  94. size="large"
  95. placeholder="请选择仓库所在地"
  96. style="width: 200%"
  97. @change="handleChange"
  98. />
  99. </ws-form-item>
  100. <!--详细地址-->
  101. <ws-form-item
  102. label="详细地址"
  103. span="1"
  104. prop="detailedAddress"
  105. class="readonly"
  106. >
  107. <ws-input
  108. v-model="deptBudgetList.detailedAddress"
  109. placeholder="请输入详细地址"
  110. maxlength="100"
  111. size="small"
  112. />
  113. </ws-form-item>
  114. <!--总储量(吨)-->
  115. <ws-form-item
  116. label="总储量(吨)"
  117. span="1"
  118. prop="settlementMethod"
  119. v-show="radio == 1"
  120. >
  121. <ws-input
  122. class="totalStorage"
  123. :readonly="true"
  124. v-model="totalStorage"
  125. maxlength="100"
  126. size="small"
  127. />
  128. </ws-form-item>
  129. <div
  130. style="width: 100%"
  131. class="flex position"
  132. v-for="(item, index) in freightspace"
  133. v-show="radio == 1"
  134. :key="index"
  135. >
  136. <ws-form-item
  137. label="仓位编号"
  138. span="1"
  139. prop="contractNo"
  140. class="readonly"
  141. >
  142. <ws-input
  143. v-model="item.binNumber"
  144. placeholder="请输入仓位编号"
  145. maxlength="20"
  146. size="small"
  147. />
  148. </ws-form-item>
  149. <ws-form-item label="仓位储量(吨)" span="1" prop="contractNo">
  150. <ws-input
  151. v-model="item.maxStorage"
  152. placeholder="请输入仓位最大容量"
  153. maxlength="100"
  154. size="small"
  155. />
  156. </ws-form-item>
  157. <!--备注(选项)-->
  158. <ws-form-item label="备注(选填)" span="1" prop="placeDelivery">
  159. <ws-input
  160. v-model="item.remark"
  161. placeholder="请输入备注"
  162. maxlength="20"
  163. size="small"
  164. />
  165. </ws-form-item>
  166. <img
  167. width="22"
  168. height="22"
  169. class="add"
  170. @click="add"
  171. src="../../../public/img/add.png"
  172. alt=""
  173. />
  174. <img
  175. width="22"
  176. height="22"
  177. class="del"
  178. @click="del(index)"
  179. src="../../../public/img/del.png"
  180. alt=""
  181. />
  182. </div>
  183. </ws-info-table>
  184. </ws-form>
  185. <ws-form ref="deptBudgetList" :model="deptBudgetList">
  186. <div class="small-title" v-show="radio == 1">上传仓库照片</div>
  187. <el-upload
  188. action="https://www.zthymaoyi.com/upload/admin"
  189. :show-file-list="false"
  190. :on-success="
  191. (res, file) => {
  192. uploadSuccessHandle(res)
  193. }
  194. "
  195. class="avatar-uploader"
  196. accept=".jpg, .jpeg, .png, .gif"
  197. >
  198. <el-button v-show="radio == 1">上传附件</el-button>
  199. </el-upload>
  200. <div class="addressUrls" v-if="addressUrls != null">
  201. <div class="addressUrls-item">
  202. <div
  203. v-for="(item, index) in addressUrls"
  204. class="addressUrl"
  205. :key="index"
  206. >
  207. <div @click="close(index)" class="iconfont icon-guanbi"></div>
  208. <img
  209. v-if="addressUrls != null"
  210. width="100"
  211. height="100"
  212. :src="item"
  213. alt=""
  214. />
  215. </div>
  216. </div>
  217. </div>
  218. <div style="margin-bottom: 5px" class="small-title">仓库定位</div>
  219. <map-drag @marker="marker" @selectedAddress="selectedAddress"></map-drag>
  220. </ws-form>
  221. <!-- 提交 -->
  222. <div style="text-align: right; padding: 10px" class="center">
  223. <el-button
  224. class="bg-bottom"
  225. type="primary"
  226. size="small"
  227. @click="submit(deptBudgetList)"
  228. >提交</el-button
  229. >
  230. </div>
  231. </div>
  232. </template>
  233. <script>
  234. import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
  235. import {
  236. addList,
  237. addxiala,
  238. editxiala,
  239. delxiala,
  240. increase,
  241. getstaff,
  242. } from '@/model/warehouse/index'
  243. import WsUpload from '@/components/WsUpload'
  244. import mapDrag from '@/components/mapdrag/mapdrag'
  245. export default {
  246. name: 'viewSpareMoney',
  247. components: {
  248. WsUpload,
  249. mapDrag,
  250. },
  251. watch: {
  252. vesselId(val) {
  253. this.getVesselData()
  254. },
  255. isShow(val) {
  256. this.showType = val
  257. },
  258. },
  259. data() {
  260. let self = this
  261. return {
  262. deptBudgetList: {
  263. totalStorage: 0,
  264. addressUrl: '',
  265. },
  266. options_: regionData,
  267. heightData: '600px',
  268. zoom: 7,
  269. selectedOptions: [],
  270. center: [116.244694, 39.517344],
  271. window: '',
  272. radio: 1,
  273. personCharge: [],
  274. options: [],
  275. optionsOther: [],
  276. staffList: [],
  277. polygons: [
  278. {
  279. pName: 'Geolocation', //定位
  280. events: {
  281. init(o) {
  282. // o 是高德地图定位插件实例
  283. o.getCurrentPosition((status, result) => {
  284. if (result && result.position) {
  285. self.lng = result.position.lng //设置经度
  286. self.lat = result.position.lat //设置维度
  287. self.center = [self.lng, self.lat] //设置坐标
  288. self.loaded = true //load
  289. self.$nextTick() //页面渲染好后
  290. }
  291. })
  292. },
  293. },
  294. },
  295. ],
  296. district: null,
  297. listDate: { country: '中国', level: 'country', city: '' },
  298. citylist: [],
  299. compId: sessionStorage.getItem('ws-pf_compId'),
  300. rules: {
  301. warehouseName: [
  302. {
  303. required: true,
  304. message: '请输入仓库名称',
  305. trigger: 'blur',
  306. },
  307. {
  308. min: 2,
  309. max: 20,
  310. message: '仓库名长度不符合要求,请输入2-20字符之内',
  311. trigger: 'blur',
  312. },
  313. ],
  314. },
  315. appendixIdsAdd: '',
  316. size: 10,
  317. value1: '',
  318. unitList: [],
  319. freightspace: [{ binNumber: '', maxStorage: '', remark: '' }],
  320. name: '',
  321. list: [],
  322. addressUrls: [],
  323. }
  324. },
  325. mounted() {
  326. this.getList()
  327. },
  328. computed: {
  329. totalStorage: function () {
  330. var maxStorage = 0
  331. for (var i = 0; i < this.freightspace.length; i++) {
  332. maxStorage += Number(this.freightspace[i].maxStorage)
  333. }
  334. return maxStorage
  335. },
  336. },
  337. methods: {
  338. close(index) {
  339. this.addressUrls.splice(index, 1)
  340. },
  341. dataFilter(val) {
  342. this.deptBudgetList.personCharge = val
  343. if (val) {
  344. console.log(val)
  345. this.options = this.staffList.filter((item) => {
  346. if (
  347. !!~item.staffName.indexOf(val) ||
  348. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  349. ) {
  350. return true
  351. }
  352. })
  353. } else {
  354. this.options = this.staffList
  355. }
  356. },
  357. selectstaffOther(e) {
  358. // for (var i = 0; i < this.staffList.length; i++) {
  359. // if (this.staffList[i].staffName == e) {
  360. // this.deptBudgetList.personPhone = this.staffList[i].staffMobilePhone
  361. // this.deptBudgetList.personChargeKey = this.staffList[i].staffId
  362. // }
  363. // }
  364. },
  365. selectstaff(e) {
  366. for (var i = 0; i < this.staffList.length; i++) {
  367. if (this.staffList[i].staffName == e) {
  368. this.deptBudgetList.personPhone = this.staffList[i].staffMobilePhone
  369. this.deptBudgetList.personChargeKey = this.staffList[i].staffId
  370. }
  371. }
  372. },
  373. marker: function (item) {
  374. this.deptBudgetList.warehousePositioning =
  375. item.lnglat.lat + ',' + item.lnglat.lng
  376. },
  377. selectedAddress(e) {
  378. this.deptBudgetList.warehousePositioning =
  379. e.center.lat + ',' + e.center.lng
  380. },
  381. confirmPositioncity() {
  382. this.listDate.level = 'city'
  383. this.listDate.country = this.name
  384. },
  385. // 关闭 dialog时 处理文件url 初始化upload组件
  386. handleClose() {
  387. this.dialogViewSpareMoney = false
  388. },
  389. add() {
  390. this.freightspace.push({
  391. binNumber: '',
  392. maxStorage: '',
  393. remark: '',
  394. })
  395. },
  396. del(index) {
  397. if (this.freightspace.length > 1) {
  398. this.freightspace.splice(index, 1)
  399. }
  400. },
  401. handleChange(value) {
  402. this.selectedOptions = value
  403. },
  404. returnsales() {
  405. this.deptBudgetList = {}
  406. this.freightspace = {}
  407. this.selectedOptions = ''
  408. this.$router.push({ path: 'warehouseManagementList' })
  409. },
  410. // 上传附件
  411. uploadSuccessHandle(e) {
  412. this.deptBudgetList.addressUrl += e.url + ','
  413. this.addressUrls.push(e.url)
  414. },
  415. onChange(files) {
  416. this.fileNum = files
  417. this.$refs.upload.handleSaveBill().then((res) => {})
  418. },
  419. submit() {
  420. if (this.radio == 1) {
  421. if (!this.deptBudgetList.warehouseName) {
  422. this.$message({
  423. message: '仓库名称不能为空!',
  424. type: 'warning',
  425. })
  426. return
  427. }
  428. if (
  429. this.deptBudgetList.warehouseName.length < 2 ||
  430. this.deptBudgetList.warehouseName.length > 20
  431. ) {
  432. this.$message({
  433. message: '仓库名长度不符合要求!',
  434. type: 'warning',
  435. })
  436. return
  437. }
  438. if (!this.deptBudgetList.personCharge) {
  439. this.$message({
  440. message: '负责人不能为空!',
  441. type: 'warning',
  442. })
  443. return
  444. }
  445. if (
  446. this.deptBudgetList.personCharge.length < 2 ||
  447. this.deptBudgetList.personCharge.length > 10
  448. ) {
  449. this.$message({
  450. message: '负责人长度不符合要求,请控制在2-10字符之内',
  451. type: 'warning',
  452. })
  453. return
  454. }
  455. if (!this.deptBudgetList.personPhone) {
  456. this.$message({
  457. message: '负责人电话不能为空!',
  458. type: 'warning',
  459. })
  460. return
  461. }
  462. if (this.deptBudgetList.personPhone.length != 11) {
  463. this.$message({
  464. message: '手机号输入有误!',
  465. type: 'warning',
  466. })
  467. return
  468. }
  469. if (!this.deptBudgetList.detailedAddress) {
  470. this.$message({
  471. message: '详细地址不能为空!',
  472. type: 'warning',
  473. })
  474. return
  475. }
  476. if (this.totalStorage <= 0) {
  477. this.$message({
  478. message: '仓位储量不能为空!',
  479. type: 'warning',
  480. })
  481. return
  482. }
  483. if (
  484. this.deptBudgetList.detailedAddress.length < 2 ||
  485. this.deptBudgetList.detailedAddress.length > 20
  486. ) {
  487. this.$message({
  488. message: '详细地址长度不符合要求,请控制在2-20字符之内',
  489. type: 'warning',
  490. })
  491. return
  492. }
  493. // freightspace
  494. for (var i = 0; i < this.freightspace.length; i++) {
  495. for (var j = i + 1; j < this.freightspace.length; j++) {
  496. console.log(
  497. this.freightspace[i].binNumber,
  498. this.freightspace[j].binNumber
  499. )
  500. if (
  501. this.freightspace[i].binNumber == this.freightspace[j].binNumber
  502. ) {
  503. this.$message({
  504. message: '仓位编号重复',
  505. type: 'warning',
  506. })
  507. return
  508. }
  509. }
  510. }
  511. this.$confirm(`确定提交仓库信息?`, {
  512. confirmButtonText: '确定',
  513. cancelButtonText: '取消',
  514. type: 'warning',
  515. })
  516. .then(() => {
  517. this.$refs.deptBudgetList.validate((valid) => {
  518. if (valid) {
  519. this.deptBudgetList.otherPersonCharge=this.deptBudgetList.otherPersonCharge.toString()
  520. this.deptBudgetList.compId =
  521. sessionStorage.getItem('ws-pf_compId')
  522. this.deptBudgetList.warehousePrivate =
  523. CodeToText[this.selectedOptions[0]]
  524. this.deptBudgetList.warehouseCity =
  525. CodeToText[this.selectedOptions[1]]
  526. this.deptBudgetList.warehouseArea =
  527. CodeToText[this.selectedOptions[2]]
  528. this.deptBudgetList.warehousePositionInfoList =
  529. this.freightspace
  530. this.deptBudgetList.totalStorage = this.totalStorage
  531. addList(this.deptBudgetList)
  532. .toPromise()
  533. .then((response) => {
  534. this.$message.success('添加成功')
  535. this.deptBudgetList = {}
  536. this.freightspace = {}
  537. this.selectedOptions = ''
  538. this.$router.push({ path: 'warehouseManagementList' })
  539. })
  540. } else {
  541. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  542. return false
  543. }
  544. })
  545. })
  546. .catch(() => {
  547. return false
  548. })
  549. } else if (this.radio == 2) {
  550. if (!this.deptBudgetList.warehouseName) {
  551. this.$message({
  552. message: '仓库名称不能为空!',
  553. type: 'warning',
  554. })
  555. return
  556. }
  557. if (
  558. this.deptBudgetList.warehouseName.length < 2 ||
  559. this.deptBudgetList.warehouseName.length > 20
  560. ) {
  561. this.$message({
  562. message: '仓库名长度不符合要求!',
  563. type: 'warning',
  564. })
  565. return
  566. }
  567. if (!this.deptBudgetList.personCharge) {
  568. this.$message({
  569. message: '负责人不能为空!',
  570. type: 'warning',
  571. })
  572. return
  573. }
  574. if (
  575. this.deptBudgetList.personCharge.length < 2 ||
  576. this.deptBudgetList.personCharge.length > 10
  577. ) {
  578. this.$message({
  579. message: '负责人长度不符合要求,请控制在2-10字符之内',
  580. type: 'warning',
  581. })
  582. return
  583. }
  584. if (!this.deptBudgetList.personPhone) {
  585. this.$message({
  586. message: '负责人电话不能为空!',
  587. type: 'warning',
  588. })
  589. return
  590. }
  591. if (this.deptBudgetList.personPhone.length != 11) {
  592. this.$message({
  593. message: '手机号输入有误!',
  594. type: 'warning',
  595. })
  596. return
  597. }
  598. if (!this.deptBudgetList.detailedAddress) {
  599. this.$message({
  600. message: '详细地址不能为空!',
  601. type: 'warning',
  602. })
  603. return
  604. }
  605. this.$confirm(`确定提交仓库信息?`, {
  606. confirmButtonText: '确定',
  607. cancelButtonText: '取消',
  608. type: 'warning',
  609. })
  610. .then(() => {
  611. this.$refs.deptBudgetList.validate((valid) => {
  612. if (valid) {
  613. this.deptBudgetList.compId =
  614. sessionStorage.getItem('ws-pf_compId')
  615. this.deptBudgetList.warehousePrivate =
  616. CodeToText[this.selectedOptions[0]]
  617. this.deptBudgetList.warehouseCity =
  618. CodeToText[this.selectedOptions[1]]
  619. this.deptBudgetList.warehouseArea =
  620. CodeToText[this.selectedOptions[2]]
  621. this.deptBudgetList.warehousePositionInfoList =
  622. this.freightspace
  623. this.deptBudgetList.totalStorage = this.totalStorage
  624. if (this.radio == 2) {
  625. this.deptBudgetList.warehousetype == 2
  626. }
  627. increase(this.deptBudgetList)
  628. .toPromise()
  629. .then((response) => {
  630. this.$message.success('添加成功')
  631. this.deptBudgetList = {}
  632. this.freightspace = {}
  633. this.selectedOptions = ''
  634. this.$router.push({ path: 'warehouseManagementList' })
  635. })
  636. } else {
  637. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  638. return false
  639. }
  640. })
  641. })
  642. .catch(() => {
  643. return false
  644. })
  645. }
  646. },
  647. resetForm(deptBudgetList) {
  648. this.$refs[deptBudgetList].resetFields()
  649. },
  650. saveClick(item, index) {
  651. console.log(item)
  652. if (Object.is(item.id, 1)) {
  653. return
  654. }
  655. if (Object.is(this.unitList[index].flag, 'delete')) {
  656. this.$set(this.unitList, index, { flag: 'check' })
  657. } else {
  658. this.$set(this.unitList, index, { flag: 'delete' })
  659. }
  660. if (!item.constValue) {
  661. this.unitList.splice(index, 1)
  662. return
  663. }
  664. if (item.flag == 'add') {
  665. item.constKey = Math.random() * 20
  666. this.trainingMethods.compId = sessionStorage.getItem('ws-pf_compId')
  667. this.trainingMethods.constKey = item.constKey
  668. this.trainingMethods.constCode = 'TYPEYAN'
  669. this.trainingMethods.constValue = item.constValue
  670. this.trainingMethods.id = item.id
  671. addxiala(this.trainingMethods)
  672. .toPromise()
  673. .then((response) => {
  674. this.getUnitList()
  675. })
  676. } else if (item.flag == 'check') {
  677. this.trainingMethods.compId = sessionStorage.getItem('ws-pf_compId')
  678. this.trainingMethods.constKey = item.constKey
  679. this.trainingMethods.constCode = 'TYPEYAN'
  680. this.trainingMethods.constValue = item.constValue
  681. this.trainingMethods.id = item.id
  682. editxiala(this.trainingMethods)
  683. .toPromise()
  684. .then((response) => {
  685. this.getUnitList()
  686. })
  687. }
  688. },
  689. getList() {
  690. getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
  691. .toPromise()
  692. .then((response) => {
  693. // this.agent = response
  694. this.options = response
  695. this.optionsOther = response
  696. this.staffList = response
  697. this.personCharge = response
  698. // for(var i=0;i<response.length;i++){
  699. // this.optionsOther.push(response[i].staffName+" "+response[i].staffMobilePhone)
  700. // }
  701. })
  702. },
  703. selectChapterTwo(e) {
  704. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  705. if (this.ChapterTwoList[i].constValue == e) {
  706. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  707. }
  708. }
  709. },
  710. selectunitList(e) {
  711. for (var i = 0; i < this.unitList.length; i++) {
  712. if (this.unitList[i].constValue == e) {
  713. this.deptBudgetList.acceptanceMethodKey = this.unitList[i].constKey
  714. }
  715. }
  716. },
  717. selectgrade(e) {
  718. for (var i = 0; i < this.gradeList.length; i++) {
  719. if (this.gradeList[i].constValue == e) {
  720. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  721. }
  722. }
  723. },
  724. selectgoodsName(e) {
  725. for (var i = 0; i < this.goodnameList.length; i++) {
  726. if (this.goodnameList[i].constValue == e) {
  727. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  728. }
  729. }
  730. },
  731. selectpackingMethod(e) {
  732. for (var i = 0; i < this.packtypeList.length; i++) {
  733. if (this.packtypeList[i].constValue == e) {
  734. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  735. }
  736. }
  737. },
  738. // 编辑
  739. editClick(item, index) {
  740. const map = JSON.parse(JSON.stringify(item))
  741. if (Object.is(item.id, 1)) {
  742. return
  743. }
  744. if (Object.is(this.unitList[index].flag, 'delete')) {
  745. map.flag = 'check'
  746. this.$set(this.unitList, index, map)
  747. } else {
  748. map.flag = 'delete'
  749. this.$set(this.unitList, index, map)
  750. }
  751. },
  752. // 删除
  753. deleteClick(item, index) {
  754. if (Object.is(item.constKey, 1)) {
  755. return
  756. }
  757. if (!item.constValue) {
  758. this.unitList.splice(index, 1)
  759. return
  760. }
  761. delxiala({ id: this.unitList[index].id })
  762. .toPromise()
  763. .then((response) => {
  764. this.getUnitList()
  765. this.pleaseChoose = ''
  766. })
  767. },
  768. },
  769. }
  770. </script>
  771. <style lang="scss" scoped>
  772. /deep/.totalStorage .el-input__inner {
  773. color: #afb5cb;
  774. background: #f5f7fa;
  775. }
  776. .small-title {
  777. position: relative;
  778. padding: 10px;
  779. font-weight: 600;
  780. }
  781. .small-title::before {
  782. position: absolute;
  783. content: '';
  784. display: block;
  785. background: #5473e8;
  786. width: 4px;
  787. height: 14px;
  788. left: 0px;
  789. top: 13px;
  790. }
  791. .position {
  792. position: relative;
  793. }
  794. .add,
  795. .del {
  796. position: absolute;
  797. right: -38px;
  798. top: 9px;
  799. cursor: pointer;
  800. }
  801. .del {
  802. right: -70px;
  803. }
  804. .amap-page-container {
  805. width: 300px;
  806. height: 300px;
  807. }
  808. .el-form {
  809. padding: 0 15%;
  810. }
  811. /deep/.ws-info-table .el-form-item {
  812. border-right: 1px solid transparent;
  813. border-bottom: 1px solid transparent;
  814. }
  815. .readonly {
  816. position: relative;
  817. }
  818. .readonly:after {
  819. content: '*';
  820. color: #ff2727;
  821. position: absolute;
  822. right: 8px;
  823. z-index: 10;
  824. top: 21%;
  825. font-size: 20px;
  826. }
  827. .title {
  828. position: relative;
  829. }
  830. .title::before {
  831. content: '';
  832. display: inline-block;
  833. width: 5px;
  834. height: 30px;
  835. background: #5473e8;
  836. position: absolute;
  837. left: 0;
  838. }
  839. .ws-info-table {
  840. border-left: 1px solid transparent;
  841. border-top: 1px solid transparent;
  842. }
  843. .el-button--primary {
  844. background-color: #5878e8;
  845. border-color: #5878e8;
  846. }
  847. .el-col {
  848. background: #f6f7fc;
  849. }
  850. /deep/.ws-info-table .el-form-item .el-form-item__content {
  851. padding: 0 25px;
  852. border-left: 1px solid transparent;
  853. background: #fff;
  854. }
  855. /deep/.ws-info-table .el-form-item .el-form-item__label {
  856. width: 115px;
  857. text-align: center;
  858. background: #fff;
  859. // border: 1px solid #cdd2dc;
  860. }
  861. .button-container {
  862. display: flex;
  863. flex-wrap: nowrap;
  864. justify-content: space-between;
  865. align-items: center;
  866. background-color: #fff;
  867. width: 100%;
  868. height: 50px;
  869. padding: 0 10px;
  870. & > div {
  871. margin-left: 10px;
  872. display: flex;
  873. flex-wrap: nowrap;
  874. flex-direction: row;
  875. & > span {
  876. line-height: 50px;
  877. }
  878. }
  879. /deep/.auditFlow-box {
  880. position: unset;
  881. margin-left: 10px;
  882. &/deep/.auditFlow-icon {
  883. width: auto;
  884. padding-right: 30px;
  885. }
  886. &/deep/.auditFlow-main {
  887. position: absolute;
  888. }
  889. }
  890. }
  891. .box-app {
  892. display: inline-block;
  893. float: left;
  894. margin-left: 30px;
  895. line-height: 50px;
  896. }
  897. /deep/.el-dialog {
  898. .el-form-item {
  899. margin-bottom: 0 !important;
  900. .el-input--medium {
  901. textarea {
  902. min-height: 100px !important;
  903. }
  904. }
  905. }
  906. }
  907. .collapse-bottom {
  908. margin-bottom: 20px;
  909. }
  910. .input-main .textarea .el-textarea__inner {
  911. width: 100%;
  912. z-index: 1;
  913. }
  914. .bg-left {
  915. padding-left: 30px;
  916. }
  917. .bg-right {
  918. padding-right: 10px;
  919. text-align: right;
  920. }
  921. .bg-bottom {
  922. margin: 15px 0px;
  923. }
  924. .wenzi {
  925. width: 900px;
  926. margin: 0 auto;
  927. }
  928. .wenzi h3 {
  929. display: inline-block;
  930. left: 10px;
  931. }
  932. .wenzi p {
  933. display: inline-block;
  934. }
  935. .center {
  936. width: 900px;
  937. margin: 0 auto;
  938. }
  939. .el-form-item {
  940. width: 50%;
  941. }
  942. .el-form-item__label {
  943. text-align: center;
  944. }
  945. .ce {
  946. width: 900px;
  947. margin: 0 auto;
  948. }
  949. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  950. /* height: 82px;*/
  951. /*}*/
  952. // 控制select为只读的时候显示样式
  953. .hide-sel {
  954. .el-input__inner {
  955. border: 0px;
  956. }
  957. .el-icon-arrow-up {
  958. display: none;
  959. }
  960. .el-textarea__inner {
  961. background-color: #fff !important;
  962. border: 0;
  963. }
  964. .el-date-editor {
  965. i {
  966. display: none;
  967. }
  968. }
  969. .is-disabled {
  970. .el-input__inner:hover {
  971. background-color: #fff !important;
  972. border: 0;
  973. }
  974. color: #606266;
  975. .el-input__inner {
  976. background-color: #fff !important;
  977. border: 0;
  978. color: #606266;
  979. }
  980. .el-textarea__inner {
  981. background-color: #fff !important;
  982. border: 0;
  983. color: #606266;
  984. }
  985. }
  986. }
  987. // 控制select为只读的时候显示样式
  988. /deep/.ws-class-table-col {
  989. height: auto;
  990. padding: 0px 2px;
  991. /deep/.el-input__inner {
  992. padding: 0px 2px;
  993. }
  994. }
  995. /deep/.is-disabled {
  996. .el-input__prefix,
  997. .el-input__suffix {
  998. display: none;
  999. }
  1000. .el-input__inner {
  1001. background-color: #fff;
  1002. border-color: #fff !important;
  1003. color: #000 !important;
  1004. font-size: 14px;
  1005. cursor: text;
  1006. padding: 0 !important;
  1007. }
  1008. }
  1009. .winseaview-view {
  1010. padding: 0 0 20px;
  1011. }
  1012. .container {
  1013. overflow: scroll;
  1014. height: 93vh;
  1015. }
  1016. .ws-info-table .el-form-item {
  1017. width: 33.3333%;
  1018. }
  1019. .readonly:after {
  1020. display: none;
  1021. }
  1022. .el-textarea__inner {
  1023. display: none;
  1024. }
  1025. .el-form {
  1026. margin-top: 50px;
  1027. }
  1028. .readonly {
  1029. width: 16%;
  1030. }
  1031. .ws-info-table .el-form-item {
  1032. width: 33.33%;
  1033. }
  1034. //去边框
  1035. /deep/.el-form-item {
  1036. border-right: 0px;
  1037. border-bottom: 0px;
  1038. }
  1039. /deep/.ws-info-table {
  1040. border-left: 0px;
  1041. border-top: 0px;
  1042. }
  1043. .ws-info-table .el-form-item .el-form-item__content {
  1044. border-right: 0px;
  1045. border-bottom: 0px;
  1046. border-left: 0px;
  1047. border-top: 0px;
  1048. }
  1049. /deep/.ws-info-table .el-form-item {
  1050. border-right: 0px;
  1051. border-bottom: 0px;
  1052. border-left: 0px;
  1053. border-top: 0px;
  1054. }
  1055. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1056. background: #f5f7fa;
  1057. border-radius: 4px;
  1058. border: 1px solid #d8dce6;
  1059. font-family: PingFangSC-Regular, PingFang SC;
  1060. margin-bottom: 5px;
  1061. background-color: #fff;
  1062. font-size: 14px;
  1063. font-weight: 400;
  1064. color: #8890b1;
  1065. line-height: 16px;
  1066. }
  1067. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1068. background-color: #fff;
  1069. font-size: 14px;
  1070. font-family: PingFangSC-Regular, PingFang SC;
  1071. font-weight: 400;
  1072. color: #8890b1;
  1073. line-height: 16px;
  1074. }
  1075. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1076. border: 0px;
  1077. }
  1078. .avatar-uploader {
  1079. margin: 0 5px;
  1080. }
  1081. .addressUrls {
  1082. display: flex;
  1083. margin-top: 10px;
  1084. }
  1085. .addressUrls-item {
  1086. position: relative;
  1087. display: flex;
  1088. }
  1089. .icon-guanbi {
  1090. position: absolute;
  1091. right: 0;
  1092. }
  1093. .addressUrl {
  1094. margin: 0px 10px;
  1095. border-radius: 3px;
  1096. }
  1097. </style>