供应链基础设置接口对接
This commit is contained in:
parent
70662eed2a
commit
a88e4551e9
|
|
@ -0,0 +1,110 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// ---------- 基础参数设置 ------------------
|
||||
|
||||
// 查询基础参数列表
|
||||
export function getSettingListApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/ims_setting/list',
|
||||
method: 'get',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑基础参数
|
||||
export function batchEditSettingApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/ims_setting/edit',
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 重置基础参数
|
||||
export function batchResetSettingApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_setting/batchToDefault',
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 传感器参数metric-查询
|
||||
export function getMetricSettingListApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_device_sensor_metric/list',
|
||||
method: 'get',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑-传感器参数metric
|
||||
export function batchEditMetricSettingApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_device_sensor_metric/batchEdit',
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 重置-传感器参数metric
|
||||
export function batchResetMetricSettingApi(idStr) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_device_sensor_metric/rollback/'+idStr,
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 摄像头参数列表-查询
|
||||
export function getCameraSettingListApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_camera_setting/list',
|
||||
method: 'get',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改摄像头参数设置(批量)
|
||||
export function batchEditCameraSettingApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_camera_setting/batchEdit',
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改摄像头参数设置 (批量) (回滚)
|
||||
export function batchResetCameraSettingApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_camera_setting/batchToDefault',
|
||||
method: 'post',
|
||||
headers: {
|
||||
//"merchant-id":"378915229716713472",
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
@ -7,10 +7,10 @@
|
|||
<div>
|
||||
<div>
|
||||
<span class="item-label">菜品原料换算取整方式:</span>
|
||||
<el-select v-model="staff_health_cert_left_day_reminder" placeholder="请选择" style="width: 240px;">
|
||||
<el-option label="向上取整" :value="0"></el-option>
|
||||
<el-option label="向下取整" :value="1"></el-option>
|
||||
<el-option label="四舍五入" :value="2"></el-option>
|
||||
<el-select v-model="material_conversion_rounding_method" placeholder="请选择" style="width: 240px;">
|
||||
<el-option label="向上取整" value="0"></el-option>
|
||||
<el-option label="向下取整" value="1"></el-option>
|
||||
<el-option label="四舍五入" value="2"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="color: #999;font-size: 14px;margin-top: 10px">生产计划中菜品拆解出的原料将按照设定的方式取整</div>
|
||||
|
|
@ -20,9 +20,9 @@
|
|||
<div>
|
||||
<div>
|
||||
<span class="item-label">采购计划参考价:</span>
|
||||
<el-select v-model="staff_health_cert_left_day_reminder" placeholder="请选择" style="width: 240px;">
|
||||
<el-option label="参考上次采购价格" :value="0"></el-option>
|
||||
<el-option label="参考采集的市场价格" :value="1"></el-option>
|
||||
<el-select v-model="purchase_plan_reference_price" placeholder="请选择" style="width: 240px;">
|
||||
<el-option label="参考上次采购价格" value="0"></el-option>
|
||||
<el-option label="参考采集的市场价格" value="1"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="color: #999;font-size: 14px;margin-top: 10px">采购计划中将按照设定的方式展示货品的参考价</div>
|
||||
|
|
@ -34,8 +34,8 @@
|
|||
<div>
|
||||
<span class="item-label">货品临期天数设置:</span>
|
||||
<el-input
|
||||
v-model.number="staff_health_cert_left_day_reminder" style="width: 200px;margin-left: 50px;"
|
||||
auto-complete="off" placeholder="30" maxlength="3" @input="(v)=>(staff_health_cert_left_day_reminder=v.replace(/[^\d]/g,''))"
|
||||
v-model.number="goods_expireing_day_reminder" style="width: 200px;margin-left: 50px;"
|
||||
auto-complete="off" placeholder="30" maxlength="3" @input="(v)=>(goods_expireing_day_reminder=v.replace(/[^\d]/g,''))"
|
||||
></el-input>
|
||||
<span class="item-unit">天</span>
|
||||
</div>
|
||||
|
|
@ -47,8 +47,8 @@
|
|||
<div>
|
||||
<span class="item-label">资质证书临期天数:</span>
|
||||
<el-input
|
||||
v-model.number="staff_morning_check_video_save_day" style="width: 200px;margin-left: 50px;"
|
||||
auto-complete="off" maxlength="3" placeholder="30" @input="(v)=>(staff_morning_check_video_save_day=v.replace(/[^\d]/g,''))"
|
||||
v-model.number="qualification_certificates_expiring_day_reminder" style="width: 200px;margin-left: 50px;"
|
||||
auto-complete="off" maxlength="3" placeholder="30" @input="(v)=>(qualification_certificates_expiring_day_reminder=v.replace(/[^\d]/g,''))"
|
||||
></el-input>
|
||||
<span class="item-unit">天</span>
|
||||
</div>
|
||||
|
|
@ -60,105 +60,78 @@
|
|||
<div>
|
||||
<span class="item-label">货品即将缺货数量设置:</span>
|
||||
<el-input
|
||||
v-model.number="staff_morning_check_video_save_day" style="width: 200px;margin-left: 50px;"
|
||||
auto-complete="off" maxlength="3" placeholder="30" @input="(v)=>(staff_morning_check_video_save_day=v.replace(/[^\d]/g,''))"
|
||||
v-model.number="goods_lacking_number_reminder" style="width: 200px;margin-left: 50px;"
|
||||
auto-complete="off" maxlength="3" placeholder="30" @input="(v)=>(goods_lacking_number_reminder=v.replace(/[^\d]/g,''))"
|
||||
></el-input>
|
||||
</div>
|
||||
<div style="color: #999;font-size: 14px;margin-top: 10px">设置货品即将缺货数量,系统将根据货品的库存数量自动进行提醒</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;padding-left: 40px;">
|
||||
<el-button type="primary" @click="save1">保存</el-button>
|
||||
<el-button type="info" @click="reset1">恢复默认</el-button>
|
||||
<el-button type="primary" @click="save1">确 定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSettingListApi,batchEditSettingApi,batchResetSettingApi } from "@/api/kitchen/setting.js";
|
||||
import { getSettingListApi,batchEditSettingApi } from "@/api/foodManage/baseInfo.js";
|
||||
|
||||
export default {
|
||||
name: "",
|
||||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
//员工信息设置
|
||||
staff_health_cert_left_day_reminder:null,
|
||||
//存储设置
|
||||
staff_morning_check_video_save_day:null,
|
||||
staff_illegal_warning_record_save_day:null,
|
||||
//环境监控设置
|
||||
env_monitor_statis_frequency:null,
|
||||
metricSettingList:[],
|
||||
env_temperature_max_value:null,
|
||||
env_temperature_min_value:null,
|
||||
env_humidity_max_value:null,
|
||||
env_humidity_min_value:null,
|
||||
env_smoke_max_value:null,
|
||||
env_sample_cabinet_temp_max_value:null,
|
||||
env_sample_cabinet_temp_min_value:null,
|
||||
return {
|
||||
material_conversion_rounding_method:null,
|
||||
purchase_plan_reference_price:null,
|
||||
goods_expireing_day_reminder:null,
|
||||
qualification_certificates_expiring_day_reminder:null,
|
||||
goods_lacking_number_reminder:null,
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted(){
|
||||
this.query1()
|
||||
this.query2()
|
||||
this.query1()
|
||||
},
|
||||
methods: {
|
||||
query1(){
|
||||
getSettingListApi({"itemName": "staff_health_cert_left_day_reminder"}).then(response => {
|
||||
this.staff_health_cert_left_day_reminder = response.rows[0].itemValue
|
||||
getSettingListApi().then(response => {
|
||||
let arr = response.rows;
|
||||
arr.forEach(item=>{
|
||||
if(item.itemName=='material_conversion_rounding_method'){
|
||||
this.material_conversion_rounding_method = item.itemValue
|
||||
}
|
||||
if(item.itemName=='purchase_plan_reference_price'){
|
||||
this.purchase_plan_reference_price = item.itemValue
|
||||
}
|
||||
if(item.itemName=='goods_expireing_day_reminder'){
|
||||
this.goods_expireing_day_reminder = item.itemValue
|
||||
}
|
||||
if(item.itemName=='qualification_certificates_expiring_day_reminder'){
|
||||
this.qualification_certificates_expiring_day_reminder = item.itemValue
|
||||
}
|
||||
if(item.itemName=='goods_lacking_number_reminder'){
|
||||
this.goods_lacking_number_reminder = item.itemValue
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
save1(){
|
||||
let param = [
|
||||
{"itemName": "staff_health_cert_left_day_reminder","itemValue":this.staff_health_cert_left_day_reminder}
|
||||
{"itemName": "material_conversion_rounding_method","itemValue":this.material_conversion_rounding_method},
|
||||
{"itemName": "purchase_plan_reference_price","itemValue":this.purchase_plan_reference_price},
|
||||
{"itemName": "goods_expireing_day_reminder","itemValue":this.goods_expireing_day_reminder},
|
||||
{"itemName": "qualification_certificates_expiring_day_reminder","itemValue":this.qualification_certificates_expiring_day_reminder},
|
||||
{"itemName": "goods_lacking_number_reminder","itemValue":this.goods_lacking_number_reminder},
|
||||
]
|
||||
batchEditSettingApi(param).then(response => {
|
||||
this.$message.success("保存成功");
|
||||
this.query1()
|
||||
});
|
||||
},
|
||||
reset1(){
|
||||
let param = [
|
||||
{"itemName": "staff_health_cert_left_day_reminder"}
|
||||
]
|
||||
batchResetSettingApi(param).then(response => {
|
||||
this.$message.success("恢复成功");
|
||||
this.query1()
|
||||
});
|
||||
},
|
||||
query2(){
|
||||
getSettingListApi({"itemName": "staff_morning_check_video_save_day"}).then(response => {
|
||||
this.staff_morning_check_video_save_day = response.rows[0].itemValue
|
||||
});
|
||||
getSettingListApi({"itemName": "staff_illegal_warning_record_save_day"}).then(response => {
|
||||
this.staff_illegal_warning_record_save_day = response.rows[0].itemValue
|
||||
});
|
||||
},
|
||||
save2(){
|
||||
let param = [
|
||||
{"itemName": "staff_morning_check_video_save_day","itemValue":this.staff_morning_check_video_save_day},
|
||||
{"itemName": "staff_illegal_warning_record_save_day","itemValue":this.staff_illegal_warning_record_save_day},
|
||||
]
|
||||
batchEditSettingApi(param).then(response => {
|
||||
this.$message.success("保存成功");
|
||||
this.query2()
|
||||
});
|
||||
},
|
||||
reset2(){
|
||||
let param = [
|
||||
{"itemName": "staff_morning_check_video_save_day"},
|
||||
{"itemName": "staff_illegal_warning_record_save_day"},
|
||||
]
|
||||
batchResetSettingApi(param).then(response => {
|
||||
this.$message.success("恢复成功");
|
||||
this.query2()
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue