|
|
@@ -47,7 +47,10 @@
|
|
|
<image :src="xjItem.cover"></image>
|
|
|
</view>
|
|
|
<view class="cmd-info_bx">
|
|
|
- <view class="tit">{{ xjItem.name || "" }}</view>
|
|
|
+ <view class="tit">
|
|
|
+ {{ xjItem.name || "" }}
|
|
|
+ <text @click="changeNameFn(xjItem)" style="color:#3385ff;margin-left:32upx;font-size:30upx;">修改</text>
|
|
|
+ </view>
|
|
|
<view class="kc"></view>
|
|
|
<view class="num-open_bx">
|
|
|
<view class="open-bx warn" @tap.stop.prevent>
|
|
|
@@ -71,6 +74,18 @@
|
|
|
<button class="admin-button-com big blue" style="margin-left:50upx;" @click="saveAllItemNum()">保存修改</button>
|
|
|
</view>
|
|
|
|
|
|
+ <modal-module :show="changeShow" @click="confirmChange" :maskClosable="true" title="修改名称" padding="30rpx 30rpx" >
|
|
|
+ <template v-slot:content>
|
|
|
+ <div class="app-modal-input-wrap">
|
|
|
+ <div class="inp-list-line">
|
|
|
+ <div class="line-input">
|
|
|
+ <input type="text" style="width:61%;text-align:center;" :focus="changeFocus" v-model="xjName" class="inp-input" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </modal-module>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -79,7 +94,8 @@ import AppWrapperEmpty from "@/components/app-wrapper-empty"
|
|
|
import {getProductDetail } from "@/api/product";
|
|
|
import { changeVariety } from "@/api/item"
|
|
|
import { mapGetters } from "vuex"
|
|
|
-import { getFilterXj,ReplaceXj,clearAll,batchAdd,saveAllNum } from "@/api/product/xj"
|
|
|
+import ModalModule from "@/components/plugin/modal"
|
|
|
+import { getFilterXj,ReplaceXj,clearAll,batchAdd,saveAllNum,changeXjName } from "@/api/product/xj"
|
|
|
//图片上传插件来源:https://ext.dcloud.net.cn/plugin?id=2922 已改造,不能再升级 shish 20211228
|
|
|
import htzImageUpload from './components/htz-image-upload/htz-image-upload.vue'
|
|
|
export default {
|
|
|
@@ -87,7 +103,8 @@ export default {
|
|
|
components: {
|
|
|
AppWrapperEmpty,
|
|
|
htzImageUpload,
|
|
|
- TuiListCell
|
|
|
+ TuiListCell,
|
|
|
+ ModalModule
|
|
|
},
|
|
|
mixins: [],
|
|
|
data() {
|
|
|
@@ -99,7 +116,10 @@ export default {
|
|
|
uploadXjImg:[],
|
|
|
xjImgData:[],
|
|
|
headers:{token:''},
|
|
|
- variety:0
|
|
|
+ variety:0,
|
|
|
+ xjName:'',
|
|
|
+ xjId:0,
|
|
|
+ changeShow:false
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
@@ -126,6 +146,37 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ confirmChange(val) {
|
|
|
+ let that=this;
|
|
|
+ if (val.index == 0) {
|
|
|
+ that.changeShow = false
|
|
|
+ that.changeFocus = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.$util.isEmpty(this.xjName)){
|
|
|
+ this.$msg('请填写名称')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ changeXjName({name:this.xjName,id:this.xjId}).then(res=>{
|
|
|
+ that.changeShow = false
|
|
|
+ that.changeFocus = false
|
|
|
+ if(res.code == 1){
|
|
|
+ that.$msg(res.msg)
|
|
|
+ that.initXj()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeNameFn(item){
|
|
|
+ this.xjName = item.name
|
|
|
+ this.xjId = item.id
|
|
|
+ this.changeShow = true
|
|
|
+ setTimeout(x => {
|
|
|
+ this.$nextTick(() => this.setFocus())
|
|
|
+ }, 200)
|
|
|
+ },
|
|
|
+ setFocus() {
|
|
|
+ this.changeFocus = true
|
|
|
+ },
|
|
|
varietyChangeFn(e){
|
|
|
let that = this
|
|
|
this.variety = e.detail.value ? 1 : 0
|