This commit is contained in:
shijing 2023-10-13 08:55:15 +08:00
parent cd6b31bd51
commit 19d1a3a847
23 changed files with 1490 additions and 273 deletions

View File

@ -60,5 +60,67 @@ export default {
);
}
},
},
// 出入库记录
mio: {
list: {
name: "出入库记录列表",
req: async function(data){
return await http.get(
`${config.API_URL}/inm/mio/`,
data
);
}
},
do: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/inm/mio/do/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/inm/mio/${id}/`);
}
},
submit: {
name: "提交",
req: async function(data){
return await http.post(
`${config.API_URL}/inm/mio//${id}/submit/`,
data);
}
},
},
// 出入库明细
mioitem: {
list: {
name: "出入库明细列表",
req: async function(data){
return await http.get(
`${config.API_URL}/inm/mioitem/`,
data
);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/inm/mioitem/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/inm/mioitem/${id}/`);
}
},
}
}

View File

@ -280,4 +280,124 @@ export default {
}
},
},
// 工序
process: {
list: {
name: "工序列表",
req: async function(data){
return await http.get(
`${config.API_URL}/mtm/process/`,
data
);
}
},
item: {
name: "获取工序详情",
req: async function(id){
return await http.get(
`${config.API_URL}/mtm/process/${id}/`
);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/process/`,
data);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/mtm/process/${id}/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/mtm/process/${id}/`);
}
},
deletes: {
name: "批量删除",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/process/deletes/`,
data);
}
},
cquery: {
name: "复杂查询",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/process/cquery/`,
data);
}
},
},
//
route: {
list: {
name: "列表",
req: async function(data){
return await http.get(
`${config.API_URL}/mtm/route/`,
data
);
}
},
item: {
name: "获取详情",
req: async function(id){
return await http.get(
`${config.API_URL}/mtm/route/${id}/`
);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/route/`,
data);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/mtm/route/${id}/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/mtm/route/${id}/`);
}
},
deletes: {
name: "批量删除",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/route/deletes/`,
data);
}
},
cquery: {
name: "复杂查询",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/route/cquery/`,
data);
}
},
},
}

View File

@ -172,10 +172,9 @@ export default {
},
submit:{
name: "提交采购订单",
req: async function(data){
req: async function(id){
return await http.post(
`${config.API_URL}/pum/pu_plan/${id}/submit/`,
data);
`${config.API_URL}/pum/pu_plan/${id}/submit/`);
}
},
},

View File

@ -106,7 +106,7 @@ export default {
// 订单信息
order: {
list: {
name: "客户列表",
name: "订单列表",
req: async function(data){
return await http.get(
`${config.API_URL}/sam/order/`,
@ -152,6 +152,39 @@ export default {
return await http.delete(
`${config.API_URL}/sam/order/${id}/`);
}
}
},
submit: {
name: "提交",
req: async function(id){
return await http.post(
`${config.API_URL}/sam/order/${id}/submit/`);
}
},
},// 订单明细列
orderitem: {
list: {
name: "订单明细列表",
req: async function(data){
return await http.get(
`${config.API_URL}/sam/orderitem/`,
data
);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/sam/orderitem/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/sam/orderitem/${id}/`);
}
},
}
}

View File

