add:清洗代码

This commit is contained in:
zhangzhiqiang
2023-07-19 13:42:04 +08:00
parent 2038cf1fe4
commit 98ef6cf4d4
43 changed files with 933 additions and 463 deletions

View File

@@ -14,7 +14,17 @@ export function edit(data) {
method: 'post',
data
})
}export function setEmp(data) {
}
export function setUsed(data) {
return request({
url: 'api/specialDevice/setUsed',
method: 'post',
data
})
}
export function setEmp(data) {
return request({
url: 'api/specialDevice/setEmp',
method: 'post',
@@ -22,4 +32,4 @@ export function edit(data) {
})
}
export default { query, setEmp, edit }
export default { query, setEmp, edit, setUsed }

View File

@@ -39,7 +39,7 @@
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item >
<el-form-item>
<rrOperation :permission="permission" />
</el-form-item>
</el-form>
@@ -60,7 +60,7 @@
</crudOperation>
<el-dialog
:close-on-click-modal="false"
:visible.sync=pointMVisible
:visible.sync="pointMVisible"
title="点位物料信息"
width="540px"
@close="materiValueCancel()"
@@ -68,8 +68,8 @@
<el-form ref="form" :model="materialForm" :rules="rules" size="mini" label-width="110px">
<el-form-item label="物料编码" prop="material_code">
<template slot-scope="scope">
<el-input v-model="materialForm.material_code" clearable @clear="materialForm.material_code='',materialForm.material_id='',materialForm.material_spec=''" style="width: 370px">
<el-button slot="append" icon="el-icon-plus" @click="queryMater(scope.$index, scope.row)" />
<el-input v-model="materialForm.material_code" clearable style="width: 370px" @clear="materialForm.material_code='',materialForm.material_id='',materialForm.material_spec=''">
<el-button slot="append" icon="el-icon-plus" @click="queryMater(scope.$index, scope.row)" />
</el-input>
</template>
</el-form-item>
@@ -77,10 +77,10 @@
<el-input v-model="materialForm.material_spec" disabled style="width: 370px;" />
</el-form-item>
<el-form-item label="物料数量(个)" prop="deviceinstor_qty">
<el-input-number v-model="materialForm.deviceinstor_qty" clearable style="width: 370px;" />
<el-input-number v-model="materialForm.deviceinstor_qty" clearable style="width: 370px;" />
</el-form-item>
<el-form-item label="物料重量(g)" prop="deviceinstor_weight">
<el-input-number v-model="materialForm.deviceinstor_weight" clearable style="width: 370px;" />
<el-input-number v-model="materialForm.deviceinstor_weight" clearable style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -98,20 +98,35 @@
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="product_area" label="生产车间" width="100px" show-overflow-tooltip />
<el-table-column prop="product_area" label="生产车间" width="100px" show-overflow-tooltip>
<template slot-scope="scope">
{{ dict.label.product_area[scope.row.product_area] }}
</template>
</el-table-column>
<el-table-column prop="device_code" label="设备编码" width="100px" show-overflow-tooltip />
<el-table-column prop="material_id" label="物料id" width="200px" show-overflow-tooltip />
<el-table-column prop="material_code" label="物料编码" width="200px" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="200px" show-overflow-toolti />
<el-table-column prop="deviceinstor_qty" label="物料数量(个)" align="center" width="120px" show-overflow-tooltip />
<el-table-column prop="deviceinstor_weight" label="物料重量(g)" align="center" width="120px" show-overflow-tooltip />
<el-table-column label="是否启用" align="center" prop="is_used">
<template slot-scope="scope">
<el-switch
v-model="scope.row.is_used"
active-color="#409EFF"
inactive-color="#F56C6C"
@change="changeEnabled(scope.row, scope.row.is_used)"
/>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="200px" show-overflow-tooltip />
<el-table-column label="操作" width="150px" align="center" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
slot="left"
@click="toEditMaterial(scope.row)">
type="text"
@click="toEditMaterial(scope.row)"
>
修改
</el-button>
</template>
@@ -138,29 +153,33 @@ import pagination from '@crud/Pagination'
import rrOperation from '@crud/RR.operation'
import MaterDtl from '@/views/wms/pub/MaterDialog'
const defaultForm = { product_area: 'A1', workprocedure_id: '1535144552481034240', device_code: null, material_id: null, material_name: null,material_code: null, material_spec: null, deviceinstor_qty: null, deviceinstor_weight: null, remark: null }
const defaultForm = { product_area: 'A1', workprocedure_id: '1535144552481034240', device_code: null, material_id: null, material_name: null, material_code: null, material_spec: null, deviceinstor_qty: null, deviceinstor_weight: null, remark: null }
export default {
name: 'SKdevice',
components: { crudOperation, pagination, rrOperation, MaterDtl },
components: { crudOperation, pagination, rrOperation, MaterDtl },
dicts: ['product_area'],
cruds() {
return [
CRUD({ title: '深坑设备物料', url: 'api/specialDevice/query', query: { product_area: 'A1', workprocedure_id: '1535144552481034240' }, idField: 'device_code', crudMethod: { ...crudDevice },
optShow: {add: false,
edit: false,
del: false,
download: false,
reset: true}})
optShow: { add: false,
edit: false,
del: false,
download: false,
reset: true }, props: { size: 20 }})
]
},
mixins: [presenter(), header(), form(defaultForm),crud()],
mixins: [presenter(), header(), form(defaultForm), crud()],
data() {
return {
enabledTypeOptions: [
{ key: true, display_name: '启用' },
{ key: false, display_name: '禁用' }
],
materType: '',
materialShow: false,
pointMVisible: false,
materialForm:{},
materialForm: {},
queryTypeOptions: [
{ key: 'name', display_name: '字典名称' },
{ key: 'description', display_name: '描述' }
@@ -198,18 +217,17 @@ export default {
this.materialForm.material_name = row.material_name
this.materialForm.material_spec = row.material_spec // 通过splice 替换数据 触发视图更新
},
materiValueCancel(){
materiValueCancel() {
this.materialForm = {}
this.dialogVisible = false
this.pointMVisible = false
},
materiCancel(){
this.materialForm.material_id = ""
this.materialForm.material_code = ""
this.materialForm.material_name = ""
materiCancel() {
this.materialForm.material_id = ''
this.materialForm.material_code = ''
this.materialForm.material_name = ''
},
pointMateriSubmit(){
console.log(this.materialForm)
pointMateriSubmit() {
crudDevice.edit(this.materialForm).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.materiValueCancel()
@@ -223,12 +241,28 @@ export default {
this.nowindex = index
this.nowrow = row
},
// 改变状态
changeEnabled(data, val) {
const satus = this.enabledTypeOptions.find(item => { return item.key == data.is_used })
this.$confirm('此操作将 "' + satus.display_name + '" ' + data.device_name + ', 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
crudDevice.setUsed(data).then(res => {
this.crud.notify(satus.display_name + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
}).catch(() => {
data.is_used = !data.is_used
})
},
updateSKMaterial(row) {
crudDevice.edit(row).then(() => {
this.notify('保存成功', 'success')
}).catch(() => {
})
},
}
}
}
</script>