warehouseManagementAdd.vue 30 KB

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