@ -44,7 +44,7 @@ const DEFAULT_CONFIG = {
MENU_UNIQUE_OPENED: true,
//是否开启多标签
LAYOUT_TAGS: true,
LAYOUT_TAGS: false,
//语言
LANG: 'zh-cn',

View File

@ -768,16 +768,6 @@ const routes = [
},
"component": "inm/warehouse"
},
{
"name": "material",
"path": "/inm/material",
"meta": {
"title": "物料产品",
"icon": "el-icon-cellphone",
"perms": ["inm"]
},
"component": "ungrouped/material"
},
{
"name": "materialbatch",
"path": "/inm/materialbatch",
@ -788,6 +778,27 @@ const routes = [
},
"component": "inm/materialbatch"
},
{
"name": "fifo",
"path": "/inm/fifo",
"meta": {
"title": "出入库记录",
"icon": "el-icon-cellphone",
"perms": ["inm"]
},
"component": "inm/fifo"
},
{
"name": "material",
"path": "/inm/material",
"meta": {
"title": "物料产品",
"icon": "el-icon-cellphone",
"perms": ["inm"]
},
"component": "ungrouped/material"
},
]
},
//采购 pum
@ -843,7 +854,6 @@ const routes = [
},
"component": "pum/orderitem"
},
{
"name": "supplier",
"path": "/pum/supplier",
@ -864,7 +874,7 @@ const routes = [
"title": "销售管理",
"icon": "el-icon-grid",
"type": "menu",
"perms": ["em"]
"perms": ["sam"]
},
"children": [
{
@ -903,7 +913,8 @@ const routes = [
"meta": {
"title": "订单详情",
"icon": "el-icon-cellphone",
"perms": ["sam"]
"perms": ["sam"],
"hidden":true,
},
"component": "sam/orderitem"
},
@ -1750,7 +1761,7 @@ const routes = [
},
]
},
//数据看板
//曲阳驾驶舱
{
"path": "/bigScreen",
"name": "bigScreen",
@ -1762,7 +1773,7 @@ const routes = [
},
"component": "bigScreen"
},
//数据看板
//托克逊大屏
{
"path": "/bigScreen2",
"name": "bigScreen2",
@ -1774,17 +1785,17 @@ const routes = [
},
"component": "bigScreen/index_enm"
},
//数据看板
//光子大屏
{
"path": "/bigScreenP",
"name": "bigScreenP",
"meta": {
"title": "能管大屏",
"icon": "el-icon-position",
"perms": ["bigScreenPhoton"],
"perms": ["bigScreenP"],
"fullpage": true,
},
"component": "bigScreen/index_enm"
"component": "bigScreen/index_photon"
},
//首页
// {

View File

@ -0,0 +1,440 @@
<template>
<div class="dashboard">
<header>
<h1 class="title">光子科技大数据中心</h1>
<div>
<h2 class="title_right">时间: {{ updateTime }}</h2>
</div>
</header>
<div class="model">
<div id="loadingScreen">
<el-progress type="circle" :percentage="loadedPercent" :width=220 status="warning">
<template #default="{ percentage }">
<div style="font-size: 30px; color: white; font-weight: bold">{{ percentage }}%</div>
<div style="font-size: 18px; color: white; margin-top: 10px">工厂模型加载中</div>
</template>
</el-progress>
</div>
<canvas id="renderCanvas"></canvas>
</div>
</div>
</template>
<script>
import * as echarts from "echarts";
import * as BABYLON from "babylonjs"
import * as BABYLON_GUI from "babylonjs-gui"
import * as BABYLON_GRID from "@/utils/gridMaterial"
import * as BABYLON_MATERIAL from "@/utils/babylonMaterial"
import 'babylonjs-loaders';
import 'animate.css';
export default {
data() {
return {
query:{
year_s:2023,
month_s:8,
type:'month_s',
page:0
},
factoryData: {},
sectionData: {},
initialAlpha: -Math.PI / 1.2,
initialBeta: Math.PI / 2.5,
initialRadius: 15,
initialTarget: null,
scene: null,
myui: null,
is_mainviewpoint: false,
resizeTimeout: null,
engine: null,
loadedPercent: 0,
showKgcet: true,
currentLightMesh: null,
activeSection: 2,
activeSectionName: '回转窑',
updateTime: '2023-08-17 16:00:00',
basicOption: {
backgroundColor: '',
xAxis: {
data: ['一月', '二月', '三月', '四月', '五月', '六月'],
},
yAxis: { type: 'value'},
series: [
{
name: '销量',
type: 'bar',
barwidth:10,
label: {
show: true,
position: 'top'
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#83bff6' },
{ offset: 0.5, color: '#188df0' },
{ offset: 1, color: '#188df0' }
])
},
emphasis: {
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#2378f7' },
{ offset: 0.7, color: '#2378f7' },
{ offset: 1, color: '#83bff6' }
])
}
},
data: []
}
],
grid: { //
top: "10%",
left: "12%",
right: "0px",
bottom: "15%"
}
},
nowDay:1,
nowMonth:1,
nowYear:2023,
year_start:0,
end_time:'',
start_time:'',
xAxisData:[],
arrMonth:[],
chart1Option: {},
chart2Option: {},
chart3Option: {},
chart4Option: {},
chart5Option: {},
chart6Option: {},
seriesData1:[0,0,0,0,0,0],
seriesData2:[0,0,0,0,0,0],
seriesData3:[0,0,0,0,0,0],
seriesData3_2:[0,0,0,0,0,0],
seriesData4:[0,0,0,0,0,0],
seriesData5:[0,0,0,0,0,0],
seriesData6:[0,0,0,0,0,0],
path:"ws://49.232.14.174:2226/ws/my/?token=",
ws:null,
}
},
mounted() {
var that = this;
this.addListener();
let myDate = new Date();
let year = myDate.getFullYear();
let month = myDate.getMonth()+1;
let day = myDate.getDate();
that.nowDay = day;
that.nowMonth = that.query.month_s = month;
that.nowYear = that.query.year_s = year;
this.initDomStyle();
setTimeout(function () {
that.initFactory();
}, 1000);
let month1= month>9?month:'0'+month;
let end_time = year+'-'+month1+'-01 10:00:00';
let year_s=year;
if(month<6){
year_s = year-1;
}
let arr = [],xAxisData = [];
let monthItem = month;
for (let i = 0; i < 6; i++) {
arr.push(monthItem);
if(monthItem === 1) {
monthItem = 12;
} else {
monthItem--;
}
}
arr.reverse();
for(let i=0;i<6;i++){
let item = arr[i]+'日'
xAxisData.push(item);
}
let month0= arr[0]>9?arr[0]:'0'+arr[0];
let start_time = year_s+'-'+month0+'-01 10:00:00';
that.arrMonth = arr;
that.year_start = year_s;
that.xAxisData = xAxisData;
that.start_time = start_time;
that.end_time = end_time;
},
beforeUnmount() {
//
const canvas = document.getElementById('renderCanvas');
if (canvas) {
canvas.parentNode.removeChild(canvas);
}
},
methods: {
// Class
bindClass(type){
let classInfo = { socketDom: true, redColor: false,
orangeColor:false, yellowColor:false, blueColor:true }
if(type==''){
classInfo.redColor = true
}
return classInfo
},
compare(property) {
return function (a, b) {
return a[property] - b[property];
}
},
addListener() {
var that = this;
window.addEventListener('resize', function () {
// resizeTimeout
if (this.resizeTimeout) {
clearTimeout(this.resizeTimeout);
}
// resizeTimeout
this.resizeTimeout = setTimeout(function () {
that.initDomStyle()
}, 300); // 300
});
},
initDomStyle() {
//
var windowHeight = window.innerHeight;
var windowWidth = window.innerWidth;
var dashboard = document.getElementsByClassName('dashboard')[0];
var model = document.getElementsByClassName('model')[0];
if (windowWidth > 960) {
dashboard.style.overflow = 'hidden';
model.style.position = 'absolute';
model.style.height = (windowHeight - 3) + 'px';
model.style.top = 0
}else {
dashboard.style.overflow = 'auto';
var chartHeight = windowWidth * 0.6;
model.style.position = 'relative';
model.style.height = chartHeight;
}
if (this.engine != null) {
this.engine.resize();
}
},
resizeChart(name) {
// name resize chart
var myChart = echarts.getInstanceByDom(document.getElementById(name));
if (myChart != undefined) {
// console.log(name + ' :resize')
myChart.resize();
}
},
setChart(name, option = null) {
// name , optionoption
var myChart = echarts.getInstanceByDom(document.getElementById(name));
if (myChart == undefined) {
myChart = echarts.init(document.getElementById(name), 'dark', { renderer: 'svg' });
}
if (option == null) {
option = Object.assign({}, this.basicOption)
}
setTimeout(() => {
try {
myChart.setOption(option);
} catch (error) {}
}, 500)
},
initFactory() {
var that = this;
const canvas = document.getElementById("renderCanvas"); // Get the canvas element
const engine = new BABYLON.Engine(canvas, true); // Generate the BABYLON 3D engine
BABYLON.DefaultLoadingScreen.prototype.displayLoadingUI = function () {
}
BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function () {
document.getElementById("loadingScreen").style.display = "none";
}
engine.displayLoadingUI();
const createScene = function () {
const scene = new BABYLON.Scene(engine);
scene.clearColor = BABYLON.Color3.Black(); //BABYLON.Color3(1, 0, 1);
const ground = BABYLON.MeshBuilder.CreateGround("ground", { width: 50, height: 50 });
const groundMaterial = new BABYLON_GRID.GridMaterial("groundMaterial", scene);
groundMaterial.majorUnitFrequency = 5;
groundMaterial.minorUnitVisibility = 0.5;
groundMaterial.gridRatio = 2;
ground.material = groundMaterial;
ground.position.y = -0.1;
ground.rotation.z = 2*Math.PI;
//large ground
const largeGroundMat = new BABYLON.StandardMaterial("largeGroundMat");
largeGroundMat.diffuseTexture = new BABYLON.Texture("url to large ground texture");
const largeGround = BABYLON.MeshBuilder.CreateGroundFromHeightMap("largeGround", "https://assets.babylonjs.com/environments/villageheightmap.png", {width:50, height:50, subdivisions: 200, minHeight:0, maxHeight: 2});
largeGround.material = groundMaterial;
largeGround.position.y = -0.1;
//
// const backgroundImage = new BABYLON.Layer('', 'img/bj.png', scene, true);
const camera = new BABYLON.ArcRotateCamera("camera", that.initialAlpha, that.initialBeta, that.initialRadius, new BABYLON.Vector3(0, 0, 0));
that.initialTarget = camera.getTarget();
camera.lowerBetaLimit = Math.PI / 2.6; //
camera.upperBetaLimit = Math.PI / 2.1; //
camera.attachControl(canvas, true);
camera.maxZ = 200; //
//
camera.lowerRadiusLimit = 2;
camera.upperRadiusLimit = 4;
//
const light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(1, 1, 0));
light.intensity = 1.6;
// GUI
const advancedTexture = BABYLON_GUI.AdvancedDynamicTexture.CreateFullscreenUI("myUI");
that.myui = advancedTexture;
//
const highlightLayer = new BABYLON.HighlightLayer('highlightLayer', scene);
//
var control_main = new BABYLON_GUI.StackPanel();
control_main.isVertical = false
control_main.top = '-40%';
control_main.left = '-20%';
advancedTexture.addControl(control_main);
var button_main = BABYLON_GUI.Button.CreateSimpleButton("button_main", "主视角");
button_main.width = "80px"
button_main.height = "30px";
button_main.color = "white";
button_main.cornerRadius = 20;
button_main.background = "green";
// control_main.addControl(button_main)
button_main.onPointerClickObservable.add(() => {
if (camera.alpha != that.initialAlpha || camera.beta != that.initialBeta || camera.radius != that.initialRadius) {
var cameraPosition = new BABYLON.Vector3(
0 + that.initialRadius * Math.sin(that.initialBeta) * Math.cos(that.initialAlpha),
0 + that.initialRadius * Math.cos(that.initialBeta),
0 + that.initialRadius * Math.sin(that.initialBeta) * Math.sin(that.initialAlpha)
);
var ease = new BABYLON.CubicEase();
ease.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEINOUT);
BABYLON.Animation.CreateAndStartAnimation('at6', camera, 'position', 45, 200, camera.position, cameraPosition, 0, ease);
BABYLON.Animation.CreateAndStartAnimation('at61', camera, 'target', 45, 200, camera.target, that.initialTarget, 0, ease);
}
})
// mesh
const mesh_rect = new BABYLON_GUI.Rectangle('mesh_rect');
mesh_rect.width = "100px";
mesh_rect.height = "25px";
mesh_rect.background = 'orange';
mesh_rect.alpha = 0.6;
mesh_rect.isVisible = false;
advancedTexture.addControl(mesh_rect);
var mesh_name = new BABYLON_GUI.TextBlock('mesh_name');
mesh_name.text = "";
mesh_name.color = 'white';
mesh_name.fontSize = '14px';
mesh_rect.addControl(mesh_name);
var remoteGlbUrl = process.env.VUE_APP_BASEURL + "/media/model/photon.glb";
BABYLON.SceneLoader.Append(remoteGlbUrl, "", scene, function (scene) {
engine.hideLoadingUI()
},
function (evt) {
var loadedPercent = 0;
if (evt.lengthComputable) {
loadedPercent = parseInt(evt.loaded * 100 / evt.total);
} else {
var dlCount = evt.loaded / (1024 * 1024);
loadedPercent = Math.floor(dlCount * 100.0) / 100.0;
}
that.loadedPercent = loadedPercent;
})
return scene;
};
const scene = createScene(); //Call the createScene function
// scene.debugLayer.show()
// Register a render loop to repeatedly render the scene
engine.runRenderLoop(function () {
scene.render();
});
this.engine = engine;
this.scene = scene;
// Watch for browser/canvas resize events
window.addEventListener("resize", function () {
engine.resize();
});
},
handleSectionClick(val, index) {
let that = this;
},
getMgroupChartData(name){
},
},
}
</script>
<style scoped>
.dashboard {
background-color: black;
font-family: Inter, "-apple-system", BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "noto sans", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
header {
position: absolute;
z-index: 10;
height: 50px;
width: 100%;
/* 调整头部高度 */
/* background-image: url('/public/img/header.png'); */
/* 替换为实际的背景图片路径 */
background-size: cover;
background-position: center;
display: flex;
justify-content: space-between;
align-items: center;
}
.title {
flex: 1;
color: white;
font-size: 24px;
}
.title_right {
flex: 1;
font-size: 20px;
color: white;
text-align: right;
}
.model {
top: 0;
width: 100%;
}
#renderCanvas {
width: 100%;
height: 100%
}
#loadingScreen {
position: absolute;
width: 100%;
top: 260px;
color: white;
display: flex;
align-items: center;
justify-content: center;
font-size: 30px;
}
</style>

