warehouseManagementAdd.vue 28 KB

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