rev:接口联调
This commit is contained in:
@@ -754,7 +754,7 @@ export default {
|
||||
var orders = []
|
||||
console.log(rows)
|
||||
rows.forEach((item) => {
|
||||
orders.push(item.workprocedure_id)
|
||||
orders.push(item.workorder_id)
|
||||
})
|
||||
crudProduceshiftorder.submits(orders).then(res => {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
|
||||
@@ -1,320 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="物料检测方案设置"
|
||||
append-to-body
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
fullscreen
|
||||
destroy-on-close
|
||||
:before-close="crud.cancelCU"
|
||||
@open="open"
|
||||
>
|
||||
<el-form :inline="true" :model="form" class="demo-form-inline">
|
||||
|
||||
<el-form-item label="物料" prop="material_name">
|
||||
<el-input
|
||||
v-model="form.material_name"
|
||||
style="width: 280px;"
|
||||
placeholder="请选择物料"
|
||||
clearable
|
||||
prefix-icon="el-icon-search"
|
||||
@focus="materShow=true"
|
||||
@clear="form.material_id=''"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="物料" prop="material_id">
|
||||
<el-input v-model.trim="form.material_id" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="方案名称">
|
||||
<el-select
|
||||
v-model="form.inspection_scheme_id"
|
||||
filterable
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="方案名称"
|
||||
class="filter-item"
|
||||
@change="handDtl"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in selectList"
|
||||
:label="item.inspection_scheme_name"
|
||||
:value="item.inspection_scheme_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-check" type="success" @click="onSubmit">保存</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-error" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
:data="form.tableData"
|
||||
border
|
||||
size="mini"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
v-if="false"
|
||||
prop="inspection_item_id"
|
||||
label="项点标识"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="order_index"
|
||||
width="60"
|
||||
label="序号"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="inspection_item_code"
|
||||
label="项点编码"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_name"
|
||||
show-overflow-tooltip
|
||||
label="项点名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_type_name"
|
||||
label="项点类别"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="workprocedure_name"
|
||||
label="工序名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_type_name"
|
||||
label="检测方式"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="down_limit"
|
||||
label="合格下限(≥)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].down_limit"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="up_limit"
|
||||
label="合格上限(≤)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].up_limit"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="down_limit_value"
|
||||
label="下限临界值(≤)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].down_limit_value"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="up_limit_value"
|
||||
label="上限临界值(≥)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].up_limit_value"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
label="备注"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model.trim="form.tableData[scope.$index].remark" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||
</span>-->
|
||||
</el-dialog>
|
||||
|
||||
<MaterDtl
|
||||
:dialog-show.sync="materShow"
|
||||
:is-single="true"
|
||||
:mater-opt-code="'00'"
|
||||
@tableChanged2="tableChanged2"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import {} from '@/views/wms/ql/materialInspection/materialInspection'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import crudProductStandard from '@/api/wms/basedata/ql/productStandard'
|
||||
|
||||
const defaultForm = {
|
||||
material_id: '',
|
||||
material_code: '',
|
||||
material_name: '',
|
||||
inspection_scheme_id: '',
|
||||
tableData: []
|
||||
}
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { MaterDtl },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
data() {
|
||||
return {
|
||||
selectList: [],
|
||||
materShow: false,
|
||||
dialogVisible: false,
|
||||
inspectionItemType: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudInspectionSchemeMst.selectList().then(res => {
|
||||
this.selectList = res
|
||||
})
|
||||
this.handDtl2()
|
||||
},
|
||||
handDtl2() { // 修改的时候有物料标识
|
||||
const param = {
|
||||
inspection_scheme_id: this.form.inspection_scheme_id,
|
||||
material_id: this.form.material_id
|
||||
}
|
||||
crudProductStandard.getInspectionSchemeDtl(param).then(res => {
|
||||
const map1 = res.map(function(item) {
|
||||
if (!item.down_limit_value) item.down_limit_value = undefined
|
||||
if (!item.up_limit_value) item.up_limit_value = undefined
|
||||
if (!item.down_limit) item.down_limit = undefined
|
||||
if (!item.up_limit) item.up_limit = undefined
|
||||
return item
|
||||
})
|
||||
this.form.tableData = map1
|
||||
})
|
||||
},
|
||||
handDtl() {
|
||||
const param = {
|
||||
inspection_scheme_id: this.form.inspection_scheme_id
|
||||
}
|
||||
crudProductStandard.getInspectionSchemeDtl(param).then(res => {
|
||||
const map1 = res.map(function(item) {
|
||||
if (!item.down_limit_value) item.down_limit_value = undefined
|
||||
if (!item.up_limit_value) item.up_limit_value = undefined
|
||||
if (!item.down_limit) item.down_limit = undefined
|
||||
if (!item.up_limit) item.up_limit = undefined
|
||||
return item
|
||||
})
|
||||
this.form.tableData = map1
|
||||
})
|
||||
},
|
||||
hand() {
|
||||
|
||||
},
|
||||
onSubmit() {
|
||||
let optType = null
|
||||
|
||||
const isCopyAdd = this.$parent.isCopyAdd
|
||||
debugger
|
||||
if (isCopyAdd === '1') {
|
||||
optType = '01' // 复制新增
|
||||
} else if (this.crud.status.add === 1) {
|
||||
optType = '02' // 新增
|
||||
} else {
|
||||
this.crud.status.add
|
||||
optType = '03' // 修改
|
||||
}
|
||||
// 判断是新增还是修改还是复制新增
|
||||
this.form.optType = optType
|
||||
const arr = this.form.tableData
|
||||
const that = this
|
||||
const errMsgList = []
|
||||
const data = arr.map(function(item) {
|
||||
debugger
|
||||
// 合格上下限同时为填入的数字或同时为空
|
||||
if ((!isNaN(item.up_limit) && !isNaN(item.down_limit)) || (isNaN(item.up_limit) && isNaN(item.down_limit))) {
|
||||
// 临界上下限同时为填入的数字或同时为空
|
||||
if ((!isNaN(item.up_limit_value) && !isNaN(item.down_limit_value)) || (isNaN(item.up_limit_value) && isNaN(item.down_limit_value))) {
|
||||
if (isNaN(item.up_limit) && !isNaN(item.up_limit_value)) {
|
||||
errMsgList.push(item.order_index)
|
||||
}
|
||||
return item
|
||||
} else {
|
||||
errMsgList.push(item.order_index)
|
||||
}
|
||||
} else {
|
||||
errMsgList.push(item.order_index)
|
||||
return item
|
||||
}
|
||||
})
|
||||
if (errMsgList.length > 0) {
|
||||
that.crud.notify(errMsgList.toString() + '行格式错误,请检查!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
|
||||
this.form.tableData = data
|
||||
crudProductStandard.saveData(this.form).then(res => {
|
||||
this.crud.cancelCU()
|
||||
this.$parent.isCopyAdd = null
|
||||
this.crud.toQuery()
|
||||
this.notify('操作成功', 'success')
|
||||
})
|
||||
},
|
||||
notify(title, type) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
type: type,
|
||||
duration: 2500
|
||||
})
|
||||
},
|
||||
tableChanged2(data) {
|
||||
// 新增一行物料时,给行进行赋值
|
||||
this.form.material_id = data.material_id
|
||||
this.form.material_code = data.material_code
|
||||
this.form.material_name = data.material_name + '##' + data.material_code
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:visiable1', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.edit-input {
|
||||
.el-input__inner {
|
||||
border: 1px solid #e5e6e7;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,142 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input v-model="query.blurry" clearable placeholder="项点名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="475px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-form-item label="项点名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准值">
|
||||
<el-input v-model="form.standard" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项点类型" prop="inspectionType">
|
||||
<el-select
|
||||
v-model="form.inspectionType"
|
||||
placeholder=""
|
||||
style="width: 250px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.INSPECTION_POINT_TYPE"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" :rows="3" type="textarea" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="inspectionCode" label="项点编码" />
|
||||
<el-table-column prop="name" label="项点名称" />
|
||||
<el-table-column prop="standard" label="标准值">
|
||||
<template slot-scope="scope">
|
||||
{{ is_or_no(scope.row.standard, scope.row.inspectionType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inspectionType" label="项点类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.INSPECTION_POINT_TYPE[scope.row.inspectionType] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudInspection from '@/views/wms/ql/inspection/inspectionpoint'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { inspectionType: '1', inspectionId: null, inspectionCode: null, name: null, standard: null, remark: null }
|
||||
export default {
|
||||
name: 'InspectionPoint',
|
||||
dicts: ['INSPECTION_POINT_TYPE'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '质检项点', url: 'api/mdQlInspectionpoint', idField: 'inspectionId', sort: 'id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
reset: true,
|
||||
download: false
|
||||
},
|
||||
crudMethod: { ...crudInspection }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
inspectionCode: [
|
||||
{ required: true, message: '项点编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '项点名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspectionType: [
|
||||
{ required: true, message: '项点类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'inspection_code', display_name: '项点编码' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
is_or_no(val, type) {
|
||||
if (type === '01' && val === '1') {
|
||||
return '是'
|
||||
} else if (type === '01' && val === '0') {
|
||||
return '否'
|
||||
} else {
|
||||
return val
|
||||
}
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,35 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/materialInspection/create',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/materialInspection/delete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/materialInspection/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/materialInspection/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
Reference in New Issue
Block a user