warehouseManagementAdd.vue 31 KB

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