新增
This commit is contained in:
64
mes/qd/src/api/wms/pdm/wcchange.js
Normal file
64
mes/qd/src/api/wms/pdm/wcchange.js
Normal file
@@ -0,0 +1,64 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/wcchange',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/wcchange/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/wcchange',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function submit(data) {
|
||||
return request({
|
||||
url: 'api/wcchange/submit',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function openWork(data) {
|
||||
return request({
|
||||
url: 'api/wcchange/openWork',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function confirmWork(data) {
|
||||
return request({
|
||||
url: 'api/wcchange/confirmWork',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function createPcsn(params) {
|
||||
return request({
|
||||
url: 'api/wcchange/createPcsn',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getDepts(params) {
|
||||
return request({
|
||||
url: 'api/wcchange/getDepts',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, submit, confirmWork, openWork, createPcsn, getDepts }
|
||||
168
mes/qd/src/views/wms/pdm/base/wcchange/AddDialog.vue
Normal file
168
mes/qd/src/views/wms/pdm/base/wcchange/AddDialog.vue
Normal file
@@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="碳化钨修正编辑"
|
||||
width="800px"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
@close="close"
|
||||
>
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="115px" label-suffix=":">
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<label slot="label">物料编码:</label>
|
||||
<el-input v-model="form.material_code" style="width: 210px" disabled class="input-with-select">
|
||||
<el-button slot="append" icon="el-icon-search" @click="queryMater" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<label slot="label">物料名称:</label>
|
||||
<el-input v-model="form.material_name" style="width: 210px" disabled>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编码" prop="supp_code">
|
||||
<label slot="label">供应商编码:</label>
|
||||
<el-input v-model="form.supp_code" style="width: 210px" disabled class="input-with-select">
|
||||
<el-button slot="append" icon="el-icon-search" @click="queryDtl" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商名称" prop="supp_name">
|
||||
<label slot="label">供应商名称:</label>
|
||||
<el-input v-model="form.supp_name" style="width: 210px" disabled>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="修正值" prop="workorder_qty">
|
||||
<label slot="label">修正值:</label>
|
||||
<el-input-number
|
||||
v-model="form.change_qty"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="-99"
|
||||
:max="99"
|
||||
:disabled="crud.status.view > 0"
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<SuppDialog :dialog-show.sync="dtlShow" @tableChanged="tableChanged" />
|
||||
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @tableChanged2="tableChanged2" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button slot="left" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
<el-button slot="left" type="primary" :loading="crud.cu === 2" @click="crud.submitCU">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import SuppDialog from '@/views/wms/pub/SuppDialog'
|
||||
import MaterDialog from '@/views/wms/pub/MaterDialog'
|
||||
import workorder from '@/api/wms/pdm/workorder'
|
||||
import crudseriesProcessRoute from '@/api/wms/pdm/seriesProcessRoute'
|
||||
|
||||
const defaultForm = {
|
||||
material_id:'',
|
||||
material_code:'',
|
||||
material_name:'',
|
||||
supp_name:'',
|
||||
supp_code:'',
|
||||
supp_id:'',
|
||||
change_qty: '0',
|
||||
workorder_type: '01'
|
||||
}
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { SuppDialog, MaterDialog },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dtlShow: false,
|
||||
materType: '10',
|
||||
materShow: false,
|
||||
rules: {
|
||||
supp_code: [
|
||||
{ required: true, message: '供应商不能为空', trigger: 'blur' }
|
||||
],
|
||||
material_code: [
|
||||
{ required: true, message: '物料不能为空', trigger: 'blur' }
|
||||
],
|
||||
change_qty: [
|
||||
{ required: true, message: '修正值不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudseriesProcessRoute.getXLlist2().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
workorder.getDepts().then(res => {
|
||||
this.Depts = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
async queryMater(index, row) {
|
||||
if (this.form.workorder_type === '') {
|
||||
this.crud.notify('请选择工令类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.materShow = true
|
||||
},
|
||||
async queryDtl(index, row) {
|
||||
if (this.form.workorder_type === '') {
|
||||
this.crud.notify('请选择工令类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.dtlShow = true
|
||||
},
|
||||
createPcsn(){
|
||||
if (this.form.material_code === '') {
|
||||
this.crud.notify('请选择产品!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.form.org_id === '') {
|
||||
this.crud.notify('请选择所属组织!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
workorder.createPcsn({ 'material_id': this.form.material_id, 'org_id': this.form.org_id, 'is_experiment': this.form.is_experiment }).then(res => {
|
||||
this.crud.notify('操作成功!')
|
||||
this.form.pcsn = res.pcsn
|
||||
})
|
||||
},
|
||||
tableChanged2(row) {
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_code = row.material_code
|
||||
this.form.material_name = row.material_name
|
||||
},
|
||||
tableChanged(row) {
|
||||
this.form.supp_code = row.supp_code
|
||||
this.form.supp_id = row.supp_id
|
||||
this.form.supp_name = row.supp_name
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.input-with-select {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
169
mes/qd/src/views/wms/pdm/base/wcchange/index.vue
Normal file
169
mes/qd/src/views/wms/pdm/base/wcchange/index.vue
Normal file
@@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="供应商">
|
||||
<el-input
|
||||
v-model="query.supp_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="供应商名称或编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="物料编码或物料编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
size="mini"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
:highlight-current-row="true"
|
||||
@selection-change="mySelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
v-permission="['admin','workorder:del','workorder:edit']"
|
||||
min-width="130"
|
||||
label="操作"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" min-width="130" label="物料编码"/>
|
||||
<el-table-column prop="material_name" min-width="130" label="物料名称"/>
|
||||
<el-table-column prop="supp_code" min-width="130" label="供应商编码"/>
|
||||
<el-table-column prop="supp_name" min-width="200" label="供应商名称"/>
|
||||
<el-table-column prop="change_qty" min-width="80" label="修正值(%)" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="create_name" min-width="80" label="创建人"/>
|
||||
<el-table-column prop="create_time" min-width="140" label="创建时间"/>
|
||||
<el-table-column prop="update_optname" min-width="80" label="修改人"/>
|
||||
<el-table-column prop="update_time" min-width="140" label="修改时间"/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import wcchange from '@/api/wms/pdm/wcchange'
|
||||
import CRUD, { crud, header, presenter } 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'
|
||||
import AddDialog from '@/views/wms/pdm/base/wcchange/AddDialog'
|
||||
import ViewDialog from '@/views/wms/pdm/produce/workorder/ViewDialog'
|
||||
|
||||
export default {
|
||||
name: 'wcchange',
|
||||
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '碳化钨总碳修正维护', idField: 'change_id', url: 'api/wcchange', crudMethod: { ...wcchange },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
}})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {
|
||||
add: ['admin', 'workorder:add'],
|
||||
edit: ['admin', 'workorder:edit'],
|
||||
del: ['admin', 'workorder:del']
|
||||
},
|
||||
divShow: false,
|
||||
sub_flag: true,
|
||||
dissub_flag: true,
|
||||
change_flag: true,
|
||||
open_flag: true,
|
||||
confirm_flag: true,
|
||||
mstrow: {},
|
||||
XLList: [],
|
||||
Depts: [],
|
||||
workProcedureList: [],
|
||||
viewShow: false,
|
||||
changeShow: false,
|
||||
currentRow: null,
|
||||
query_flag: true,
|
||||
checkrows: []
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.handleCurrentChange()
|
||||
},
|
||||
toView(index, row) {
|
||||
this.mstrow = row
|
||||
this.viewShow = true
|
||||
},
|
||||
mySelectionChange(rows) {
|
||||
},
|
||||
handleCurrentChange() {
|
||||
this.checkrows = []
|
||||
this.mstrow = {}
|
||||
this.sub_flag = true
|
||||
this.dissub_flag = true
|
||||
this.open_flag = true
|
||||
this.change_flag = true
|
||||
this.confirm_flag = true
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
this.handleCurrentChange()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
140
mes/qd/src/views/wms/pub/SuppDialog.vue
Normal file
140
mes/qd/src/views/wms/pub/SuppDialog.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="供应商选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
>
|
||||
<!-- 搜索 -->
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
size="mini"
|
||||
placeholder="输入供应商编码或名称"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="supp_code" label="供应商编码" />
|
||||
<el-table-column prop="supp_name" label="供应商名称 " />
|
||||
<el-table-column prop="corp_address" label="公司地址" />
|
||||
<el-table-column prop="corp_tele_no" label="公司电话" />
|
||||
<el-table-column prop="jurid_name" label="法人代表" />
|
||||
<el-table-column prop="update_optname" label="修改者" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
export default {
|
||||
name: 'DeviceDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '供应商',
|
||||
optShow: {},
|
||||
url: 'api/supplierbase',
|
||||
idField: 'supp_id',
|
||||
sort: '',
|
||||
query: { device_code: '', workprocedure_id: '', is_produceuse: '' }
|
||||
})
|
||||
},
|
||||
dicts: ['IS_OR_NOT'],
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
workProcedureList: [],
|
||||
produceuseList: [],
|
||||
dialogVisible: false,
|
||||
checkrow: {},
|
||||
disablePro: true,
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 接受父组件传值
|
||||
* @param msg
|
||||
*/
|
||||
getMsg(msg, msg2) {
|
||||
this.disablePro = false
|
||||
this.crud.query.workprocedure_id = msg
|
||||
this.crud.query.is_produceuse = msg2
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery()
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选供应商')
|
||||
return
|
||||
}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.checkrow)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user