238 行
8.8 KiB
HTML
可执行文件
238 行
8.8 KiB
HTML
可执行文件
<!--[1.8.73]-->
|
|
<style>
|
|
.el-collapse-item__header {
|
|
font-weight: bold !important;
|
|
font-size: 14px !important;
|
|
}
|
|
|
|
.close-collapse {
|
|
width: 50px;
|
|
height: 50px;
|
|
position: fixed;
|
|
bottom: 3vw;
|
|
right: 3vw;
|
|
display: flex;
|
|
border-radius: 50%;
|
|
background-color: rgba(0, 0, 0, 0.05);
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-direction: column;
|
|
font-size: 12px;
|
|
color: #666;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.close-collapse:active {
|
|
background-color: rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.status {
|
|
display: inline-block;
|
|
margin: 30px;
|
|
vertical-align: top;
|
|
}
|
|
</style>
|
|
<div id="storeSet" v-cloak style="padding: 15px;">
|
|
<el-collapse v-model="activeNames">
|
|
<el-collapse-item title="打印单据设置商品与规格名称最多显示字数" name="1" v-if="operate.fontStatus">
|
|
<div class="status">
|
|
商品名称:
|
|
<el-input size="mini" v-model="font_num" size="small"
|
|
placeholder="商品名称最多显示个数"
|
|
style="width:100px;margin-right: 5px"></el-input>
|
|
<span>个</span>
|
|
</div>
|
|
<div class="status">
|
|
规格名称:
|
|
<el-input size="mini" v-model="sku_num" size="small"
|
|
placeholder="规格名称最多显示个数"
|
|
style="width:100px;margin-right: 5px"></el-input>
|
|
<span>个</span>
|
|
</div>
|
|
<div class="status">
|
|
<el-button size="mini" type="primary" @click="fontStatus">保存</el-button>
|
|
</div>
|
|
</el-collapse-item>
|
|
<template v-if="platform_type==1">
|
|
<el-collapse-item title="采购是否可以修改售价" name="2" v-if="operate.modifyPrice">
|
|
<el-switch
|
|
v-model="modify_price_state"
|
|
@change="modifyPrice"
|
|
:active-value="2"
|
|
:inactive-value="1">
|
|
</el-switch>
|
|
<span style="color: #999999">采购的同时是否可以修改商品的售价</span>
|
|
</el-collapse-item>
|
|
<el-collapse-item name="3" title="盘点显示当前库存" v-if="operate.takeMStockInventory">
|
|
<el-switch v-model="is_check_show_invenum"
|
|
@change="changeShowInventoryNum"
|
|
active-value="1"
|
|
inactive-value="2">
|
|
</el-switch>
|
|
<span style="color: #999999">在盘点的时候页面上是否展示商品的库存</span>
|
|
</el-collapse-item>
|
|
<el-collapse-item name="3" title="采购设置商品批号功能" v-if="operate.setBatchNumber">
|
|
<el-switch v-model="set_batch_number"
|
|
@change="setBatchNumber"
|
|
active-value="1"
|
|
inactive-value="2">
|
|
</el-switch>
|
|
<span style="color: #999999">在新增采购单时,记录商品批号功能</span>
|
|
</el-collapse-item>
|
|
</template>
|
|
</el-collapse>
|
|
|
|
</div>
|
|
<script type="text/javascript">
|
|
var storeSet = new Vue({
|
|
el: '#storeSet',
|
|
data: function () {
|
|
return {
|
|
operate: {},
|
|
activeNames: ['1', '2', '3'],
|
|
font_num: "",
|
|
sku_num: "",
|
|
modify_price_state: "",
|
|
is_check_show_invenum: "2",
|
|
set_batch_number: "2",
|
|
platform_type: 2,
|
|
}
|
|
},
|
|
methods: {
|
|
//基础数据
|
|
basics: function () {
|
|
var that = this;
|
|
$.ajax({
|
|
url: "{:U('indexBasics')}",
|
|
type: "post",
|
|
data: {},
|
|
success: function (res) {
|
|
if (res.status == 1) {
|
|
that.font_num = res.data.print.font_num;
|
|
that.sku_num = res.data.print.sku_num;
|
|
that.modify_price_state = parseInt(res.data.print.modify_price_state);
|
|
that.is_check_show_invenum = res.data.is_check_show_invenum;
|
|
that.set_batch_number = res.data.set_batch_number;
|
|
} else {
|
|
that.$message.error(res.message);
|
|
}
|
|
}
|
|
})
|
|
},
|
|
//采购售价开关
|
|
modifyPrice: function () {
|
|
var that = this;
|
|
$.ajax({
|
|
url: "{:U('modifyPrice')}",
|
|
type: "post",
|
|
data: {
|
|
modify_price_state: that.modify_price_state
|
|
},
|
|
success: function (res) {
|
|
if (res.status == 1) {
|
|
that.$message.success(res.message);
|
|
} else {
|
|
that.$message.error(res.message);
|
|
}
|
|
}
|
|
})
|
|
},
|
|
handleChange(val) {
|
|
// console.log(val);
|
|
},
|
|
fontStatus: function () {
|
|
var that = this;
|
|
var font_num = that.font_num;
|
|
var sku_num = that.sku_num;
|
|
$.ajax({
|
|
url: "{:U('fontSet')}",
|
|
type: "post",
|
|
data: {
|
|
font_num: font_num,
|
|
sku_num: sku_num
|
|
},
|
|
success: function (res) {
|
|
if (res.status == 1) {
|
|
that.$message({
|
|
message: res.msg,
|
|
type: 'success',
|
|
});
|
|
} else {
|
|
that.$message({
|
|
message: res.msg,
|
|
type: 'error',
|
|
});
|
|
}
|
|
}
|
|
})
|
|
},
|
|
//盘点是否展示系统库存
|
|
changeShowInventoryNum() {
|
|
$.ajax({
|
|
url: "{:U('takeMStockInventory')}",
|
|
type: "post",
|
|
data: {
|
|
status: this.is_check_show_invenum
|
|
},
|
|
success: (res) => {
|
|
if (res.status == 1) {
|
|
this.$message.success(res.msg);
|
|
} else {
|
|
this.$message.error(res.msg);
|
|
}
|
|
}
|
|
})
|
|
},
|
|
//采购是否能设置商品批号
|
|
setBatchNumber() {
|
|
$.ajax({
|
|
url: "{:U('setBatchNumber')}",
|
|
type: "post",
|
|
data: {
|
|
status: this.set_batch_number
|
|
},
|
|
success: (res) => {
|
|
if (res.status == 1) {
|
|
this.$message.success(res.msg);
|
|
} else {
|
|
this.set_batch_number = this.set_batch_number == 1 ? '2' : '1';
|
|
this.$message.error(res.msg);
|
|
}
|
|
}
|
|
})
|
|
},
|
|
//获取用户权限
|
|
getOperate() {
|
|
var auth_list = {
|
|
fontStatus: '/index.php/Retail/MerInventoryPrint/fontSet',
|
|
modifyPrice: '/index.php/Retail/MerInventoryPrint/modifyPrice',
|
|
takeMStockInventory: '/index.php/Retail/MerInventoryPrint/takeMStockInventory',
|
|
setBatchNumber: '/index.php/Retail/MerInventoryPrint/setBatchNumber',
|
|
};
|
|
$.ajax({
|
|
url: '/index.php/Retail/Component/checkOperateAuth',
|
|
type: "post",
|
|
data: {
|
|
auth_list: JSON.stringify(auth_list),
|
|
},
|
|
success: (res) => {
|
|
if (res.status == 1) {
|
|
this.operate = res.data;
|
|
}
|
|
}
|
|
})
|
|
}
|
|
},
|
|
created() {
|
|
this.getOperate();
|
|
this.basics();
|
|
this.sendRequest('Retail/Mgoods/getPlatformType', {
|
|
success: (res) => {
|
|
if (res.status == 1) {
|
|
this.platform_type = res.platform_type;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
})
|
|
</script> |