241
src/views/inm/fifo.vue Normal file
View File

@ -0,0 +1,241 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
>
新增出/入库
</el-button>
</div>
<div class="right-panel">
<el-input
v-model="query.search"
placeholder="名称"
clearable
style="margin-right: 5px;"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
>
<el-table-column type="index" width="50"/>
<el-table-column label="记录编号"></el-table-column>
<el-table-column label="操作人员">
</el-table-column>
<el-table-column label="出/入库时间">
</el-table-column>
<el-table-column label="出/入库类型">
</el-table-column>
<el-table-column label="创建时间" >
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150px">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'warehouse.update'"
>
查看
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'warehouse.delete'"
>
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<!-- 生产领料/生产入库 -->
<el-Dialog
:title="titleMap[mode]"
v-model="visible"
>
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
label-width="80px"
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="编号" prop="type">
<el-radio-group v-model="form.type">
<el-radio :label="10">准入</el-radio>
<el-radio :label="20">禁入</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="类型" prop="obj_cate">
<el-select
v-model="form.obj_cate"
style="width: 100%"
>
<el-option
v-for="item in cateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="执行人" prop="do_user">
<span style="display:flex">
<el-input readonly v-model="form.employee_name"></el-input>
<ehsEpSelect :multiple="false" @submit="getEmployee"/>
</span>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="所属车间" prop="dept">
<el-cascader
v-model="form.dept"
:options="deptOptions"
:props="groupsProps"
clearable
style="width: 100%"
>
</el-cascader>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button type="primary" :loading="isSaveing" @click="submit">
保存
</el-button>
<el-button @click="visible = false">取消</el-button>
</template>
</el-Dialog>
</template>
<script>
import saveDialog from "./warehouse_form.vue";
export default {
name: "rparty",
components: {
saveDialog,
},
data() {
return {
mode:'do_out',
titleMap:{
'do_out':'生产领料',
'sale_out':'销售发货',
'pur_in':'采购入库',
'do_in':'生产入库',
'other_in':'其他入库',
'other_out':'其他出库',
},
cateOptions:[
{id:'do_out',name:'生产领料'},
{id:'sale_out',name:'销售发货'},
{id:'pur_in',name:'采购入库'},
{id:'do_in',name:'生产入库'},
{id:'other_in',name:'其他入库'},
{id:'other_out',name:'其他出库'},
],
dialog: {
save: false,
},
query:{
search:''
},
form:{
},
visible:false,
apiObj: this.$API.inm.mio.list,
selection: [],
types_: {
1: "生产领料",
2: "销售提货",
3: "采购入库",
4: "生产入库",
5: "其他入库",
6: "其他出库",
},
rules: {
// do_user: [{required: true, message: "", trigger: "blur"}],
number: [{required: true, message: "请输入编号", trigger: "blur"}],
// belong_dept: [{required: true, message: "", trigger: "blur"}],
},
};
},
methods: {
//
add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
//
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.inm.warehouse.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
return res;
}).catch((err) => {
return err;
});
}).catch(() => {});
},
//
handleSaveSuccess(data, mode) {
if (mode == "add") {
this.$refs.table.refresh();
} else if (mode == "edit") {
this.$refs.table.refresh();
}
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
};
</script>

