|
@@ -0,0 +1,101 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-dialog
|
|
|
+ title="修改商品名称"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ v-dialogDrag
|
|
|
+ width="500px"
|
|
|
+ @close="close"
|
|
|
+ append-to-body
|
|
|
+ @keyup.enter.native=""
|
|
|
+ :visible.sync="visible">
|
|
|
+ <div style="height: calc(100% - 80px);">
|
|
|
+ <el-form size="large" style="margin-top: 30px" ref="inputForm" :model="inputForm" @submit.native.prevent>
|
|
|
+ <!-- 搜索框-->
|
|
|
+ <el-row :gutter="26">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item prop="tradeName" :rules="[
|
|
|
+ {required: true, message: '商品名称不能为空', trigger: 'blur'}
|
|
|
+ ]">
|
|
|
+ <el-input v-model="inputForm.tradeName" placeholder="请输入商品名称" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="submit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import WareHouseService from '@/api/materialManagement/WareHouseService'
|
|
|
+ export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ title: '',
|
|
|
+ method: '',
|
|
|
+ visible: false,
|
|
|
+ loading: false,
|
|
|
+ dataList: [],
|
|
|
+ inputForm: {
|
|
|
+ tradeName: ''
|
|
|
+ },
|
|
|
+ oldTradeName: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ wareHouseService: null,
|
|
|
+ created () {
|
|
|
+ this.wareHouseService = new WareHouseService()
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init (tradeName) {
|
|
|
+ this.visible = true
|
|
|
+ this.inputForm.tradeName = tradeName
|
|
|
+ this.oldTradeName = tradeName
|
|
|
+ },
|
|
|
+ // 表单提交
|
|
|
+ submit () {
|
|
|
+ this.$refs['inputForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.$confirm('确定将商品名称为 ”' + this.oldTradeName + '“ 的入库商品全部改为 ”' + this.inputForm.tradeName + '“ 吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true
|
|
|
+ this.wareHouseService.saveTradeName(this.oldTradeName, this.inputForm.tradeName).then(({data}) => {
|
|
|
+ this.$message.success(data)
|
|
|
+ this.close()
|
|
|
+ this.$emit('refreshList')
|
|
|
+ this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ close () {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.inputForm = {
|
|
|
+ tradeName: ''
|
|
|
+ }
|
|
|
+ this.visible = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+ /deep/ .el-dialog__body {
|
|
|
+ padding-top: 0px;
|
|
|
+ padding-bottom: 15px;
|
|
|
+ }
|
|
|
+</style>
|