warehouseManagementAdd.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119
  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" 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.otherPersonCharge=this.deptBudgetList.otherPersonCharge.toString()
  444. this.deptBudgetList.otherPersonPhone = this.deptBudgetList.otherPersonPhone.toString()
  445. this.deptBudgetList.compId =
  446. localStorage.getItem('ws-pf_compId')
  447. this.deptBudgetList.warehousePositionInfoList =
  448. this.freightspace
  449. this.deptBudgetList.totalStorage = this.totalStorage
  450. addList(this.deptBudgetList)
  451. .toPromise()
  452. .then((response) => {
  453. this.$message.success('添加成功')
  454. this.deptBudgetList = {
  455. automaticWeightAcquisition:'0'
  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.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. }
  557. this.freightspace = [{
  558. binNumber: '',
  559. maxStorage: '',
  560. remark: ''
  561. }]
  562. this.addressUrls = []
  563. this.selectedOptions = ''
  564. this.$router.push({
  565. path: 'warehouseManagementList'
  566. })
  567. })
  568. } else {
  569. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  570. return false
  571. }
  572. })
  573. })
  574. .catch(() => {
  575. return false
  576. })
  577. }
  578. },
  579. resetForm(deptBudgetList) {
  580. this.$refs[deptBudgetList].resetFields()
  581. },
  582. saveClick(item, index) {
  583. console.log(item)
  584. if (Object.is(item.id, 1)) {
  585. return
  586. }
  587. if (Object.is(this.unitList[index].flag, 'delete')) {
  588. this.$set(this.unitList, index, {
  589. flag: 'check'
  590. })
  591. } else {
  592. this.$set(this.unitList, index, {
  593. flag: 'delete'
  594. })
  595. }
  596. if (!item.constValue) {
  597. this.unitList.splice(index, 1)
  598. return
  599. }
  600. if (item.flag == 'add') {
  601. item.constKey = Math.random() * 20
  602. this.trainingMethods.compId = localStorage.getItem('ws-pf_compId')
  603. this.trainingMethods.constKey = item.constKey
  604. this.trainingMethods.constCode = 'TYPEYAN'
  605. this.trainingMethods.constValue = item.constValue
  606. this.trainingMethods.id = item.id
  607. addxiala(this.trainingMethods)
  608. .toPromise()
  609. .then((response) => {
  610. this.getUnitList()
  611. })
  612. } else if (item.flag == 'check') {
  613. this.trainingMethods.compId = localStorage.getItem('ws-pf_compId')
  614. this.trainingMethods.constKey = item.constKey
  615. this.trainingMethods.constCode = 'TYPEYAN'
  616. this.trainingMethods.constValue = item.constValue
  617. this.trainingMethods.id = item.id
  618. editxiala(this.trainingMethods)
  619. .toPromise()
  620. .then((response) => {
  621. this.getUnitList()
  622. })
  623. }
  624. },
  625. getList() {
  626. getstaff({
  627. compId: localStorage.getItem('ws-pf_compId')
  628. })
  629. .toPromise()
  630. .then((response) => {
  631. // this.agent = response
  632. this.options = response
  633. this.optionsOther = response
  634. this.staffList = response
  635. this.personCharge = response
  636. // for(var i=0;i<response.length;i++){
  637. // this.optionsOther.push(response[i].staffName+" "+response[i].staffMobilePhone)
  638. // }
  639. })
  640. },
  641. selectChapterTwo(e) {
  642. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  643. if (this.ChapterTwoList[i].constValue == e) {
  644. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  645. }
  646. }
  647. },
  648. selectunitList(e) {
  649. for (var i = 0; i < this.unitList.length; i++) {
  650. if (this.unitList[i].constValue == e) {
  651. this.deptBudgetList.acceptanceMethodKey = this.unitList[i].constKey
  652. }
  653. }
  654. },
  655. selectgrade(e) {
  656. for (var i = 0; i < this.gradeList.length; i++) {
  657. if (this.gradeList[i].constValue == e) {
  658. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  659. }
  660. }
  661. },
  662. selectgoodsName(e) {
  663. for (var i = 0; i < this.goodnameList.length; i++) {
  664. if (this.goodnameList[i].constValue == e) {
  665. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  666. }
  667. }
  668. },
  669. selectpackingMethod(e) {
  670. for (var i = 0; i < this.packtypeList.length; i++) {
  671. if (this.packtypeList[i].constValue == e) {
  672. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  673. }
  674. }
  675. },
  676. // 编辑
  677. editClick(item, index) {
  678. const map = JSON.parse(JSON.stringify(item))
  679. if (Object.is(item.id, 1)) {
  680. return
  681. }
  682. if (Object.is(this.unitList[index].flag, 'delete')) {
  683. map.flag = 'check'
  684. this.$set(this.unitList, index, map)
  685. } else {
  686. map.flag = 'delete'
  687. this.$set(this.unitList, index, map)
  688. }
  689. },
  690. // 删除
  691. deleteClick(item, index) {
  692. if (Object.is(item.constKey, 1)) {
  693. return
  694. }
  695. if (!item.constValue) {
  696. this.unitList.splice(index, 1)
  697. return
  698. }
  699. delxiala({
  700. id: this.unitList[index].id
  701. })
  702. .toPromise()
  703. .then((response) => {
  704. this.getUnitList()
  705. this.pleaseChoose = ''
  706. })
  707. },
  708. },
  709. }
  710. </script>
  711. <style lang="scss" scoped>
  712. /deep/.totalStorage .el-input__inner {
  713. color: #afb5cb;
  714. background: #f5f7fa;
  715. }
  716. .small-title {
  717. position: relative;
  718. padding: 10px;
  719. font-weight: 600;
  720. }
  721. .small-title::before {
  722. position: absolute;
  723. content: '';
  724. display: block;
  725. background: #5473e8;
  726. width: 4px;
  727. height: 14px;
  728. left: 0px;
  729. top: 13px;
  730. }
  731. .position {
  732. position: relative;
  733. }
  734. .add,
  735. .del {
  736. position: absolute;
  737. right: -38px;
  738. top: 9px;
  739. cursor: pointer;
  740. }
  741. .del {
  742. right: -70px;
  743. }
  744. .amap-page-container {
  745. width: 300px;
  746. height: 300px;
  747. }
  748. .el-form {
  749. padding: 0 15%;
  750. }
  751. /deep/.ws-info-table .el-form-item {
  752. border-right: 1px solid transparent;
  753. border-bottom: 1px solid transparent;
  754. }
  755. .readonly {
  756. position: relative;
  757. }
  758. .readonly:after {
  759. content: '*';
  760. color: #ff2727;
  761. position: absolute;
  762. right: 8px;
  763. z-index: 10;
  764. top: 21%;
  765. font-size: 20px;
  766. }
  767. .title {
  768. position: relative;
  769. }
  770. .title::before {
  771. content: '';
  772. display: inline-block;
  773. width: 5px;
  774. height: 30px;
  775. background: #5473e8;
  776. position: absolute;
  777. left: 0;
  778. }
  779. .ws-info-table {
  780. border-left: 1px solid transparent;
  781. border-top: 1px solid transparent;
  782. }
  783. .el-button--primary {
  784. background-color: #5878e8;
  785. border-color: #5878e8;
  786. }
  787. .el-col {
  788. background: #f6f7fc;
  789. }
  790. /deep/.ws-info-table .el-form-item .el-form-item__content {
  791. padding: 0 25px;
  792. border-left: 1px solid transparent;
  793. background: #fff;
  794. }
  795. /deep/.ws-info-table .el-form-item .el-form-item__label {
  796. width: 130px;
  797. text-align: center;
  798. background: #fff;
  799. // border: 1px solid #cdd2dc;
  800. }
  801. .button-container {
  802. display: flex;
  803. flex-wrap: nowrap;
  804. justify-content: space-between;
  805. align-items: center;
  806. background-color: #fff;
  807. width: 100%;
  808. height: 50px;
  809. padding: 0 10px;
  810. &>div {
  811. margin-left: 10px;
  812. display: flex;
  813. flex-wrap: nowrap;
  814. flex-direction: row;
  815. &>span {
  816. line-height: 50px;
  817. }
  818. }
  819. /deep/.auditFlow-box {
  820. position: unset;
  821. margin-left: 10px;
  822. &/deep/.auditFlow-icon {
  823. width: auto;
  824. padding-right: 30px;
  825. }
  826. &/deep/.auditFlow-main {
  827. position: absolute;
  828. }
  829. }
  830. }
  831. .box-app {
  832. display: inline-block;
  833. float: left;
  834. margin-left: 30px;
  835. line-height: 50px;
  836. }
  837. /deep/.el-dialog {
  838. .el-form-item {
  839. margin-bottom: 0 !important;
  840. .el-input--medium {
  841. textarea {
  842. min-height: 100px !important;
  843. }
  844. }
  845. }
  846. }
  847. .collapse-bottom {
  848. margin-bottom: 20px;
  849. }
  850. .input-main .textarea .el-textarea__inner {
  851. width: 100%;
  852. z-index: 1;
  853. }
  854. .bg-left {
  855. padding-left: 30px;
  856. }
  857. .bg-right {
  858. padding-right: 10px;
  859. text-align: right;
  860. }
  861. .bg-bottom {
  862. margin: 15px 0px;
  863. }
  864. .wenzi {
  865. width: 900px;
  866. margin: 0 auto;
  867. }
  868. .wenzi h3 {
  869. display: inline-block;
  870. left: 10px;
  871. }
  872. .wenzi p {
  873. display: inline-block;
  874. }
  875. .center {
  876. width: 900px;
  877. margin: 0 auto;
  878. }
  879. .el-form-item {
  880. width: 50%;
  881. }
  882. .el-form-item__label {
  883. text-align: center;
  884. }
  885. .ce {
  886. width: 900px;
  887. margin: 0 auto;
  888. }
  889. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  890. /* height: 82px;*/
  891. /*}*/
  892. // 控制select为只读的时候显示样式
  893. .hide-sel {
  894. .el-input__inner {
  895. border: 0px;
  896. }
  897. .el-icon-arrow-up {
  898. display: none;
  899. }
  900. .el-textarea__inner {
  901. background-color: #fff !important;
  902. border: 0;
  903. }
  904. .el-date-editor {
  905. i {
  906. display: none;
  907. }
  908. }
  909. .is-disabled {
  910. .el-input__inner:hover {
  911. background-color: #fff !important;
  912. border: 0;
  913. }
  914. color: #606266;
  915. .el-input__inner {
  916. background-color: #fff !important;
  917. border: 0;
  918. color: #606266;
  919. }
  920. .el-textarea__inner {
  921. background-color: #fff !important;
  922. border: 0;
  923. color: #606266;
  924. }
  925. }
  926. }
  927. // 控制select为只读的时候显示样式
  928. /deep/.ws-class-table-col {
  929. height: auto;
  930. padding: 0px 2px;
  931. /deep/.el-input__inner {
  932. padding: 0px 2px;
  933. }
  934. }
  935. /deep/.is-disabled {
  936. .el-input__prefix,
  937. .el-input__suffix {
  938. display: none;
  939. }
  940. .el-input__inner {
  941. background-color: #fff;
  942. border-color: #fff !important;
  943. color: #000 !important;
  944. font-size: 14px;
  945. cursor: text;
  946. padding: 0 !important;
  947. }
  948. }
  949. .winseaview-view {
  950. padding: 0 0 20px;
  951. }
  952. .container {
  953. overflow: scroll;
  954. height: 93vh;
  955. }
  956. .ws-info-table .el-form-item {
  957. width: 33.3333%;
  958. }
  959. .readonly:after {
  960. display: none;
  961. }
  962. .el-textarea__inner {
  963. display: none;
  964. }
  965. .el-form {
  966. margin-top: 50px;
  967. }
  968. .readonly {
  969. width: 16%;
  970. }
  971. .ws-info-table .el-form-item {
  972. width: 33.33%;
  973. }
  974. //去边框
  975. /deep/.el-form-item {
  976. border-right: 0px;
  977. border-bottom: 0px;
  978. }
  979. /deep/.ws-info-table {
  980. border-left: 0px;
  981. border-top: 0px;
  982. }
  983. .ws-info-table .el-form-item .el-form-item__content {
  984. border-right: 0px;
  985. border-bottom: 0px;
  986. border-left: 0px;
  987. border-top: 0px;
  988. }
  989. /deep/.ws-info-table .el-form-item {
  990. border-right: 0px;
  991. border-bottom: 0px;
  992. border-left: 0px;
  993. border-top: 0px;
  994. }
  995. /deep/.ws-info-table .el-form-item .el-form-item__content {
  996. background: #f5f7fa;
  997. border-radius: 4px;
  998. border: 1px solid #d8dce6;
  999. font-family: PingFangSC-Regular, PingFang SC;
  1000. margin-bottom: 5px;
  1001. background-color: #fff;
  1002. font-size: 14px;
  1003. font-weight: 400;
  1004. color: #8890b1;
  1005. line-height: 16px;
  1006. }
  1007. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1008. background-color: #fff;
  1009. font-size: 14px;
  1010. font-family: PingFangSC-Regular, PingFang SC;
  1011. font-weight: 400;
  1012. color: #8890b1;
  1013. line-height: 16px;
  1014. }
  1015. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1016. border: 0px;
  1017. }
  1018. .avatar-uploader {
  1019. margin: 0 5px;
  1020. }
  1021. .addressUrls {
  1022. display: flex;
  1023. margin-top: 10px;
  1024. }
  1025. .addressUrls-item {
  1026. position: relative;
  1027. display: flex;
  1028. }
  1029. .icon-guanbi {
  1030. position: absolute;
  1031. right: 0;
  1032. }
  1033. .addressUrl {
  1034. margin: 0px 10px;
  1035. border-radius: 3px;
  1036. }
  1037. </style>