-
+
+
+
+
+
+
+
+
{{ $t('query') }}
{{ $t('add') }}
-
+
{
- this.addOrUpdateVisible= false
- }, /** after dialog animated */ 200);
+ this.addOrUpdateVisible = false
+ }, /** after dialog animated */ 200)
},
// handle
async handleSelectChange({ name, id }) {
@@ -158,18 +173,14 @@ export default {
// 获取产线
getProductLines() {
this.$http({
- url: this.$http.adornUrl('/monitoring/productionLine/page'),
- method: 'get',
- params: this.$http.adornParams({
- // page: this.pageIndex,
- // limit: this.pageSize,
- // key: this.dataForm.key
- })
+ url: this.$http.adornUrl('/monitoring/productionLine/list'),
+ method: 'get'
}).then(({ data: res }) => {
const plOpt = this.addOrUpdateConfigs.fields.find(item => item.name === 'productionId')
if (plOpt) {
- plOpt.options = res.data.list.map(item => ({ value: item.id, label: item.name })) || []
+ plOpt.options = res.data.map(item => ({ value: item.id, label: item.name })) || []
}
+ this.plList = res.data.map(item => ({ value: item.id, label: item.name })) || []
})
},
// 获取工段
@@ -203,14 +214,22 @@ export default {
getDataList() {
this.addOrUpdateVisible = false
this.dataListLoading = true
+
+ const queryParams = {
+ page: this.pageIndex,
+ limit: this.pageSize
+ }
+
+ if (this.dataForm.key) {
+ queryParams['key'] = this.dataForm.key
+ }
+ if (this.dataForm.lineId) {
+ queryParams['lineId'] = this.dataForm.lineId
+ }
this.$http({
url: this.$http.adornUrl('/monitoring/qualityInspectionRecord/page'),
method: 'get',
- params: this.$http.adornParams({
- page: this.pageIndex,
- limit: this.pageSize,
- key: this.dataForm.key
- })
+ params: this.$http.adornParams(queryParams)
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.data.list
diff --git a/src/views/modules/monitoring/workShopSection.vue b/src/views/modules/monitoring/workShopSection.vue
index 6dfe2a2..ee0151d 100644
--- a/src/views/modules/monitoring/workShopSection.vue
+++ b/src/views/modules/monitoring/workShopSection.vue
@@ -10,7 +10,15 @@
-
+
{
- this.addOrUpdateVisible= false
- }, /** after dialog animated */ 200);
+ this.addOrUpdateVisible = false
+ }, /** after dialog animated */ 200)
},
// 获取产线列表
getProductLine() {
diff --git a/src/views/modules/monitoring/workshopSectionDialog.vue b/src/views/modules/monitoring/workshopSectionDialog.vue
index b4b11d0..af7464c 100644
--- a/src/views/modules/monitoring/workshopSectionDialog.vue
+++ b/src/views/modules/monitoring/workshopSectionDialog.vue
@@ -122,9 +122,12 @@ export default {
// 备注
remark: ''
},
+ dataFormRules: {
+ name: [{ required: true, message: i18n.t('validate.required'), trigger: 'blur' }],
+ code: [{ required: true, message: i18n.t('validate.required'), trigger: 'blur' }]
+ },
limit: 5,
page: 1,
- dataFormRules: {},
showAttrForm: false
}
},
@@ -287,20 +290,24 @@ export default {
}
},
handleCreateOrUpdate() {
- this.$http({
- url: this.$http.adornUrl('/monitoring/workshopSection'),
- method: this.dataForm.id ? 'put' : 'post',
- data: {
- ...this.dataForm
+ this.$refs['dataForm'].validate(valid => {
+ if (valid) {
+ this.$http({
+ url: this.$http.adornUrl('/monitoring/workshopSection'),
+ method: this.dataForm.id ? 'put' : 'post',
+ data: {
+ ...this.dataForm
+ }
+ }).then(({ data: res }) => {
+ this.$message.success({
+ message: i18n.t('prompt.success'),
+ onClose: () => {
+ this.$emit('refreshDataList')
+ this.visible = false
+ }
+ })
+ })
}
- }).then(({ data: res }) => {
- this.$message.success({
- message: i18n.t('prompt.success'),
- onClose: () => {
- this.$emit('refreshDataList')
- this.visible = false
- }
- })
})
}
}