warehouseManagementAdd.vue 29 KB

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