warehouseManagementAdd.vue 28 KB

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