This commit is contained in:
shijing 2023-12-21 10:22:16 +08:00
commit 5b0ed75718
17 changed files with 171 additions and 127 deletions

View File

@ -4,15 +4,6 @@ import data from './../../../src/utils/baseJson';
const baseInFo = data[data.current];
export default {
config:{
base: {
url: `${config.API_URL}/system/base_config/`,
name: "账户信息",
req: async function(){
return await http.get(this.url);
}
},
},
// config:{
// base: {
// url: `${config.API_URL}/system/base_config/`,
@ -413,7 +404,14 @@ export default {
}
}
},
baseInfo: {
config: {
base: {
url: `${config.API_URL}/system/base_config/`,
name: "账户信息",
req: async function(){
return await http.get(this.url);
}
},
getInfo: {
url: `${config.API_URL}/system/config/`,
name: "获取系统信息",

View File

@ -235,9 +235,9 @@
return baseName;
},
baseLogo(){
let baseInFo = data[data.current];
// let base_logo = this.$TOOL.data.get("BASE_INFO")!==null?this.$TOOL.data.get("BASE_INFO").base.base_logo:'img/logo.png';
let base_logo = baseInFo!==null?baseInFo.base.base_logo:'img/logo.png';
// let baseInFo = data[data.current];
let base_logo = this.$TOOL.data.get("BASE_INFO")!==null?this.$TOOL.data.get("BASE_INFO").base.base_logo:'img/logo.png';
// let base_logo = baseInFo!==null?baseInFo.base.base_logo:'img/logo.png';
return base_logo
},
ismobile(){

View File

@ -46,9 +46,9 @@
<el-button type="default" @click="h5Show">H5访问</el-button>
<el-button type="primary" @click="MonitorOpen" style="background-color:orange;border-color:orange">监控视频</el-button>
</div>
<div class="login-oauth" v-else>
<!-- <div class="login-oauth" v-else>
<el-button type="default" @click="faceLogin">刷脸登录</el-button>
</div>
</div> -->
</div>
</div>
</div>

View File

@ -35,18 +35,18 @@
<span v-if="!scope.row.isedit">{{
scope.row.material_in_name
}}</span>
<el-select v-else v-model="scope.row.material_in" style="width: 100%">
<el-option v-for="item in materials" :key="item.id" :label="item.name" :value="item.id"></el-option>
<el-select v-else v-model="scope.row.material_in" filterable style="width: 100%">
<el-option v-for="item in materials" :key="item.id" :label="item.full_name" :value="item.id"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="type" label="输出物料" min-width="120" align="center">
<template #default="scope">
<span v-if="!scope.row.isedit">{{
<span v-if="!scope.row.isedit ">{{
scope.row.material_out_name
}}</span>
<el-select v-else v-model="scope.row.material_out" filterable style="width: 100%">
<el-option v-for="item in materials" :key="item.id" :label="item.name" :value="item.id"></el-option>
<el-option v-for="item in materials" :key="item.id" :label="item.full_name" :value="item.id"></el-option>
</el-select>
</template>
</el-table-column>

View File

@ -50,7 +50,7 @@
</el-table-column>
<el-table-column label="输入/输出" min-width="120">
<template #default="scope">
<span>{{ scope.row.material_in_name }} / {{ scope.row.material_out_name }}</span>
<span>{{ scope.row.material_in_name }} -> {{ scope.row.material_out_name }}</span>
</template>
</el-table-column>
<el-table-column label="出材率" prop="out_rate" min-width="80"></el-table-column>
@ -103,8 +103,8 @@
</el-form-item>
<el-form-item label="主要输入" prop="material_in">
<el-select v-model="form.material_in" placeholder="物料" clearable style="width: 100%;">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id">
<span style="float: left">{{ item.name }}</span>
<el-option v-for="item in materialOptions" :key="item.id" :label="item.full_name" :value="item.id">
<span style="float: left">{{ item.full_name }}</span>
<span style="float: right;color: '#E6A23C';font-size: 13px;" v-if="item.is_hidden">{{
item.process_name }}-</span>
</el-option>
@ -112,8 +112,8 @@
</el-form-item>
<el-form-item label="主要输出" prop="material_out">
<el-select v-model="form.material_out" placeholder="物料" clearable style="width: 100%;">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id">
<span style="float: left">{{ item.name }}</span>
<el-option v-for="item in materialOptions" :key="item.id" :label="item.full_name" :value="item.id">
<span style="float: left">{{ item.full_name }}</span>
<span style="float: right;color: '#E6A23C';font-size: 13px;" v-if="item.is_hidden">{{
item.process_name }}-</span></el-option>
</el-select>
@ -181,7 +181,7 @@ export default {
getProducts() {
this.$API.mtm.material.list.req({ page: 0, need_route: true }).then(res => {
res.forEach(m => {
m.label = m.name+'—'+m.specification+'/'+m.model;
m.label = m.name+'|'+m.specification+'|'+m.model;
})
this.productOptions = res
})

View File

@ -7,10 +7,10 @@
<div class="user-info-top">
<el-avatar
:size="100"
:src="$store.state.global.baseLogo"
:src="form.base_logo"
shape="square"
></el-avatar>
<h3>{{ $store.state.global.baseName }}</h3>
<h3>{{ form.base_name }}</h3>
</div>
</el-header>
<el-main class="nopadding">
@ -63,6 +63,7 @@ export default {
},
data() {
return {
form: {},
menu: [
{
groupName: "系统配置",
@ -106,18 +107,16 @@ export default {
});
},
mounted() {
this.getBaseInfo();
this.getSysConfig();
},
methods: {
openPage(item) {
this.page = item.index;
},
getBaseInfo() {
this.$API.system.baseInfo.getInfo.req().then((res) => {
debugger;
console.log(res)
this.$TOOL.data.set("BASE_INFO", res)
getSysConfig() {
this.$API.system.config.getInfo.req().then(res=>{
this.form = res.base
})
},
},

View File

@ -36,25 +36,22 @@ export default {
apk_file:'',
apk_remark:'',
},
configInfo:null,
};
},
mounted(){
this.getBaseInfo()
this.getSysConfig();
},
methods:{
getBaseInfo() {
this.configInfo = this.$TOOL.data.get("BASE_INFO");
this.form = this.$TOOL.data.get("BASE_INFO").apk
getSysConfig() {
this.$API.system.config.getInfo.req().then(res=>{
this.form = res.apk
})
},
submitForm(){
this.saveLoading = true;
let obj = {}
this.configInfo.apk = this.form;
obj.apk = this.form;
this.$API.system.baseInfo.updateInfo.req(obj).then((res) => {
this.$message.success("保存成功")
this.$TOOL.data.set("BASE_INFO", this.configInfo)
this.$API.system.config.updateInfo.req(obj).then((res) => {
this.saveLoading = false;
}).catch(res=>{
this.saveLoading = false;

View File

@ -32,28 +32,24 @@ export default {
xn_secret:'',
},
saveLoading:false,
configInfo:null,
};
},
mounted() {
this.getBaseInfo();
this.getSysConfig();
},
methods: {
openPage(item) {
this.page = item.index;
},
getBaseInfo() {
this.configInfo = this.$TOOL.data.get("BASE_INFO");
this.form = this.$TOOL.data.get("BASE_INFO").sms
getSysConfig() {
this.$API.system.config.getInfo.req().then(res=>{
this.form = res.sms
})
},
submitForm(){
this.saveLoading = true;
let obj = {}
obj.sms = this.form;
this.configInfo.sms = this.form
this.$API.system.baseInfo.updateInfo.req(obj).then((res) => {
this.$API.system.config.updateInfo.req(this.form).then((res) => {
this.$message.success("保存成功")
this.$TOOL.data.set("BASE_INFO", this.configInfo)
this.saveLoading = false;
}).catch(res=>{
this.saveLoading = false;

View File

@ -48,29 +48,27 @@ export default {
base_name: "托克逊能源管理平台",
base_name_short: "托克逊能管"
},
configInfo:null,
};
},
mounted() {
this.getBaseInfo();
this.getSysConfig();
},
methods: {
openPage(item) {
this.page = item.index;
},
getBaseInfo() {
this.configInfo = this.$TOOL.data.get("BASE_INFO");
this.form = this.$TOOL.data.get("BASE_INFO").base
getSysConfig() {
this.$API.system.config.getInfo.req().then(res=>{
this.form = res.base
})
},
submitForm(){
this.saveLoading = true;
let obj = {}
this.configInfo.base = this.form;
obj.base = this.form;
this.$API.system.baseInfo.updateInfo.req(obj).then((res) => {
this.$API.system.config.updateInfo.req(obj).then((res) => {
this.$message.success("保存成功")
this.$TOOL.data.set("BASE_INFO", this.configInfo)
this.saveLoading = false;
}).catch(res=>{
this.saveLoading = false;

View File

@ -7,13 +7,13 @@
<el-input v-model="form.number" placeholder="任务编号" :disabled="mode == 'edit'" />
</el-form-item>
<el-form-item label="生产路线" prop="route" v-if="mode == 'add'">
<el-select placeholder="路线" v-model="currentRoute" value-key="id" style="width:100%" @change="routeChange">
<el-select placeholder="路线" v-model="currentRoute" value-key="id" style="width:100%" filterable @change="routeChange">
<el-option v-for="item in routeOptions" :key="item.id" :label="item.label" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="生产路线" prop="route" v-if="mode == 'edit'">
<span>{{ form.mgroup_name }}---<span v-if="form.material_">{{ form.material_.name }}</span></span>
<span>{{ form.material_in_name}}->{{ form.material_out_name }}</span>
</el-form-item>
<el-form-item label="任务数" prop="count">
<el-input-number style="width:100%" v-model="form.count" :min="1" controls-position="right"

View File

@ -7,13 +7,13 @@
<el-input v-model="form.number" placeholder="任务编号" :disabled="mode == 'edit'" />
</el-form-item>
<el-form-item label="产物" prop="material" v-if="mode == 'add'">
<el-select placeholder="产物" v-model="form.material" style="width:100%">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id">
<el-select placeholder="产物" v-model="form.material" filterable style="width:100%">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.full_name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="产物" prop="material" v-if="mode == 'edit'">
<span v-if="form.material_">{{ form.material_.name }}</span>
<span v-if="form.material_">{{ form.material_.full_name }}</span>
</el-form-item>
<el-form-item label="任务数" prop="count">
<el-input-number style="width:100%" v-model="form.count" :min="1" controls-position="right"

View File

@ -242,6 +242,11 @@
scope.row.material_.model
}}</template>
</el-table-column>
<el-table-column label="已到工序" prop="material">
<template #default="scope">{{
scope.row.material_.process_name
}}</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>
@ -252,7 +257,9 @@
</el-container>
</el-main>
<save-dialog v-if="dialogSave" ref="saveDialog" :mtask="currentMtask.id" :mgroup="mgroup"
:material_out="material_out" :brothersList="brothersList" :activeType="activeName" @success="handleSaveSuccess"
:material_out="material_out" :brothersList="brothersList"
:material_in="material_in"
:activeType="activeName" @success="handleSaveSuccess"
@closed="dialogSave = false"></save-dialog>
<showDrawer ref="showDrawer" v-if="visibleDrawer" :mlogId="mlogId" @closed="visibleDrawer = false">
</showDrawer>
@ -346,6 +353,7 @@ export default {
if (res.length == 1) {
this.currentDept = res[0]
this.paramsMtask.mgroup__belong_dept = this.currentDept.id
this.paramsMtask.state__in = '20,40'
this.apiMtask = this.$API.pm.mtask.list
this.paramsHandover.recive_dept = this.currentDept.id

View File

@ -7,13 +7,13 @@
<el-container>
<el-header>
<div class="left-panel">
<el-date-picker v-model="query.date" type="date" value-format="YYYY-MM-DD" />
<el-date-picker v-model="queryMtask.start_date" type="date" value-format="YYYY-MM-DD" />
<el-button type="primary" icon="el-icon-search" @click="handleQueryMtask">查询</el-button>
</div>
</el-header>
<el-main>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination
@row-click="rowClick" hideDo>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="paramsMtask" :query="queryMtask"
@row-click="rowClick">
<el-table-column type="index" width="50" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
@ -161,6 +161,11 @@
{{ scope.row.material_.model }}
</template>
</el-table-column>
<el-table-column label="已到工序" prop="material">
<template #default="scope">{{
scope.row.material_.process_name
}}</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>
@ -180,12 +185,7 @@ export default {
save: false,
},
apiObj: null,
query: {
page: 1,
page_size: 20,
belong_dept_name: '6车间',
date: '2023-10-24'
},
query: {},
processList: [],//
state_: {
10: '创建中',
@ -205,12 +205,18 @@ export default {
paramsWm: {
belong_dept__name: '6车间'
},
paramsMtask: {
mgroup__belong_dept__name: '6车间',
is_count_utask: true,
state__in: "20,40"
},
queryMtask: {}
}
},
mounted() {
let NowDate = new Date();
this.query.date = NowDate.getFullYear() + '-' + (NowDate.getMonth() + 1) + '-' + NowDate.getDate();
this.apiObj = this.$API.pm.mtask.daylist;
// this.queryMtask.start_date = NowDate.getFullYear() + '-' + (NowDate.getMonth() + 1) + '-' + NowDate.getDate();
this.apiObj = this.$API.pm.mtask.list;
},
methods: {
tomio() {
@ -239,13 +245,7 @@ export default {
});
},
handleQueryMtask() {
this.$refs.table.refresh();
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
this.$refs.table.refresh(this.queryMtask);
},
table_submit(row) {
this.$API.pm.mtask.submit.req(row.id).then(res => {

View File

@ -10,11 +10,8 @@
</template>
<el-descriptions>
<el-descriptions-item label="任务编号">{{ currentMtask.number }}</el-descriptions-item>
<el-descriptions-item label="产品名称">
<span v-if="currentMtask.material_out_">{{ currentMtask.material_out_.name }}</span>
</el-descriptions-item>
<el-descriptions-item label="规格型号">
<span v-if="currentMtask.material_out_">{{ currentMtask.material_out_.specification }}</span>
<el-descriptions-item label="产品全称">
<span v-if="currentMtask.material_out_">{{ currentMtask.material_out_name }}</span>
</el-descriptions-item>
<el-descriptions-item label="计划数量">{{ currentMtask.count }}</el-descriptions-item>
<el-descriptions-item label="计划日期">{{ currentMtask.start_date }}</el-descriptions-item>

View File

@ -241,6 +241,11 @@
scope.row.material_.model
}}</template>
</el-table-column>
<el-table-column label="已到工序" prop="material">
<template #default="scope">{{
scope.row.material_.process_name
}}</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>
@ -251,7 +256,7 @@
</el-container>
</el-main>
<save-dialog v-if="dialogSave" ref="saveDialog" :mtask="currentMtask.id" :mgroup="mgroup"
:material_out="material_out" :activeType="activeName" @success="handleSaveSuccess"
:material_out="material_out" :material_in="material_in" :activeType="activeName" @success="handleSaveSuccess"
@closed="dialogSave = false"></save-dialog>
<showDrawer ref="showDrawer" v-if="visibleDrawer" :mlogId="mlogId" @closed="visibleDrawer = false">
</showDrawer>
@ -352,6 +357,7 @@ export default {
if (res.length == 1) {
this.currentDept = res[0]
this.paramsMtask.mgroup__belong_dept = this.currentDept.id
this.paramsMtask.state__in = '20,40'
this.apiMtask = this.$API.pm.mtask.list
this.paramsHandover.recive_dept = this.currentDept.id

View File

@ -34,7 +34,7 @@
<el-button link type="primary" @click="table_edit(scope.row)" v-auth="'mlog.update'">
编辑
</el-button>
<el-button type="success" @click="table_submit(scope.row)" v-auth="'mlog.submit'">
<el-button link type="success" @click="table_submit(scope.row)" v-auth="'mlog.submit'">
提交
</el-button>
<el-button link type="danger" @click="table_del(scope.row)" v-auth="'mlog.delete'">
@ -129,6 +129,11 @@
scope.row.material_.model
}}</template>
</el-table-column>
<el-table-column label="已到工序" prop="material">
<template #default="scope">{{
scope.row.material_.process_name
}}</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>

View File

@ -35,21 +35,26 @@
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="生产路线" prop="material_out">
<el-form-item label="生产路线" v-if="mode == 'add'">
<el-select
v-model="form.material_out"
v-model="currentRoute"
placeholder="生产路线"
clearable
filterable
style="width: 100%"
@change="routeChange"
>
<el-option
v-for="item in routeOptions"
:key="item.material_out"
:key="item.id"
:label="item.label"
:value="item.material_out"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="生产路线" v-if="mode == 'edit'">
<span>{{ form.material_in_name}}->{{ form.material_out_name }}</span>
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="班次" prop="material">
@ -69,11 +74,11 @@
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="物料批次" width="100">
<el-form-item label="批次" width="100">
<el-input
v-model="form.batch"
tyle="width:100%"
placeholder="请输入批次"
placeholder="批次"
></el-input>
</el-form-item>
</el-col>
@ -165,21 +170,25 @@
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="生产路线" prop="material_out">
<el-form-item label="生产路线" v-if="mode == 'add'">
<el-select
v-model="form.material_out"
v-model="currentRoute"
placeholder="生产路线"
clearable
filterable
style="width: 100%"
@change="routeChange"
>
<el-option
v-for="item in routeOptions"
:key="item.id"
:label="item.label"
:value="item.id"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="生产路线" v-if="mode == 'edit'">
<span>{{ form.material_in_name}}->{{ form.material_out_name }}</span>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="合格数">
@ -208,11 +217,13 @@
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="物料批次" prop="material_in">
<el-form-item label="批次" prop="material_in">
<el-select
v-model="form.batch"
placeholder="物料批次"
placeholder="批次号"
filterable
clearable
allow-create
style="width: 100%"
>
<el-option
@ -457,7 +468,21 @@
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="批次号">
<el-input v-model="form.batch" placeholder="批次号"></el-input>
<el-select
v-model="form.batch"
placeholder="批次号"
clearable
filterable
allow-create
style="width: 100%"
>
<el-option
v-for="item in wMaterialOptions"
:key="item.batch"
:label="item.batch"
:value="item.batch"
></el-option>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="24">
@ -481,7 +506,7 @@
<el-form-item label="炉号">
<el-select
v-model="form.equipment"
placeholder="号"
placeholder="号"
clearable
style="width: 100%"
>
@ -849,10 +874,21 @@
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="批次号">
<el-input
<el-select
v-model="form.batch"
placeholder="请输入请输入批次号"
></el-input>
placeholder="批次号"
clearable
filterable
allow-create
style="width: 100%"
>
<el-option
v-for="item in wMaterialOptions"
:key="item.batch"
:label="item.batch"
:value="item.batch"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@ -860,7 +896,7 @@
<div v-if="brothersList.length > 0">
<el-row v-for="item in mlogb" :key="item">
<el-col :md="12" :sm="24">
<el-form-item label="产品名称" prop="material">
<el-form-item label="生产任务">
<el-select
v-model="item.material_out"
placeholder="产品名称"
@ -1041,6 +1077,7 @@ export default {
},
data() {
return {
currentRoute: "",
yseorno: ["是", "否"],
loading: false,
mode: "add",
@ -1092,19 +1129,22 @@ export default {
console.log('brothersList')
console.log(this.brothersList)
this.getMaterial();
this.getMgroupList();
// this.getMgroupList();
this.getUserList();
this.getEquipment();
this.getShiftOptions();
this.getRouteOptions();
this.getWorkShopMaterial();
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
this.form.material_out = this.material_out;
this.form.material_in = this.material_in;
this.form.mtask = this.mtask;
this.form.mgroup = this.mgroup;
this.form.handle_date = year + "-" + month + "-" + day;
this.getWorkShopMaterial();
if (this.activeType == "10车间") {
let mlogb = [];
this.brothersList.forEach((item) => {
@ -1122,6 +1162,12 @@ export default {
}
},
methods: {
routeChange(item) {
this.form.material = item.material_out
this.form.material_in = item.material_in
this.form.mgroup = item.mgroup
this.getWorkShopMaterial();
},
getRouteOptions() {
let mgroup__name = '';
if(this.activeType=='8车间'){
@ -1147,13 +1193,13 @@ export default {
this.shiftOptions = [];
if(this.activeType == "10车间"){
res.forEach(item=>{
if(item.rule=='倒'){
if(item.rule=='倒'){
this.shiftOptions.push(item);
}
})
}else{
res.forEach(item=>{
if(item.rule=='默认'){
if(item.rule=='长白班'){
this.form.shift = item.id;
}
})
@ -1174,15 +1220,6 @@ export default {
that.userList = res;
});
},
//
getBatchs() {
let that = this;
this.$API.wpm.wmaterial.batchs
.req({ belong_dept_name: "6车间" })
.then((res) => {
that.batchOptions = res;
});
},
//
getMgroupList() {
let that = this;
@ -1237,11 +1274,14 @@ export default {
// },
getWorkShopMaterial() {
let that = this;
this.$API.wpm.wmaterial.list
.req({ belong_dept__name: "8车间", page: 0 })
.then((res) => {
that.wMaterialOptions = res;
});
if(this.form.material_in){
this.$API.wpm.wmaterial.list
.req({ material: this.form.material_in, page: 0, count__gte: 1 })
.then((res) => {
that.wMaterialOptions = res;
});
}
},
//
open(mode = "add") {