View File

@ -4,7 +4,7 @@
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
</div>
<div class="right-panel">
<!-- <div class="right-panel">
<el-date-picker
v-model="query.date"
type="daterange"
@ -18,206 +18,221 @@
@click="handleQuery"
>查询</el-button>
</div>
</div> -->
</el-header>
<el-main style="background:#ffffff;padding:20px">
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="主要原料" name="first">
<el-tab-pane label="主要原料" name="主要原料">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
:params="query3"
>
<el-table-column type="index" width="50"/>
<el-table-column label="物料编号" prop="number">
</el-table-column>
<el-table-column label="物料类别" prop="material" show-overflow-tooltip>
<el-table-column label="物料类别" prop="type">
<template #default="scope">
<span><el-tag type="primary">{{typeOptions[scope.row.type]}}</el-tag></span>
</template>
</el-table-column>
<el-table-column label="物料名称" prop="number">
<el-table-column label="物料名称" prop="name">
</el-table-column>
<el-table-column label="规格型号" prop="number">
<el-table-column label="规格型号" prop="specification">
</el-table-column>
<el-table-column label="计量单位" prop="count">
<el-table-column label="计量单位" prop="unit">
</el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="120">
<el-table-column label="操作" fixed="right" align="center" width="100">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'equipment.delete'"
>
删除
</el-link>
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'material.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'material.delete'"
>
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane label="辅助材料" name="second">
<el-tab-pane label="辅助材料" name="辅助材料">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
:params="query4"
>
<el-table-column type="index" width="50"/>
<el-table-column label="物料编号" prop="number">
</el-table-column>
<el-table-column label="物料类别" prop="material" show-overflow-tooltip>
<el-table-column label="物料类别" prop="type">
<template #default="scope">
<span><el-tag type="primary">{{typeOptions[scope.row.type]}}</el-tag></span>
</template>
</el-table-column>
<el-table-column label="物料名称" prop="number">
<el-table-column label="物料名称" prop="name">
</el-table-column>
<el-table-column label="规格型号" prop="number">
<el-table-column label="规格型号" prop="specification">
</el-table-column>
<el-table-column label="计量单位" prop="count">
<el-table-column label="计量单位" prop="unit">
</el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="120">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'equipment.delete'"
>
删除
</el-link>
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'material.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'material.delete'"
>
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane label="加工工具" name="third">
<el-tab-pane label="加工工具" name="加工工具">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
:params="query5"
>
<el-table-column type="index" width="50"/>
<el-table-column label="物料编号" prop="number">
</el-table-column>
<el-table-column label="物料类别" prop="material" show-overflow-tooltip>
<el-table-column label="物料类别" prop="type">
<template #default="scope">
<span><el-tag type="primary">{{typeOptions[scope.row.type]}}</el-tag></span>
</template>
</el-table-column>
<el-table-column label="物料名称" prop="number">
<el-table-column label="物料名称" prop="name">
</el-table-column>
<el-table-column label="规格型号" prop="number">
<el-table-column label="规格型号" prop="specification">
</el-table-column>
<el-table-column label="计量单位" prop="count">
<el-table-column label="计量单位" prop="unit">
</el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="120">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'equipment.delete'"
>
删除
</el-link>
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'material.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'material.delete'"
>
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane label="辅助工装" name="fourth">
<el-tab-pane label="辅助工装" name="辅助工装">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
:params="query6"
>
<el-table-column type="index" width="50"/>
<el-table-column label="物料编号" prop="number">
</el-table-column>
<el-table-column label="物料类别" prop="material" show-overflow-tooltip>
<el-table-column label="物料类别" prop="type">
<template #default="scope">
<span><el-tag type="primary">{{typeOptions[scope.row.type]}}</el-tag></span>
</template>
</el-table-column>
<el-table-column label="物料名称" prop="number">
<el-table-column label="物料名称" prop="name">
</el-table-column>
<el-table-column label="规格型号" prop="number">
<el-table-column label="规格型号" prop="specification">
</el-table-column>
<el-table-column label="计量单位" prop="count">
<el-table-column label="计量单位" prop="unit">
</el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="120">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'equipment.delete'"
>
删除
</el-link>
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'material.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'material.delete'"
>
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane label="办公工具" name="fifth">
<el-tab-pane label="办公工具" name="办公用品">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
:params="query7"
>
<el-table-column type="index" width="50"/>
<el-table-column label="物料编号" prop="number">
</el-table-column>
<el-table-column label="物料类别" prop="material" show-overflow-tooltip>
<el-table-column label="物料类别" prop="type">
<template #default="scope">
<span><el-tag type="primary">{{typeOptions[scope.row.type]}}</el-tag></span>
</template>
</el-table-column>
<el-table-column label="物料名称" prop="number">
<el-table-column label="物料名称" prop="name">
</el-table-column>
<el-table-column label="规格型号" prop="number">
<el-table-column label="规格型号" prop="specification">
</el-table-column>
<el-table-column label="计量单位" prop="count">
<el-table-column label="计量单位" prop="unit">
</el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="120">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'equipment.delete'"
>
删除
</el-link>
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'material.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'material.delete'"
>
删除
</el-link>
</template>
</el-table-column>
</scTable>
@ -231,8 +246,8 @@
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
</template>
<script>
</template>
<script>
import saveDialog from "./materials_form.vue";
export default {
name: "rparty",
@ -244,20 +259,50 @@
dialog: {
save: false,
},
apiObj: this.$API.pm.mtask.list,
query: {
apiObj: this.$API.mtm.material.list,
query3: {
page:1,
page_size:20,
date:''
type:30
},
activeName:'first',
query4: {
page:1,
page_size:20,
type:40
},
query5: {
page:1,
page_size:20,
type:50
},
query6: {
page:1,
page_size:20,
type:60
},
query7: {
page:1,
page_size:20,
type:70
},
activeName:'主要原料',
selection: [],
state_: {
10: '完好',
20: '限用',
30: '在修',
40: '禁用',
},
10: '完好',
20: '限用',
30: '在修',
40: '禁用',
},
typeOptions:{
0:'电/水/气',
10:'成品',
20:'半成品',
30:'主要原料',
40:'辅助材料',
50:'加工工具',
60:'辅助工装',
70:'办公用品',
},
};
},
methods: {

View File

@ -47,7 +47,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<!-- <el-col :md="12" :sm="24">
<el-form-item label="计量单位" prop="unit">
<el-select
v-model="form.unit"
@ -63,7 +63,7 @@
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-col> -->
</el-row>
</el-form>
</el-main>
@ -93,7 +93,16 @@ export default {
},
visible: false,
isSaveing: false,
options: [],
options: [
{id:0,name:'电/水/气'},
{id:10,name:'成品'},
{id:20,name:'半成品'},
{id:30,name:'主要原料'},
{id:40,name:'辅助材料'},
{id:50,name:'加工工具'},
{id:60,name:'辅助工装'},
{id:70,name:'办公用品'},
],
selectionFilters: [],
setFiltersVisible: false,
};
@ -115,9 +124,9 @@ export default {
try {
var res;
if (this.mode == "add") {
res = await this.$API.pm.mtask.create.req(this.form);
res = await this.$API.mtm.material.create.req(this.form);
} else if (this.mode == "edit") {
res = await this.$API.pm.mtask.update.req(this.form.id,this.form);
res = await this.$API.mtm.material.update.req(this.form.id,this.form);
}
this.isSaveing = false;
this.$emit("success", this.form, this.mode);

View File

@ -13,13 +13,9 @@
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange">
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="名称" prop="name" min-width="100"></el-table-column>
<el-table-column label="编号" prop="code" min-width="100"></el-table-column>
<el-table-column label="类型" prop="type" min-width="150">
<template #default="scope">
<span>{{ types_[scope.row.type] }}</span>
</template>
</el-table-column>
<el-table-column label="车间" prop="sort" min-width="60"></el-table-column>
<!-- <el-table-column label="编号" prop="code" min-width="100"></el-table-column> -->
<el-table-column label="大类" prop="cate" min-width="150"></el-table-column>
<el-table-column label="车间" prop="belong_dept_name" min-width="60"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="140">
<template #default="scope">
<el-button link size="small" @click="table_edit(scope.row)" v-auth="'material.update'" type="primary">编辑</el-button>
@ -50,7 +46,7 @@ import saveDialog from "./process_form.vue";
},
data() {
return {
apiObj: this.$API.mtm.material.list,
apiObj: this.$API.mtm.process.list,
search: {
keyword: null
},

View File

@ -19,34 +19,33 @@
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" clearable></el-input>
</el-form-item>
<el-form-item label="编号">
<!-- <el-form-item label="编号">
<el-input v-model="form.code" clearable></el-input>
</el-form-item>
<el-form-item label="">
</el-form-item> -->
<el-form-item label="类">
<el-select
v-model="form.type"
placeholder=""
v-model="form.cate"
placeholder="类"
clearable
style="width: 100%;"
>
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="车间">
<el-select
v-model="form.testitems"
placeholder="车间"
clearable
multiple
style="width: 100%;"
>
<el-option
v-for="item in options"
:key="item"
:label="item"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属部门">
<el-select
v-model="form.belong_dept"
placeholder="所属部门"
clearable
style="width: 100%;"
>
<el-option
v-for="item in deptOptions"
:key="item.id"
:label="item.name"
:value="item.id"
@ -69,8 +68,6 @@
name: "",
code: "",
type: "",
// sort:1,
testitems: [],
};
export default {
emits: ["success", "closed"],
@ -88,29 +85,29 @@
//
rules: {
name: [{required: true, message: "请输入名称", trigger: "blur"}],
},
},
visible: false,
isSaveing: false,
options:[],
typeOptions:[
{label:'电/水/气',value:0},
{label:'成品',value:10},
{label:'半成品',value:20},
{label:'主要原料',value:30},
{label:'辅助材料',value:40},
{label:'加工工具',value:50},
{label:'辅助工装',value:60},
],
options:['混料','成型','退火','粗加工'],
deptOptions:[],
setFiltersVisible: false,
};
},
mounted() {
this.getTestItem();//
this.getDepts();//
},
methods: {
getTestItem(){
this.$API.qm.getTestItem.get({page:0}).then(res=>{
this.options = res;
getDepts(){
this.$API.system.dept.list.req({page:0}).then(res=>{
debugger;
console.log(res)
let data = [];
res.forEach(item => {
if(item.parent=='3423856735881117696'){
data.push(item)
}
});
this.deptOptions = data;
});
},
//
@ -130,7 +127,7 @@
if (valid) {
that.isSaveing = true;
if(that.mode==='add'){
that.$API.mtm.material.create.req(that.form).then(res=>{
that.$API.mtm.process.create.req(that.form).then(res=>{
that.isSaveing = false;
that.$emit("success", that.form, that.mode);
that.visible = false;
@ -139,7 +136,7 @@
that.isSaveing = false;
})
}else{
res = that.$API.mtm.material.update.req(that.form.id,that.form).then(res=>{
that.$API.mtm.process.update.req(that.form.id,that.form).then(res=>{
that.isSaveing = false;
that.$emit("success", that.form, that.mode);
that.visible = false;

View File

@ -40,9 +40,6 @@
</el-table-column>
<el-table-column label="提交时间" prop="submit_time">
</el-table-column>
<el-table-column label="备注">
<template #default="scope">{{ scope.row.description }}</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-link
@ -103,8 +100,7 @@
apiObj: this.$API.pum.order.list,
query: {
page:1,
page_size:20,
type:10
page_size:20
},
selection: [],
stateOption: {
@ -135,9 +131,11 @@
table_detail(row) {
this.$nextTick(() => {
this.$router.push({
name: "orderitem"
});
name: "orderitem",
query:{
pu_order:row.id
}
});
});
},
table_submit(){

View File

@ -15,7 +15,8 @@
></el-button>
</div>
<div class="right-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
<el-button type="primary" icon="el-icon-plus" @click="addLinkPlanItem" v-auth="'pu_orderitem.create'">关联采购订单</el-button>
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_orderitem.create'"></el-button>
</div>
</el-header>
<el-main class="nopadding">
@ -65,28 +66,38 @@
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:puOrder="puOrder"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<plan-dialog
v-if="dialog.plan"
ref="planDialog"
:puOrder="puOrder"
@success="handlePlanSuccess"
@closed="dialog.plan = false"
></plan-dialog>
</template>
<script>
import saveDialog from "./orderitem_form.vue";
import planDialog from "./orderitemplan.vue";
export default {
name: "rparty",
components: {
saveDialog,
saveDialog,planDialog
},
data() {
return {
dialog: {
save: false,
splan: false,
},
apiObj: this.$API.pum.orderitem.list,
query: {
page:1,
page_size:20,
type:10
page_size:20
},
puOrder:'',
selection: [],
state_: {
10: '完好',
@ -96,6 +107,9 @@ export default {
},
};
},
mounted(){
this.puOrder = this.$route.query.pu_order;
},
methods: {
//
add() {
@ -104,6 +118,18 @@ export default {
this.$refs.saveDialog.open("add");
});
},
addLinkPlanItem(row){
this.dialog.plan = true;
this.$nextTick(() => {
this.$refs.planDialog.open();
});
// this.$router.push({
// name: "orderitemplan",
// query:{
// pu_order:this.puOrder
// }
// });
},
//
table_edit(row) {
this.dialog.save = true;
@ -139,6 +165,10 @@ export default {
this.$refs.table.refresh();
}
},
handlePlanSuccess(){
this.dialog.plan = true;
this.$refs.table.refresh();
},
handleQuery() {
this.$refs.table.queryData(this.query)
},

View File

@ -12,7 +12,7 @@
ref="dialogForm"
:model="form"
:rules="rules"
label-width="110px"
label-width="100px"
>
<el-row>
<el-col :md="12" :sm="24">
@ -50,6 +50,9 @@
<script>
export default {
emits: ["success", "closed"],
props:{
puOrder: { type: String, default: '' },
},
data() {
return {
loading: false,
@ -91,6 +94,7 @@ export default {
this.isSaveing = true;
try {
var res;
this.form.pu_order = this.puOrder;
if (this.mode == "add") {
res = await this.$API.pum.orderitem.create.req(this.form);
} else if (this.mode == "edit") {

View File

@ -0,0 +1,178 @@
<template>
<el-dialog
title="计划明细变更采购订单明细"
v-model="visible"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<el-container>
<el-aside width="45%">
<el-container>
<el-header>
<div class="left-panel">
<div style="margin-right: 20px">计划列表</div>
<!-- <el-button
type="primary"
icon="el-icon-search"
></el-button> -->
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:data="tableData"
row-key="id"
stripe
hideDo="false"
:params="query"
highlightCurrentRow
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" />
<el-table-column label="物料" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span>
</template>
</el-table-column>
<el-table-column label="数量" prop="need_count"></el-table-column>
<el-table-column label="需求日期" prop="need_date"></el-table-column>
<el-table-column label="采购计划" prop="采购计划"></el-table-column>
</scTable>
</el-main>
</el-container>
</el-aside>
<el-container>
<el-header>
<div class="left-panel">
<div style="margin-right: 20px">已选计划</div>
<!-- <el-button
type="primary"
@click="createOrderItem"
v-auth="'post.update'"
>生成订单</el-button> -->
</div>
</el-header>
<el-main class="nopadding">
<el-table
ref="table2"
:data="selectData"
stripe
>
<el-table-column label="" type="index"></el-table-column>
<el-table-column label="物料" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_"> {{ scope.row.material_.name }}</span>
</template>
</el-table-column>
<el-table-column label="数量" prop="need_count"></el-table-column>
<el-table-column label="需求日期" prop="need_date"></el-table-column>
<el-table-column label="采购计划" prop="采购计划"></el-table-column>
<el-table-column label="操作" fixed="right" align="center">
<template #default="scope">
<el-button
type="primary"
link
size="small"
@click.stop="table_del(index,scope.row)"
v-auth="'post.update'"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-main>
</el-container>
</el-container>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="createOrderItem">生成订单</el-button>
<el-button @click="clearSelect">清空选择</el-button>
</el-footer>
</el-dialog>
</template>
<script>
export default {
emits: ["success", "closed"],
name: "orderitemplan",
props:{
puPlan: { type: String, default: '' },
},
data() {
return {
query: {
pu_plan__state__in:'20,30',
page:0
},
selectData:[],
tableData:[],
visible: false,
isSaveing: false,
setFiltersVisible: false,
};
},
mounted(){
this.getList();
},
methods: {
//
open() {
this.visible = true;
return this;
},
getList(){
this.$API.pum.planitem.list.req(this.query).then(res=>{
let data = res.filters(item=>{
return item.pu_plan==null;
})
this.tableData = data;
})
},
createOrderItem(){
let obj = {};
let pu_planitems = [];
obj.pu_order = this.pu_order;
this.selectData.forEach(item => {
pu_planitems.push(item.id)
});
obj.pu_planitems = pu_planitems;
this.$API.pum.orderitem.addplanitems.req(obj).then(res=>{
debugger;
console.log(res)
this.$emit("success");
})
},
clearSelect(){
this.selectData = [];
this.$refs.table.clearSelection();
},
handleSelectionChange(val){
this.selectData = val;
},
table_del(index,row) {
this.$API.system.post.delete.req(row.id).then(res=>{
this.$refs.table.refresh()
})
},
//
handleSaveSuccess(data, mode) {
//
// if (mode == "add") {
// this.$refs.table.unshiftRow(data);
// } else if (mode == "edit") {
// this.$refs.table.updateKey(data);
// }
//
this.$refs.table.refresh()
},
closed() {
this.visible = false;
},
},
};
</script>
<style>
</style>

View File

@ -43,32 +43,29 @@
<el-link
type="primary"
@click="table_detail(scope.row)"
>
详情
>详情
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_plan.update'"
>
编辑
>编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="primary"
@click="table_submit(scope.row)"
v-auth="'pu_plan.update'"
>
提交
:disabled="scope.row.state!==10"
>提交
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_plan.delete'"
>
删除
>删除
</el-link>
</template>
</el-table-column>
@ -122,7 +119,8 @@ import saveDialog from "./plan_form.vue";
table_detail(row) {
this.$nextTick(() => {
this.$router.push({
name: "planitem"
name: "planitem",
query:{pu_plan:row.id}
});
});
@ -135,10 +133,13 @@ import saveDialog from "./plan_form.vue";
});
},
//
table_submit(row) {
// this.$nextTick(() => {
// this.$refs.saveDialog.open("show").setData(row);
// });
table_submit(row){
console.log(row.id)
this.$API.pum.plan.submit.req(row.id).then((res) => {
console.log(res);
debugger;
this.$message.success("提交成功");
});
},
//
table_del(row) {

View File

@ -15,7 +15,7 @@
></el-button>
</div>
<div class="right-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
<el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add"></el-button>
</div>
</el-header>
<el-main class="nopadding">
@ -44,12 +44,12 @@
</el-table-column>
<el-table-column label="备注" prop="note" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" fixed="right" align="left">
<el-table-column label="操作" fixed="right" align="center" width="100px">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment.update'"
v-auth="'pu_planitem.update'"
>
编辑
</el-link>
@ -57,7 +57,7 @@
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'equipment.delete'"
v-auth="'pu_planitem.delete'"
>
删除
</el-link>
@ -69,6 +69,7 @@
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:puPlan="puPlan"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
@ -85,14 +86,17 @@
dialog: {
save: false,
},
puPlan:'',
apiObj: this.$API.pum.planitem.list,
query: {
page:1,
page_size:20,
type:10
page_size:20
},
};
},
mounted(){
this.puPlan = this.$route.query.pu_plan;
},
methods: {
//
add() {
@ -139,8 +143,8 @@
}
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},

View File

@ -67,6 +67,9 @@
<script>
export default {
emits: ["success", "closed"],
props:{
puPlan: { type: String, default: '' },
},
data() {
return {
loading: false,
@ -110,6 +113,7 @@
this.isSaveing = true;
try {
var res;
this.form.pu_plan = this.puPlan;
if (this.mode == "add") {
res = await this.$API.pum.planitem.create.req(this.form);
} else if (this.mode == "edit") {

View File

@ -15,7 +15,7 @@
></el-button>
</div>
<div class="right-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'order.delete'"></el-button>
</div>
</el-header>
<el-main class="nopadding">
@ -47,12 +47,29 @@
<el-table-column label="备注">
<template #default="scope">{{ scope.row.description }}</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="120">
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-link
type="primary"
@click="table_detail(scope.row)"
v-auth="'order.update'"
>
详情
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="primary"
@click="table_submit(scope.row)"
v-auth="'order.update'"
:disabled="scope.row.state!==10"
>
提交
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment.update'"
v-auth="'order.update'"
>
编辑
</el-link>
@ -60,7 +77,7 @@
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'equipment.delete'"
v-auth="'order.delete'"
>
删除
</el-link>
@ -88,11 +105,10 @@
dialog: {
save: false,
},
apiObj: this.$API.pum.order.list,
apiObj: this.$API.sam.order.list,
query: {
page:1,
page_size:20,
type:10
page_size:20
},
selection: [],
stateOption: {
@ -118,19 +134,28 @@
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
table_submit(row){
this.$API.sam.order.submit.req(row.id).then((res) => {
this.$message.success("提交成功");
return res;
}).catch((err) => {
return err;
});
},
//
table_detail(row) {
this.$router.push({
name: "samOrderitem",
query:{order:row.id}
});
},
//
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.pum.order.delete.req(row.id).then((res) => {
this.$API.sam.order.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
return res;
}).catch((err) => {

View File

@ -35,13 +35,13 @@
<el-col :md="12" :sm="24">
<el-form-item label="客户" prop="customer">
<el-select
v-model="form.customerOptions"
v-model="form.customer"
placeholder="客户"
clearable
style="width:100%"
>
<el-option
v-for="item in options"
v-for="item in customerOptions"
:key="item.id"
:label="item.name"
:value="item.id"
@ -49,18 +49,6 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="提交时间">
<el-date-picker
v-model="form.submit_time"
type="datetime"
placeholder="提交时间"
value-format="YYYY-MM-DD HH:mm:ss"
style="width:100%"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="所属合同">
<el-select
@ -108,13 +96,14 @@ export default {
},
visible: false,
isSaveing: false,
options: [],
customerOptions: [],
contractOptions: [],
setFiltersVisible: false,
};
},
mounted() {
this.getCustomerOptions();
this.getContractOptions();
},
methods: {
//
@ -123,6 +112,18 @@ export default {
this.visible = true;
return this;
},
getCustomerOptions(){
this.$API.sam.customer.list.req({page:0}).then(res=>{
console.log(res)
this.customerOptions = res;
})
},
getContractOptions(){
this.$API.sam.contract.list.req({page:0}).then(res=>{
console.log(res)
this.contractOptions = res;
})
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {

View File

@ -18,6 +18,11 @@
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
</div>
</el-header>
<el-card>订单信息
<div>订单编号</div>
<div>订单状态</div>
<div>客户</div>
</el-card>
<el-main class="nopadding">
<scTable
ref="table"
@ -48,7 +53,7 @@
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'equipment.update'"
v-auth="'order.update'"
>
编辑
</el-link>
@ -56,7 +61,7 @@
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'equipment.delete'"
v-auth="'order.delete'"
>
删除
</el-link>
@ -68,6 +73,7 @@
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:orderId="orderId"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
@ -84,12 +90,12 @@ export default {
dialog: {
save: false,
},
apiObj: this.$API.pum.orderitem.list,
apiObj: this.$API.sam.orderitem.list,
query: {
page:1,
page_size:20,
type:10
page_size:20
},
orderId:'',
selection: [],
state_: {
10: '完好',
@ -99,6 +105,10 @@ export default {
},
};
},
mounted(){
this.orderId = this.$route.query.order;
console.log(this.orderId)
},
methods: {
//
add() {
@ -126,7 +136,7 @@ export default {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.inm.warehouse.delete.req(row.id).then((res) => {
this.$API.sam.orderitem.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
return res;
}).catch((err) => {

View File

@ -18,7 +18,7 @@
<el-col :md="12" :sm="24">
<el-form-item label="所需产品" prop="material">
<el-select
v-model="form.product"
v-model="form.material"
placeholder="所需产品"
clearable
style="width:100%"
@ -33,8 +33,8 @@
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="所需数量" prop="place">
<el-input-number v-model="form.count" :precision="0" :min="0" controls-position="right" placeholder="所需数量" style="width:100%"/>
<el-form-item label="所需数量">
<el-input-number v-model="form.count" :precision="0" :min="1" controls-position="right" placeholder="所需数量" style="width:100%"/>
</el-form-item>
</el-col>
</el-row>
@ -50,6 +50,9 @@
<script>
export default {
emits: ["success", "closed"],
props:{
orderId: { type: String, default: '' },
},
data() {
return {
loading: false,
@ -61,8 +64,7 @@ export default {
},
form: {},
rules: {
order: [{required: true, message: "请选择关联订单", trigger: "blur"}],
product: [{required: true, message: "请选择所需产品", trigger: "blur"}],
material: [{required: true, message: "请选择所需产品", trigger: "blur"}],
},
visible: false,
isSaveing: false,
@ -71,6 +73,7 @@ export default {
};
},
mounted() {
this.getList();
},
methods: {
//
@ -79,11 +82,17 @@ export default {
this.visible = true;
return this;
},
getList(){
this.$API.mtm.material.list.req({page:0}).then(res=>{
this.options = res;
})
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
this.form.order = this.orderId;
try {
var res;
if (this.mode == "add") {