warehouseManagementAdd.vue 31 KB

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