projects/mesxc-zhp #161
							
								
								
									
										8
									
								
								.env.dev
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								.env.dev
									
									
									
									
									
								
							@@ -1,8 +1,8 @@
 | 
			
		||||
###
 | 
			
		||||
 # @Author: Do not edit
 | 
			
		||||
 # @Date: 2023-08-29 09:40:39
 | 
			
		||||
 # @LastEditTime: 2023-11-21 10:36:47
 | 
			
		||||
 # @LastEditors: DY
 | 
			
		||||
 # @LastEditTime: 2023-12-13 15:33:20
 | 
			
		||||
 # @LastEditors: zhp
 | 
			
		||||
 # @Description:
 | 
			
		||||
###
 | 
			
		||||
# 开发环境配置
 | 
			
		||||
@@ -13,7 +13,7 @@ VUE_APP_TITLE = MES系统
 | 
			
		||||
 | 
			
		||||
# 芋道管理系统/开发环境
 | 
			
		||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
 | 
			
		||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
 | 
			
		||||
@@ -21,7 +21,7 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48082'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
 | 
			
		||||
 | 
			
		||||
VUE_APP_BASE_API = 'http://192.168.1.78:48082'
 | 
			
		||||
# 积木报表指向地址
 | 
			
		||||
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -48,7 +48,7 @@
 | 
			
		||||
    "benz-amr-recorder": "^1.1.5",
 | 
			
		||||
    "bpmn-js-token-simulation": "0.10.0",
 | 
			
		||||
    "clipboard": "2.0.8",
 | 
			
		||||
    "code-brick-zj": "^1.0.2",
 | 
			
		||||
    "code-brick-zj": "^1.0.5",
 | 
			
		||||
    "core-js": "^3.26.0",
 | 
			
		||||
    "crypto-js": "^4.0.0",
 | 
			
		||||
    "diagram-js": "^12.3.0",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										101
									
								
								src/api/base/qualityHotMaterial.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								src/api/base/qualityHotMaterial.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,101 @@
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-06 15:38:12
 | 
			
		||||
 * @LastEditTime: 2023-12-08 16:08:35
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 创建质量检测类型基础
 | 
			
		||||
export function createQualityHotMaterial(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-hot-material/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 更新质量检测类型基础
 | 
			
		||||
export function updateQualityHotMaterial(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-hot-material/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 删除质量检测类型基础
 | 
			
		||||
export function deleteQualityHotMaterial(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-hot-material/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得质量检测类型基础
 | 
			
		||||
export function getQualityHotMaterial(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-hot-material/get?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得质量检测类型基础分页
 | 
			
		||||
export function getQualityHotMaterialPage(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'base/quality-hot-material/page',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 导出质量检测类型基础 Excel
 | 
			
		||||
// export function exportQualityScrapTypeExcel(query) {
 | 
			
		||||
//   return request({
 | 
			
		||||
//     url: '/base/quality-scrap-type/export-excel',
 | 
			
		||||
//     method: 'get',
 | 
			
		||||
//     params: query,
 | 
			
		||||
//     responseType: 'blob'
 | 
			
		||||
//   })
 | 
			
		||||
// }
 | 
			
		||||
 | 
			
		||||
export function getCode(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-hot-material/getCode',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
export function getHotMaterialAllList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-hot-material/listAll',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getSupplierList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-supplier/listAll',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getWorkerList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-worker/listAll',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getMaterialCheckList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-hot-material-check/listByMaterial',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -1,10 +1,17 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-04 14:10:37
 | 
			
		||||
 * @LastEditTime: 2023-12-13 16:03:46
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 创建安灯按钮16键对应
 | 
			
		||||
export function createQualityInspectionBoxBtn(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-inspection-box-btn/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    url: '/base/quality-inspection-box-btn/updateBatch',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -52,3 +59,19 @@ export function exportQualityInspectionBoxBtnExcel(query) {
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getAllDetByTypeList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-scrap-det/scrapMap',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
export function getListByLineSection(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-inspection-box-btn/detListByLineSection',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-06 15:38:12
 | 
			
		||||
 * @LastEditTime: 2023-11-06 15:39:39
 | 
			
		||||
 * @LastEditTime: 2023-12-08 09:46:55
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
@@ -67,3 +67,4 @@ export function getCode(query) {
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										63
									
								
								src/api/monitoring/qualityIsra.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								src/api/monitoring/qualityIsra.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,63 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-08 15:26:59
 | 
			
		||||
 * @LastEditTime: 2023-12-11 15:21:44
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
export function getQualityIsraPage(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'base/quality-isra-statistics/getIsraData',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getQualityIsraDayMap(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-isra-statistics/dayMap',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getQualityIsraWeekMap(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-isra-statistics/weekMap',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getQualityIsraMonthMap(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-isra-statistics/monthMap',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getQualityIsraDayList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-isra-statistics/dayList',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getQualityIsraWeekList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-isra-statistics/weekList',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getQualityIsraMonthList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/quality-isra-statistics/monthList',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-10-31 10:55:20
 | 
			
		||||
 * @LastEditTime: 2023-10-31 15:05:30
 | 
			
		||||
 * @LastEditTime: 2023-12-06 14:09:14
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
@@ -33,3 +33,12 @@ export function exportEnergyPlcExcel(query) {
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getOriginalGlassRetrace(query) {
 | 
			
		||||
   return request({
 | 
			
		||||
    url: '/base/original-glass-statistics/originalGlassRetrace',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										41
									
								
								src/api/report/production.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								src/api/report/production.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-12 13:49:02
 | 
			
		||||
 * @LastEditTime: 2023-12-13 15:52:11
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 获得质量检查信息记录表分页
 | 
			
		||||
 | 
			
		||||
export function getProductionDataList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/report-auto-production/listPlus',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    data: query,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function updateProductionDataList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/report-auto-production/updatePlus',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: query,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
export function updateSumProductionDataList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/report-auto-production/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: query,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getAutoDeliveDataList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/report-auto-delive/listPlus',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: query,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -125,9 +125,7 @@ export default {
 | 
			
		||||
			// 取消自动聚焦 start
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.Quill?.blur();
 | 
			
		||||
				if (!this.readOnly) {
 | 
			
		||||
					this.Quill?.enable();
 | 
			
		||||
				}
 | 
			
		||||
				this.Quill?.enable(true);
 | 
			
		||||
			});
 | 
			
		||||
			// 如果设置了上传地址则自定义图片上传事件
 | 
			
		||||
			if (this.type === 'url') {
 | 
			
		||||
 
 | 
			
		||||
@@ -78,7 +78,6 @@ export default {
 | 
			
		||||
			return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload);
 | 
			
		||||
		},
 | 
			
		||||
		del(payload) {
 | 
			
		||||
			debugger;
 | 
			
		||||
			return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -248,6 +248,9 @@ export default {
 | 
			
		||||
						label: '设备编码',
 | 
			
		||||
						prop: 'code',
 | 
			
		||||
						url: '/base/core-equipment/getCode',
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '设备编码不能为空', trigger: 'blur' },
 | 
			
		||||
						],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2022-08-24 11:19:43
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-11-06 15:59:53
 | 
			
		||||
 * @LastEditTime: 2023-12-13 15:52:53
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
export default {
 | 
			
		||||
@@ -38,7 +38,7 @@ export default {
 | 
			
		||||
        this.$refs["dataForm"].resetFields();
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.urlOptions.infoURL(id).then(response => {
 | 
			
		||||
            this.dataForm = response.data;
 | 
			
		||||
            this.dataForm = response.data
 | 
			
		||||
            if (this.setData) {
 | 
			
		||||
              this.setDataForm()
 | 
			
		||||
            }
 | 
			
		||||
@@ -80,7 +80,7 @@ export default {
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.urlOptions.updateURL(this.dataForm).then(response => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
            this.visible = false; 
 | 
			
		||||
            this.visible = false;
 | 
			
		||||
            this.$emit("refreshDataList");
 | 
			
		||||
          });
 | 
			
		||||
          return;
 | 
			
		||||
 
 | 
			
		||||
@@ -27,20 +27,20 @@
 | 
			
		||||
			<div class="legend">
 | 
			
		||||
				<div class="legend-item">
 | 
			
		||||
					<span class="icon blue"></span>
 | 
			
		||||
					<span class="text">工作时长</span>
 | 
			
		||||
					<span class="text">有效时长</span>
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="legend-item">
 | 
			
		||||
					<span class="icon green"></span>
 | 
			
		||||
					<span class="text">停机时长</span>
 | 
			
		||||
					<span class="text">关机时长</span>
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="legend-item">
 | 
			
		||||
					<span class="icon purple"></span>
 | 
			
		||||
					<span class="text">故障时长</span>
 | 
			
		||||
					<span class="text">中断时长</span>
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="legend-item">
 | 
			
		||||
				<!-- <div class="legend-item">
 | 
			
		||||
					<span class="icon yellow"></span>
 | 
			
		||||
					<span class="text">速度开动率</span>
 | 
			
		||||
				</div>
 | 
			
		||||
				</div> -->
 | 
			
		||||
			</div>
 | 
			
		||||
			<div v-if="list.length" class="graph-grid">
 | 
			
		||||
				<div class="bg-grid grid-line">
 | 
			
		||||
@@ -389,14 +389,14 @@ export default {
 | 
			
		||||
	position: relative;
 | 
			
		||||
	padding: 4px 0;
 | 
			
		||||
	padding-left: 12px;
 | 
			
		||||
	font-size: 14px;
 | 
			
		||||
	font-size: 18px;
 | 
			
		||||
 | 
			
		||||
	&::before {
 | 
			
		||||
		content: '';
 | 
			
		||||
		position: absolute;
 | 
			
		||||
		left: 0;
 | 
			
		||||
		top: 6px;
 | 
			
		||||
		height: 16px;
 | 
			
		||||
		height: 20px;
 | 
			
		||||
		width: 4px;
 | 
			
		||||
		border-radius: 1px;
 | 
			
		||||
		background: #0b58ff;
 | 
			
		||||
 
 | 
			
		||||
@@ -16,23 +16,22 @@
 | 
			
		||||
			<div class="data-view__item">
 | 
			
		||||
				<!-- <div class="data-view__item__value">111</div> -->
 | 
			
		||||
				<div class="data-view__item__value">{{ textData.workTime }}</div>
 | 
			
		||||
				<div class="data-view__item__title blue">工作时长</div>
 | 
			
		||||
				<div class="data-view__item__title blue">有效时长</div>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="data-view__item">
 | 
			
		||||
				<!-- <div class="data-view__item__value">22</div> -->
 | 
			
		||||
				<div class="data-view__item__value">{{ textData.stopTime }}</div>
 | 
			
		||||
				<div class="data-view__item__title green">停机时长</div>
 | 
			
		||||
				<div class="data-view__item__title green">关机时长</div>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="data-view__item">
 | 
			
		||||
				<!-- <div class="data-view__item__value">10</div> -->
 | 
			
		||||
				<div class="data-view__item__value">{{ textData.downTime }}</div>
 | 
			
		||||
				<div class="data-view__item__title purple">故障时长</div>
 | 
			
		||||
				<div class="data-view__item__title purple">中断时长</div>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="data-view__item">
 | 
			
		||||
				<!-- <div class="data-view__item__value">100%</div> -->
 | 
			
		||||
			<!-- <div class="data-view__item">
 | 
			
		||||
				<div class="data-view__item__value">{{ textData.peEfficiency }}</div>
 | 
			
		||||
				<div class="data-view__item__title yellow">速度开动率</div>
 | 
			
		||||
			</div>
 | 
			
		||||
			</div> -->
 | 
			
		||||
		</div>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -93,7 +92,7 @@ export default {
 | 
			
		||||
						// 外环
 | 
			
		||||
						name: '',
 | 
			
		||||
						type: 'pie',
 | 
			
		||||
						radius: ['75%', '90%'],
 | 
			
		||||
						radius: ['60%', '90%'],
 | 
			
		||||
						center: ['50%', '48%'],
 | 
			
		||||
						label: {
 | 
			
		||||
							show: false,
 | 
			
		||||
@@ -259,7 +258,7 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.data-view__item__title {
 | 
			
		||||
	font-size: 8px;
 | 
			
		||||
	font-size: 14px;
 | 
			
		||||
	line-height: 14px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -19,6 +19,7 @@
 | 
			
		||||
			:page="1"
 | 
			
		||||
			:limit="10"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			height="65vh"
 | 
			
		||||
			@emitFun="handleEmitFun" />
 | 
			
		||||
 | 
			
		||||
		<!-- <el-row>
 | 
			
		||||
@@ -122,23 +123,24 @@ export default {
 | 
			
		||||
			// 		: undefined,
 | 
			
		||||
			// ].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'factoryName', label: '工厂' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备' },
 | 
			
		||||
				{ prop: 'factoryName', label: '工厂', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'lineName', label: '产线', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备', showOverflowtooltip: true },
 | 
			
		||||
				{
 | 
			
		||||
					label: '有效时间',
 | 
			
		||||
					children: [
 | 
			
		||||
						{
 | 
			
		||||
							width: 128,
 | 
			
		||||
							prop: 'workTime',
 | 
			
		||||
							label: '工作时长[h]',
 | 
			
		||||
							label: '工作时长(h)',
 | 
			
		||||
							filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
 | 
			
		||||
						},
 | 
			
		||||
						{
 | 
			
		||||
							width: 128,
 | 
			
		||||
							prop: 'workRate',
 | 
			
		||||
							label: '百分比[%]',
 | 
			
		||||
							filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
 | 
			
		||||
							label: '百分比(%)',
 | 
			
		||||
							filter: (val) => (val != null ? +Number(val).toFixed(0) : '-'),
 | 
			
		||||
						},
 | 
			
		||||
					],
 | 
			
		||||
				},
 | 
			
		||||
@@ -148,9 +150,10 @@ export default {
 | 
			
		||||
						{
 | 
			
		||||
							width: 128,
 | 
			
		||||
							prop: 'stopTime',
 | 
			
		||||
							label: '停机时长[h]',
 | 
			
		||||
							label: '停机时长(h)',
 | 
			
		||||
							filter: (val) => (val != null ? +Number(val).toFixed(0) : '-'),
 | 
			
		||||
						},
 | 
			
		||||
						{ width: 128, prop: 'stopRate', label: '百分比[%]' },
 | 
			
		||||
						{ width: 128, prop: 'stopRate', label: '百分比(%)', filter: (val) => (val != null ? +Number(val).toFixed(0) : '-'), },
 | 
			
		||||
					],
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
@@ -159,48 +162,52 @@ export default {
 | 
			
		||||
						{
 | 
			
		||||
							width: 128,
 | 
			
		||||
							prop: 'downTime',
 | 
			
		||||
							label: '故障时长[h]',
 | 
			
		||||
							filter: (val) => (val != null ? +val.toFixed(3) : '-'),
 | 
			
		||||
							label: '故障时长(h)',
 | 
			
		||||
							filter: (val) => (val != null ? +val.toFixed(2) : '-'),
 | 
			
		||||
						},
 | 
			
		||||
						{ width: 128, prop: 'downRate', label: '百分比[%]' },
 | 
			
		||||
						{ width: 128, prop: 'downRate', label: '百分比(%)', filter: (val) => (val != null ? +Number(val).toFixed(0) : '-'), },
 | 
			
		||||
						{
 | 
			
		||||
							width: 128,
 | 
			
		||||
							prop: 'timeEfficiency',
 | 
			
		||||
							label: '时间开动率',
 | 
			
		||||
							filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
 | 
			
		||||
							filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
 | 
			
		||||
						},
 | 
			
		||||
					],
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					label: '速度损失',
 | 
			
		||||
					showOverflowtooltip: true,
 | 
			
		||||
					children: [
 | 
			
		||||
						{
 | 
			
		||||
							width: 128,
 | 
			
		||||
							prop: 'realProcSpeed',
 | 
			
		||||
							label: '实际加工速度',
 | 
			
		||||
							filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
 | 
			
		||||
						},
 | 
			
		||||
						{
 | 
			
		||||
							width: 128,
 | 
			
		||||
							prop: 'designProcSpeed',
 | 
			
		||||
							label: '理论加工速度',
 | 
			
		||||
							showOverflowtooltip: true,
 | 
			
		||||
							filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
 | 
			
		||||
						},
 | 
			
		||||
						{
 | 
			
		||||
							width: 128,
 | 
			
		||||
							prop: 'peEfficiency',
 | 
			
		||||
							label: '速度开动率',
 | 
			
		||||
							filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
 | 
			
		||||
							filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
 | 
			
		||||
						},
 | 
			
		||||
					],
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'oee',
 | 
			
		||||
					label: 'OEE',
 | 
			
		||||
					filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
 | 
			
		||||
					filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'teep',
 | 
			
		||||
					label: 'TEEP',
 | 
			
		||||
					filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
 | 
			
		||||
					filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	_action: 'view-trend',
 | 
			
		||||
@@ -433,6 +440,9 @@ export default {
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped lang="scss">
 | 
			
		||||
.app-container {
 | 
			
		||||
	overflow: inherit;
 | 
			
		||||
}
 | 
			
		||||
.visualization {
 | 
			
		||||
	display: grid;
 | 
			
		||||
	grid-template-columns: repeat(3, minmax(240px, 1fr));
 | 
			
		||||
 
 | 
			
		||||
@@ -94,7 +94,7 @@ export default {
 | 
			
		||||
		return {
 | 
			
		||||
			readOnly: false,
 | 
			
		||||
			chosedLogId: false,
 | 
			
		||||
			searchBarKeys: ['equipmentName', 'recordTime'],
 | 
			
		||||
			searchBarKeys: ['equipmentName', 'createTime'],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				// this.$auth.hasPermi('equipment:spare-parts-config:update')
 | 
			
		||||
				// 	? {
 | 
			
		||||
@@ -124,11 +124,11 @@ export default {
 | 
			
		||||
					label: '报警级别',
 | 
			
		||||
					filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
 | 
			
		||||
				},
 | 
			
		||||
				{ prop: 'createTime', label: '报警时间', filter: timeFilter }, // 接口缺
 | 
			
		||||
				{ prop: 'alarmCode', label: '设备报警码' }, // 接口缺
 | 
			
		||||
				{ prop: 'createTime', label: '报警时间', filter: timeFilter },
 | 
			
		||||
				{ prop: 'alarmCode', label: '设备报警码' },
 | 
			
		||||
				{ prop: 'alarmContent', label: '报警内容' },
 | 
			
		||||
				{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn },
 | 
			
		||||
				{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn }, // TODO: 是否换成按钮, 群里问
 | 
			
		||||
				{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn },
 | 
			
		||||
				// { prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
@@ -145,8 +145,8 @@ export default {
 | 
			
		||||
					dateType: 'daterange', // datetimerange
 | 
			
		||||
					// format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					valueFormat: 'timestamp',
 | 
			
		||||
					// valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					// valueFormat: 'timestamp',
 | 
			
		||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始日期',
 | 
			
		||||
					endPlaceholder: '结束日期',
 | 
			
		||||
 
 | 
			
		||||
@@ -84,10 +84,10 @@ export default {
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'program', label: '巡检项目' },
 | 
			
		||||
				{ prop: 'content', label: '巡检内容' },
 | 
			
		||||
				{ prop: 'code', label: '巡检内容编码' },
 | 
			
		||||
				{ prop: 'remark', label: '备注' },
 | 
			
		||||
				{ prop: 'program', label: '巡检项目', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'content', label: '巡检内容', minWidth: 150, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'code', label: '巡检内容编码', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'remark', label: '备注', showOverflowtooltip: true },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
<!-- 
 | 
			
		||||
<!--
 | 
			
		||||
    filename: dialogForm.vue
 | 
			
		||||
    author: liubin
 | 
			
		||||
    date: 2023-10-31 15:55:13
 | 
			
		||||
    description: 
 | 
			
		||||
    description:
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
@@ -12,7 +12,8 @@
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="isdetail"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="60%">
 | 
			
		||||
		size="55%"
 | 
			
		||||
		@closed="$emit('destroy')">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
			{{ isdetail ? '查看详情' : !dataForm.id ? '新增' : '编辑' }}
 | 
			
		||||
		</small-title>
 | 
			
		||||
@@ -23,7 +24,7 @@
 | 
			
		||||
			label-width="100px"
 | 
			
		||||
			v-loading="formLoading">
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item label="设备名称" prop="equipmentId">
 | 
			
		||||
						<el-select
 | 
			
		||||
							v-model="dataForm.equipmentId"
 | 
			
		||||
@@ -40,7 +41,7 @@
 | 
			
		||||
						</el-select>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<!-- <el-form-item label="物料名称" prop="name">
 | 
			
		||||
						<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入物料名称" />
 | 
			
		||||
					</el-form-item> -->
 | 
			
		||||
@@ -60,21 +61,19 @@
 | 
			
		||||
						</el-select>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item label="设备编码" prop="equipmentCode">
 | 
			
		||||
						<el-input v-model="dataForm.equipmentCode" disabled clearable placeholder="请输入设备编码" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item label="巡检人" prop="responsible">
 | 
			
		||||
						<el-input v-model="dataForm.responsible" :disabled="isdetail" clearable placeholder="请输入巡检人" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item label="巡检时间" prop="actualTime">
 | 
			
		||||
						<el-date-picker
 | 
			
		||||
							v-model="dataForm.actualTime"
 | 
			
		||||
@@ -85,7 +84,7 @@
 | 
			
		||||
							placeholder="选择巡检时间" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item label="数据来源" prop="origin">
 | 
			
		||||
						<el-select
 | 
			
		||||
							v-model="dataForm.origin"
 | 
			
		||||
@@ -94,7 +93,7 @@
 | 
			
		||||
							style="width: 100%"
 | 
			
		||||
							placeholder="请选择数据来源">
 | 
			
		||||
							<el-option key="1" label="手动" :value="1" />
 | 
			
		||||
							<el-option key="2" label="自动" :value="2" />
 | 
			
		||||
							<el-option key="2" label="PDA" :value="2" />
 | 
			
		||||
						</el-select>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
@@ -107,16 +106,17 @@
 | 
			
		||||
					:table-data="list" />
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
			<el-form-item label="巡检详情" prop="description">
 | 
			
		||||
				<editor v-model="dataForm.description" :read-only="isdetail" :min-height="150"/>
 | 
			
		||||
				<editor v-if="!isdetail" v-model="dataForm.description" :min-height="150"/>
 | 
			
		||||
				<div v-else v-html="dataForm.description" style="padding: 5px; margin-left: 5px; border: 1px solid #dfdfdf" />
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
			<el-form-item label="附件">
 | 
			
		||||
				<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="isdetail" @name="setFileName" />
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
			
 | 
			
		||||
 | 
			
		||||
		</el-form>
 | 
			
		||||
 | 
			
		||||
		<div v-if="!isdetail" class="drawer-body__footer">
 | 
			
		||||
			<el-button type="primary" @click="goback()">取消</el-button>
 | 
			
		||||
			<el-button @click="goback()">取消</el-button>
 | 
			
		||||
			<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
		</div>
 | 
			
		||||
	</el-drawer>
 | 
			
		||||
@@ -184,7 +184,7 @@ export default {
 | 
			
		||||
				actualTime: undefined,
 | 
			
		||||
				responsible: undefined,
 | 
			
		||||
				description: undefined,
 | 
			
		||||
				origin: undefined,
 | 
			
		||||
				origin: 1,
 | 
			
		||||
				files: []
 | 
			
		||||
			},
 | 
			
		||||
			list: [],
 | 
			
		||||
@@ -219,9 +219,12 @@ export default {
 | 
			
		||||
		async setConfig() {
 | 
			
		||||
			const configres = await getcheckConfigByEqList({equipmentId: this.dataForm.equipmentId})
 | 
			
		||||
			this.configList = configres.data
 | 
			
		||||
			this.dataForm.configId = this.configList.filter(it => {
 | 
			
		||||
				return it.id === this.dataForm.configId
 | 
			
		||||
			})[0]?.id ?? undefined
 | 
			
		||||
			this.dataForm.equipmentCode = this.eqList.filter(item => {
 | 
			
		||||
				return item.id === this.dataForm.equipmentId
 | 
			
		||||
			})[0].code
 | 
			
		||||
			})[0]?.code ?? undefined
 | 
			
		||||
		},
 | 
			
		||||
		goback() {
 | 
			
		||||
			this.$emit('refreshDataList');
 | 
			
		||||
@@ -264,6 +267,7 @@ export default {
 | 
			
		||||
							this.file = this.dataForm.files[0].fileUrl
 | 
			
		||||
							this.fileName = this.dataForm.files[0].fileName
 | 
			
		||||
						}
 | 
			
		||||
						this.dataForm.description = this.dataForm.description || '无'
 | 
			
		||||
						this.setConfig()
 | 
			
		||||
          });
 | 
			
		||||
				} else {
 | 
			
		||||
 
 | 
			
		||||
@@ -93,7 +93,7 @@ export default {
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'configName', label: '配置名称' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称' },
 | 
			
		||||
				{ prop: 'origin', label: '数据来源', filter: (val) => ['', '手动', '自动'][val] },
 | 
			
		||||
				{ prop: 'origin', label: '数据来源', filter: (val) => ['', '手动', 'PDA'][val] },
 | 
			
		||||
				// { prop: 'sectionName', label: '计划巡检时间' },
 | 
			
		||||
				{ prop: 'actualTime', label: '实际巡检时间', filter: parseTime },
 | 
			
		||||
				// { prop: 'maintenanceDetail', label: '完成状态' },
 | 
			
		||||
@@ -130,6 +130,15 @@ export default {
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:check-record:export')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:check-record:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
@@ -139,17 +148,6 @@ export default {
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'success',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:check-record:export')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'warning',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
 
 | 
			
		||||
@@ -2,14 +2,14 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-11-27 10:48:55
 | 
			
		||||
 * @LastEditTime: 2023-12-01 11:02:43
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		:wrapper-closable="true"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="50%">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
@@ -43,6 +43,8 @@
 | 
			
		||||
				</el-form>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<el-divider />
 | 
			
		||||
 | 
			
		||||
			<div class="attr-list">
 | 
			
		||||
				<small-title
 | 
			
		||||
					style="margin: 16px 0; padding-left: 8px"
 | 
			
		||||
@@ -78,9 +80,9 @@
 | 
			
		||||
					:page-sizes="[5, 10, 15]"
 | 
			
		||||
					@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
				<div class="drawer-body__footer">
 | 
			
		||||
				<!-- <div class="drawer-body__footer">
 | 
			
		||||
					<el-button type="primary" @click="goback()">关闭</el-button>
 | 
			
		||||
				</div>
 | 
			
		||||
				</div> -->
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
		</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<el-dialog
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:width="'35%'"
 | 
			
		||||
		:width="'30%'"
 | 
			
		||||
		:append-to-body="true"
 | 
			
		||||
		:close-on-click-modal="false"
 | 
			
		||||
		class="dialog">
 | 
			
		||||
@@ -17,7 +17,7 @@
 | 
			
		||||
			ref="dataForm"
 | 
			
		||||
			:model="dataForm"
 | 
			
		||||
			:rules="dataRule"
 | 
			
		||||
			label-width="100px"
 | 
			
		||||
			label-width="60px"
 | 
			
		||||
			@keyup.enter.native="dataFormSubmit()">
 | 
			
		||||
			<el-form-item label="巡检" prop="checkId">
 | 
			
		||||
				<el-select v-model="dataForm.checkId" filterable placeholder="请选择巡检" style="width: 100%">
 | 
			
		||||
 
 | 
			
		||||
@@ -66,6 +66,13 @@ export default {
 | 
			
		||||
			addOrEditTitle: '',
 | 
			
		||||
			searchBarKeys: ['equipmentId', 'name'],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('equipment:check-setting:addInsp')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'add',
 | 
			
		||||
							btnName: '添加',
 | 
			
		||||
							showTip: '添加巡检'
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:check-setting:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
@@ -78,12 +85,6 @@ export default {
 | 
			
		||||
							btnName: '查看详情',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:check-setting:addInsp')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'add',
 | 
			
		||||
							btnName: '添加巡检',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:check-setting:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
@@ -92,12 +93,12 @@ export default {
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'name', label: '配置名' },
 | 
			
		||||
				{ prop: 'code', label: '编码' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备' },
 | 
			
		||||
				{ prop: 'equipmentCode', label: '设备编码' },
 | 
			
		||||
				{ prop: 'name', label: '配置名', width: 110, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'code', label: '编码', minWidth: 150, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'lineName', label: '产线', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'equipmentCode', label: '设备编码', minWidth: 150, showOverflowtooltip: true },
 | 
			
		||||
				// { prop: 'responsible', label: '负责人' },
 | 
			
		||||
				{ prop: 'checkNumber', label: '巡检条数' }, // TODO: 操作 选项,四个,群里询问
 | 
			
		||||
			],
 | 
			
		||||
 
 | 
			
		||||
@@ -176,7 +176,8 @@ export default {
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'warning',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
 
 | 
			
		||||
@@ -162,6 +162,15 @@ export default {
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:maintain-record:export')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:maintain-record:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
 
 | 
			
		||||
@@ -1,176 +1,173 @@
 | 
			
		||||
<!-- 
 | 
			
		||||
 | 
			
		||||
首页
 | 
			
		||||
工单管理
 | 
			
		||||
合并请求
 | 
			
		||||
里程碑
 | 
			
		||||
探索
 | 
			
		||||
 通知469
 | 
			
		||||
 创建…
 | 
			
		||||
 个人信息和配置
 | 
			
		||||
 mt-fe-group / yudao-dev
 | 
			
		||||
取消关注
 | 
			
		||||
11
 | 
			
		||||
点赞
 | 
			
		||||
0
 | 
			
		||||
派生
 | 
			
		||||
0
 | 
			
		||||
代码
 | 
			
		||||
工单
 | 
			
		||||
0
 | 
			
		||||
合并请求
 | 
			
		||||
0
 | 
			
		||||
版本发布
 | 
			
		||||
0
 | 
			
		||||
百科
 | 
			
		||||
动态
 | 
			
		||||
 559 提交
 | 
			
		||||
 25 分支
 | 
			
		||||
 145 MiB
 | 
			
		||||
 分支: projects/mes-test
 | 
			
		||||
yudao-dev/src/views/equipment/base/repair/CustomDialogForm.vue
 | 
			
		||||
346 行
 | 
			
		||||
8.9 KiB
 | 
			
		||||
原始文件
 | 
			
		||||
永久链接
 | 
			
		||||
Blame
 | 
			
		||||
文件历史
 | 
			
		||||
 | 
			
		||||
<!--
 | 
			
		||||
    filename: dialogForm.vue
 | 
			
		||||
    author: liubin
 | 
			
		||||
    date: 2023-10-31 15:55:13
 | 
			
		||||
    description: 
 | 
			
		||||
    description:
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="60%">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
			{{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }}
 | 
			
		||||
		</small-title>
 | 
			
		||||
		<el-form
 | 
			
		||||
			ref="form"
 | 
			
		||||
			:model="dataForm"
 | 
			
		||||
			label-width="100px"
 | 
			
		||||
			label-position="top"
 | 
			
		||||
			v-loading="formLoading">
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item label="维修单号" prop="repairOrderNumber">
 | 
			
		||||
						<span>{{ dataForm.repairOrderNumber }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item label="设备名称" prop="equipmentName">
 | 
			
		||||
						<span>{{ dataForm.equipmentName }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item label="维修工" prop="repairman">
 | 
			
		||||
						<span>{{ dataForm.repairman }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item label="故障发生时间" prop="faultTime">
 | 
			
		||||
						<span>{{ parseTime(dataForm.faultTime) }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item label="故障级别" prop="faultLevel">
 | 
			
		||||
						<span>{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item label="联系方式" prop="repairmanPhone">
 | 
			
		||||
						<span>{{ dataForm.repairmanPhone }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
 | 
			
		||||
				{{ '可编辑信息' }}
 | 
			
		||||
			</small-title>
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item
 | 
			
		||||
						label="维修开始时间"
 | 
			
		||||
						prop="maintenanceStartTime"
 | 
			
		||||
						:rules="[{ required: true, message: '维修开始时间不能为空', trigger: 'blur' }]">
 | 
			
		||||
						<el-date-picker
 | 
			
		||||
							v-model="dataForm.maintenanceStartTime"
 | 
			
		||||
							type="datetime"
 | 
			
		||||
							:disabled="disabled"
 | 
			
		||||
							placeholder="请选择维修开始时间"
 | 
			
		||||
							value-format="timestamp" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
  <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="disabled" class="drawer"
 | 
			
		||||
    custom-class="mes-drawer" size="65%" @closed="$emit('destroy')">
 | 
			
		||||
    <small-title slot="title" :no-padding="true">
 | 
			
		||||
      {{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }}
 | 
			
		||||
    </small-title>
 | 
			
		||||
    <div class="drawer-body flex">
 | 
			
		||||
      <div class="drawer-body__content">
 | 
			
		||||
        <el-form ref="form" :model="dataForm" label-width="100px" label-position="top" v-loading="formLoading">
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col :span="8">
 | 
			
		||||
              <el-form-item label="维修单号" prop="repairOrderNumber">
 | 
			
		||||
                <span>{{ dataForm.repairOrderNumber }}</span>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="8">
 | 
			
		||||
              <el-form-item label="设备名称" prop="equipmentName">
 | 
			
		||||
                <span>{{ dataForm.equipmentName }}</span>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="8">
 | 
			
		||||
              <el-form-item label="维修工" prop="repairman">
 | 
			
		||||
                <span>{{ dataForm.repairman }}</span>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col :span="8">
 | 
			
		||||
              <el-form-item label="故障发生时间" prop="faultTime">
 | 
			
		||||
                <span>{{ parseTime(dataForm.faultTime) }}</span>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="8">
 | 
			
		||||
              <el-form-item label="故障级别" prop="faultLevel">
 | 
			
		||||
                <span>{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</span>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="8">
 | 
			
		||||
              <el-form-item label="联系方式" prop="repairmanPhone">
 | 
			
		||||
                <span>{{ dataForm.repairmanPhone }}</span>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item
 | 
			
		||||
						label="维修结束时间"
 | 
			
		||||
						prop="maintenanceFinishTime"
 | 
			
		||||
						:rules="[{ required: true, message: '维修结束时间不能为空', trigger: 'blur' }]">
 | 
			
		||||
						<el-date-picker
 | 
			
		||||
							v-model="dataForm.maintenanceFinishTime"
 | 
			
		||||
							type="datetime"
 | 
			
		||||
							:disabled="disabled"
 | 
			
		||||
							placeholder="请选择维修开始时间"
 | 
			
		||||
							value-format="timestamp" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
          <el-divider style="margin-top: -10px" />
 | 
			
		||||
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item
 | 
			
		||||
						label="维修方式"
 | 
			
		||||
						prop="repairMode"
 | 
			
		||||
						:rules="[{ required: true, message: '维修方式不能为空', trigger: 'blur' }]">
 | 
			
		||||
						<el-select
 | 
			
		||||
							:disabled="disabled"
 | 
			
		||||
							v-model="dataForm.repairMode"
 | 
			
		||||
							placeholder="请选择维修方式">
 | 
			
		||||
							<el-option
 | 
			
		||||
								v-for="opt in getDictDatas('repair-mode')"
 | 
			
		||||
								:key="opt.value"
 | 
			
		||||
								:label="opt.label"
 | 
			
		||||
								:value="opt.value" />
 | 
			
		||||
						</el-select>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item label="故障类型" prop="faultType">
 | 
			
		||||
						<el-select
 | 
			
		||||
							:disabled="disabled"
 | 
			
		||||
							v-model="dataForm.faultType"
 | 
			
		||||
							placeholder="请选择故障类型">
 | 
			
		||||
							<el-option
 | 
			
		||||
								v-for="opt in getDictDatas('fault-type')"
 | 
			
		||||
								:key="opt.value"
 | 
			
		||||
								:label="opt.label"
 | 
			
		||||
								:value="opt.value" />
 | 
			
		||||
						</el-select>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
          <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
 | 
			
		||||
            {{ '设备维修信息' }}
 | 
			
		||||
          </small-title>
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col :span="6">
 | 
			
		||||
              <el-form-item label="维修开始时间" prop="maintenanceStartTime"
 | 
			
		||||
                :rules="[{ required: true, message: '维修开始时间不能为空', trigger: 'blur' }]">
 | 
			
		||||
                <el-date-picker v-model="dataForm.maintenanceStartTime" type="datetime" :disabled="disabled"
 | 
			
		||||
                  placeholder="请选择维修开始时间" value-format="timestamp" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="6">
 | 
			
		||||
              <el-form-item label="维修结束时间" prop="maintenanceFinishTime"
 | 
			
		||||
                :rules="[{ required: true, message: '维修结束时间不能为空', trigger: 'blur' }]">
 | 
			
		||||
                <el-date-picker v-model="dataForm.maintenanceFinishTime" type="datetime" :disabled="disabled"
 | 
			
		||||
                  placeholder="请选择维修开始时间" value-format="timestamp" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="6">
 | 
			
		||||
              <el-form-item label="维修方式" prop="repairMode"
 | 
			
		||||
                :rules="[{ required: true, message: '维修方式不能为空', trigger: 'blur' }]">
 | 
			
		||||
                <el-select :disabled="disabled" v-model="dataForm.repairMode" placeholder="请选择维修方式">
 | 
			
		||||
                  <el-option v-for="opt in getDictDatas('repair-mode')" :key="opt.value" :label="opt.label"
 | 
			
		||||
                    :value="opt.value" />
 | 
			
		||||
                </el-select>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="6">
 | 
			
		||||
              <el-form-item label="故障类型" prop="faultType">
 | 
			
		||||
                <el-select :disabled="disabled" v-model="dataForm.faultType" placeholder="请选择故障类型">
 | 
			
		||||
                  <el-option v-for="opt in getDictDatas('fault-type')" :key="opt.value" :label="opt.label"
 | 
			
		||||
                    :value="opt.value" />
 | 
			
		||||
                </el-select>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col>
 | 
			
		||||
					<el-form-item
 | 
			
		||||
						label="故障明细"
 | 
			
		||||
						prop="faultDetail"
 | 
			
		||||
						:rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
 | 
			
		||||
						<!-- // 富文本 -->
 | 
			
		||||
						<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="380"/>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col>
 | 
			
		||||
              <el-form-item label="故障明细" prop="faultDetail"
 | 
			
		||||
                :rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
 | 
			
		||||
                <!-- // 富文本 -->
 | 
			
		||||
                <editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col>
 | 
			
		||||
					<el-form-item label="维修记录" prop="maintenanceDetail">
 | 
			
		||||
						<!-- // 富文本 -->
 | 
			
		||||
						<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="380"/>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col>
 | 
			
		||||
              <el-form-item label="维修记录" prop="maintenanceDetail">
 | 
			
		||||
                <!-- // 富文本 -->
 | 
			
		||||
                <editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col>
 | 
			
		||||
					<el-form-item label="维修附件" prop="file">
 | 
			
		||||
						<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col>
 | 
			
		||||
              <el-form-item label="维修附件" prop="file">
 | 
			
		||||
                <FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col>
 | 
			
		||||
					<el-form-item label="备注" prop="remark">
 | 
			
		||||
						<el-input
 | 
			
		||||
							v-model="dataForm.remark"
 | 
			
		||||
							:placeholder="`请输入备注`"
 | 
			
		||||
							:disabled="disabled" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
		</el-form>
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col>
 | 
			
		||||
              <el-form-item label="备注" prop="remark">
 | 
			
		||||
                <el-input v-model="dataForm.remark" :placeholder="`请输入备注`" :disabled="disabled" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
        </el-form>
 | 
			
		||||
 | 
			
		||||
		<div class="drawer-body__footer">
 | 
			
		||||
			<el-button style="" @click="goback()">{{ disabled ? '返回' : '取消' }}</el-button>
 | 
			
		||||
			<!-- <el-button v-if="disabled" type="primary" @click="goEdit()">
 | 
			
		||||
				编辑
 | 
			
		||||
			</el-button> -->
 | 
			
		||||
			<el-button v-if="!disabled" type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
		</div>
 | 
			
		||||
	</el-drawer>
 | 
			
		||||
        <div v-if="!disabled" class="drawer-body__footer">
 | 
			
		||||
          <el-button style="" @click="goback()">取消</el-button>
 | 
			
		||||
          <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </el-drawer>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
@@ -183,102 +180,102 @@ import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { getDictDataLabel } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'DialogForm',
 | 
			
		||||
	model: {
 | 
			
		||||
		prop: 'dataForm',
 | 
			
		||||
		event: 'update',
 | 
			
		||||
	},
 | 
			
		||||
	emits: ['update'],
 | 
			
		||||
	components: { SmallTitle, Editor, FileUpload },
 | 
			
		||||
	props: {
 | 
			
		||||
		// dataForm: {
 | 
			
		||||
		// 	type: Object,
 | 
			
		||||
		// 	default: () => ({}),
 | 
			
		||||
		// },
 | 
			
		||||
		// disabled: {
 | 
			
		||||
		// 	type: Boolean,
 | 
			
		||||
		// 	default: false
 | 
			
		||||
		// },
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formLoading: true,
 | 
			
		||||
			visible: false,
 | 
			
		||||
			disabled: false,
 | 
			
		||||
			dataForm: {},
 | 
			
		||||
			file: '',
 | 
			
		||||
			fileName: ''
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {},
 | 
			
		||||
	methods: {
 | 
			
		||||
		setFileName(val) {
 | 
			
		||||
			this.fileName = val
 | 
			
		||||
		},
 | 
			
		||||
		goback() {
 | 
			
		||||
			this.$emit('refreshDataList');
 | 
			
		||||
			this.visible = false;
 | 
			
		||||
		},
 | 
			
		||||
		goEdit() {
 | 
			
		||||
			this.disabled = false;
 | 
			
		||||
		},
 | 
			
		||||
		/** 模拟透传 ref  */
 | 
			
		||||
		validate(cb) {
 | 
			
		||||
			return this.$refs.form.validate(cb);
 | 
			
		||||
		},
 | 
			
		||||
		resetFields(args) {
 | 
			
		||||
			return this.$refs.form.resetFields(args);
 | 
			
		||||
		},
 | 
			
		||||
		initData() {
 | 
			
		||||
			this.file = ''
 | 
			
		||||
			this.fileName = ''
 | 
			
		||||
		},
 | 
			
		||||
		init(row, isdetail) {
 | 
			
		||||
			this.initData();
 | 
			
		||||
			this.disabled = isdetail || false;
 | 
			
		||||
			this.dataForm.id = row.id || undefined;
 | 
			
		||||
			this.visible = true;
 | 
			
		||||
  name: 'DialogForm',
 | 
			
		||||
  model: {
 | 
			
		||||
    prop: 'dataForm',
 | 
			
		||||
    event: 'update',
 | 
			
		||||
  },
 | 
			
		||||
  emits: ['update'],
 | 
			
		||||
  components: { SmallTitle, Editor, FileUpload },
 | 
			
		||||
  props: {
 | 
			
		||||
    // dataForm: {
 | 
			
		||||
    // 	type: Object,
 | 
			
		||||
    // 	default: () => ({}),
 | 
			
		||||
    // },
 | 
			
		||||
    // disabled: {
 | 
			
		||||
    // 	type: Boolean,
 | 
			
		||||
    // 	default: false
 | 
			
		||||
    // },
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formLoading: true,
 | 
			
		||||
      visible: false,
 | 
			
		||||
      disabled: false,
 | 
			
		||||
      dataForm: {},
 | 
			
		||||
      file: '',
 | 
			
		||||
      fileName: ''
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  mounted() { },
 | 
			
		||||
  methods: {
 | 
			
		||||
    setFileName(val) {
 | 
			
		||||
      this.fileName = val
 | 
			
		||||
    },
 | 
			
		||||
    goback() {
 | 
			
		||||
      this.$emit('refreshDataList');
 | 
			
		||||
      this.visible = false;
 | 
			
		||||
    },
 | 
			
		||||
    goEdit() {
 | 
			
		||||
      this.disabled = false;
 | 
			
		||||
    },
 | 
			
		||||
    /** 模拟透传 ref  */
 | 
			
		||||
    validate(cb) {
 | 
			
		||||
      return this.$refs.form.validate(cb);
 | 
			
		||||
    },
 | 
			
		||||
    resetFields(args) {
 | 
			
		||||
      return this.$refs.form.resetFields(args);
 | 
			
		||||
    },
 | 
			
		||||
    initData() {
 | 
			
		||||
      this.file = ''
 | 
			
		||||
      this.fileName = ''
 | 
			
		||||
    },
 | 
			
		||||
    init(row, isdetail) {
 | 
			
		||||
      this.initData();
 | 
			
		||||
      this.disabled = isdetail || false;
 | 
			
		||||
      this.dataForm.id = row.id || undefined;
 | 
			
		||||
      this.visible = true;
 | 
			
		||||
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs['form'].resetFields();
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs['form'].resetFields();
 | 
			
		||||
 | 
			
		||||
				if (this.dataForm.id) {
 | 
			
		||||
					// 获取设备维修
 | 
			
		||||
					getEqRepair(this.dataForm.id).then(response => {
 | 
			
		||||
						this.formLoading = false
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          // 获取设备维修
 | 
			
		||||
          getEqRepair(this.dataForm.id).then(response => {
 | 
			
		||||
            this.formLoading = false
 | 
			
		||||
            this.dataForm = response.data;
 | 
			
		||||
						this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
 | 
			
		||||
						if (this.dataForm.files.length > 0) {
 | 
			
		||||
							this.file = this.dataForm.files[0].fileUrl
 | 
			
		||||
							this.fileName = this.dataForm.files[0].fileName
 | 
			
		||||
						}
 | 
			
		||||
            this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
 | 
			
		||||
            if (this.dataForm.files.length > 0) {
 | 
			
		||||
              this.file = this.dataForm.files[0].fileUrl
 | 
			
		||||
              this.fileName = this.dataForm.files[0].fileName
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
				} else {
 | 
			
		||||
					// if (this.urlOptions.isGetCode) {
 | 
			
		||||
        } else {
 | 
			
		||||
          // if (this.urlOptions.isGetCode) {
 | 
			
		||||
          //   this.getCode()
 | 
			
		||||
          // }
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 表单提交
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    // 表单提交
 | 
			
		||||
    dataFormSubmit() {
 | 
			
		||||
      this.$refs["form"].validate((valid) => {
 | 
			
		||||
        if (!valid) {
 | 
			
		||||
          return false;
 | 
			
		||||
        }
 | 
			
		||||
        // 修改的提交
 | 
			
		||||
				if (this.file) {
 | 
			
		||||
					const temp = this.file.split(',') // 获取文件个数
 | 
			
		||||
					let arry = []
 | 
			
		||||
					temp.forEach(item => {
 | 
			
		||||
						arry.push({
 | 
			
		||||
							fileName: this.fileName,
 | 
			
		||||
							fileType: 2,
 | 
			
		||||
							fileUrl: item
 | 
			
		||||
						})
 | 
			
		||||
					})
 | 
			
		||||
					this.dataForm.files = arry
 | 
			
		||||
				}
 | 
			
		||||
        if (this.file) {
 | 
			
		||||
          const temp = this.file.split(',') // 获取文件个数
 | 
			
		||||
          let arry = []
 | 
			
		||||
          temp.forEach(item => {
 | 
			
		||||
            arry.push({
 | 
			
		||||
              fileName: this.fileName,
 | 
			
		||||
              fileType: 2,
 | 
			
		||||
              fileUrl: item
 | 
			
		||||
            })
 | 
			
		||||
          })
 | 
			
		||||
          this.dataForm.files = arry
 | 
			
		||||
        }
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          updateEqRepair(this.dataForm).then(response => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
@@ -295,66 +292,49 @@ export default {
 | 
			
		||||
        // });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
	},
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.el-date-editor,
 | 
			
		||||
.el-select {
 | 
			
		||||
	width: 100%;
 | 
			
		||||
}
 | 
			
		||||
.drawer-body__footer {
 | 
			
		||||
	display: flex;
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
.drawer >>> .el-drawer {
 | 
			
		||||
	border-radius: 8px 0 0 8px;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
.drawer>>>.el-drawer {
 | 
			
		||||
  border-radius: 8px 0 0 8px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-form-item__label {
 | 
			
		||||
	padding: 0;
 | 
			
		||||
.drawer>>>.el-drawer__header {
 | 
			
		||||
  margin: 0;
 | 
			
		||||
  padding: 32px 32px 24px;
 | 
			
		||||
  border-bottom: 1px solid #dcdfe6;
 | 
			
		||||
  margin-bottom: 0px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-drawer__header {
 | 
			
		||||
	margin: 0;
 | 
			
		||||
	padding: 32px 32px 24px;
 | 
			
		||||
	border-bottom: 1px solid #dcdfe6;
 | 
			
		||||
}
 | 
			
		||||
.drawer >>> .el-drawer__body {
 | 
			
		||||
	flex: 1;
 | 
			
		||||
	height: 1px;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
.small-title::before {
 | 
			
		||||
  content: '';
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  vertical-align: top;
 | 
			
		||||
  width: 4px;
 | 
			
		||||
  height: 22px;
 | 
			
		||||
  border-radius: 1px;
 | 
			
		||||
  margin-right: 8px;
 | 
			
		||||
  background-color: #0b58ff;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .content {
 | 
			
		||||
	padding: 30px 24px;
 | 
			
		||||
	flex: 1;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
	/* height: 100%; */
 | 
			
		||||
.drawer-body {
 | 
			
		||||
  display: flex;
 | 
			
		||||
  flex-direction: column;
 | 
			
		||||
  height: 100%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .visual-part {
 | 
			
		||||
	flex: 1 auto;
 | 
			
		||||
	max-height: 76vh;
 | 
			
		||||
	overflow: hidden;
 | 
			
		||||
	overflow-y: scroll;
 | 
			
		||||
	padding-right: 10px; /* 调整滚动条样式 */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-form,
 | 
			
		||||
.drawer >>> .attr-list {
 | 
			
		||||
	padding: 0 16px;
 | 
			
		||||
.drawer-body__content {
 | 
			
		||||
  flex: 1;
 | 
			
		||||
  /* background: #eee; */
 | 
			
		||||
  padding: 20px 30px;
 | 
			
		||||
  overflow-y: auto;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer-body__footer {
 | 
			
		||||
	display: flex;
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
  display: flex;
 | 
			
		||||
  justify-content: flex-end;
 | 
			
		||||
  padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										35
									
								
								src/views/equipment/base/repair/htmls.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								src/views/equipment/base/repair/htmls.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-08 14:00:52
 | 
			
		||||
 * @LastEditTime: 2023-12-01 10:12:27
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div v-html="content" />
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  props: {
 | 
			
		||||
    injectData: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => ({})
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      content: ''
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getContent()
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  methods: {
 | 
			
		||||
    getContent() {
 | 
			
		||||
      this.content = this.injectData[this.injectData.prop] ?? ''
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@@ -58,6 +58,7 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
import CustomDialogForm from './CustomDialogForm.vue';
 | 
			
		||||
import { deleteRepair, exportRepairLogExcel } from '@/api/equipment/base/repair'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import htmls from './htmls.vue'
 | 
			
		||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
@@ -117,11 +118,11 @@ export default {
 | 
			
		||||
				{ prop: 'maintenanceDuration', label: '维修时长(h)' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称' },
 | 
			
		||||
				{ prop: 'maintenanceDetail', label: '维修明细' },
 | 
			
		||||
				{ prop: 'repairman', label: '维修工' },
 | 
			
		||||
				{ prop: 'repairmanPhone', label: '联系方式' },
 | 
			
		||||
				{ prop: 'remark', label: '备注' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'maintenanceDetail', label: '维修明细', subcomponent: htmls, minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'remark', label: '备注', minWidth: 120, showOverflowtooltip: true },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
@@ -165,6 +166,13 @@ export default {
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:repair:export') ? 'button' : '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:repair:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
@@ -172,12 +180,6 @@ export default {
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'success',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('equipment:repair:export') ? 'button' : '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'warning',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
 
 | 
			
		||||
@@ -9,72 +9,80 @@
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		:wrapper-closable="disabled"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="60%">
 | 
			
		||||
		size="60%"
 | 
			
		||||
		@closed="$emit('destroy')">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
			{{ disabled ? '查看备件' : '添加备件' }}
 | 
			
		||||
		</small-title>
 | 
			
		||||
		<el-form
 | 
			
		||||
			ref="form"
 | 
			
		||||
			:model="dataForm"
 | 
			
		||||
			label-width="100px"
 | 
			
		||||
			v-loading="formLoading">
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="配置名" prop="name">
 | 
			
		||||
						<span>{{ dataForm.name }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="设备名称" prop="equipmentName">
 | 
			
		||||
						<span>{{ dataForm.equipmentName }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="负责人" prop="responsible">
 | 
			
		||||
						<span>{{ dataForm.responsible }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-form-item label="描述" prop="faultTime">
 | 
			
		||||
				<editor v-model="dataForm.description" read-only :min-height="200"/>
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
		</el-form>
 | 
			
		||||
		<div class="content">
 | 
			
		||||
			<el-form
 | 
			
		||||
				ref="form"
 | 
			
		||||
				:model="dataForm"
 | 
			
		||||
				label-width="100px"
 | 
			
		||||
				label-position="top"
 | 
			
		||||
				v-loading="formLoading">
 | 
			
		||||
				<el-row :gutter="20">
 | 
			
		||||
					<el-col :span="6">
 | 
			
		||||
						<el-form-item label="配置名" prop="name">
 | 
			
		||||
							<span>{{ dataForm.name }}</span>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-col>
 | 
			
		||||
					<el-col :span="6">
 | 
			
		||||
						<el-form-item label="设备名称" prop="equipmentName">
 | 
			
		||||
							<span>{{ dataForm.equipmentName }}</span>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-col>
 | 
			
		||||
					<el-col :span="6">
 | 
			
		||||
						<el-form-item label="负责人" prop="responsible">
 | 
			
		||||
							<span>{{ dataForm.responsible }}</span>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-col>
 | 
			
		||||
				</el-row>
 | 
			
		||||
				<el-form-item label="描述" prop="description">
 | 
			
		||||
					<div v-html="dataForm.description" style="padding: 5px; margin: 0; border: 1px solid #dfdfdf" />
 | 
			
		||||
					<!-- <editor v-model="dataForm.description" read-only :min-height="200"/> -->
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-form>
 | 
			
		||||
			
 | 
			
		||||
			<div v-if="!disabled" class="action_btn">
 | 
			
		||||
				<template>
 | 
			
		||||
					<span style="display: inline-block;" @click="addNew()">
 | 
			
		||||
						<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
 | 
			
		||||
						<span class="add">添加</span>
 | 
			
		||||
					</span>
 | 
			
		||||
				</template>
 | 
			
		||||
			</div>
 | 
			
		||||
			<base-table
 | 
			
		||||
				:table-props="tableProps"
 | 
			
		||||
				:page="listQuery.pageNo"
 | 
			
		||||
				:limit="listQuery.pageSize"
 | 
			
		||||
				:table-data="list">
 | 
			
		||||
				<method-btn
 | 
			
		||||
					v-if="!disabled"
 | 
			
		||||
					slot="handleBtn"
 | 
			
		||||
					:width="120"
 | 
			
		||||
					label="操作"
 | 
			
		||||
					:method-list="tableBtn"
 | 
			
		||||
					@clickBtn="handleClick" />
 | 
			
		||||
			</base-table>
 | 
			
		||||
			<pagination
 | 
			
		||||
				v-show="listQuery.total > 0"
 | 
			
		||||
				:total="listQuery.total"
 | 
			
		||||
				:page.sync="listQuery.pageNo"
 | 
			
		||||
				:limit.sync="listQuery.pageSize"
 | 
			
		||||
				:page-sizes="[5, 10, 15]"
 | 
			
		||||
				@pagination="getList" />
 | 
			
		||||
			<div>
 | 
			
		||||
				<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
 | 
			
		||||
					{{ '备品备件' }}
 | 
			
		||||
				</small-title>
 | 
			
		||||
				<div v-if="!disabled" class="action_btn">
 | 
			
		||||
					<template>
 | 
			
		||||
						<span style="display: inline-block;" @click="addNew()">
 | 
			
		||||
							<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
 | 
			
		||||
							<span class="add">添加</span>
 | 
			
		||||
						</span>
 | 
			
		||||
					</template>
 | 
			
		||||
				</div>
 | 
			
		||||
				<base-table
 | 
			
		||||
					:table-props="tableProps"
 | 
			
		||||
					:page="listQuery.pageNo"
 | 
			
		||||
					:limit="listQuery.pageSize"
 | 
			
		||||
					:table-data="list">
 | 
			
		||||
					<method-btn
 | 
			
		||||
						v-if="!disabled"
 | 
			
		||||
						slot="handleBtn"
 | 
			
		||||
						:width="120"
 | 
			
		||||
						label="操作"
 | 
			
		||||
						:method-list="tableBtn"
 | 
			
		||||
						@clickBtn="handleClick" />
 | 
			
		||||
				</base-table>
 | 
			
		||||
				<pagination
 | 
			
		||||
					v-show="listQuery.total > 0"
 | 
			
		||||
					:total="listQuery.total"
 | 
			
		||||
					:page.sync="listQuery.pageNo"
 | 
			
		||||
					:limit.sync="listQuery.pageSize"
 | 
			
		||||
					:page-sizes="[5, 10, 15]"
 | 
			
		||||
					@pagination="getList" />
 | 
			
		||||
			</div>	
 | 
			
		||||
 | 
			
		||||
		<div class="drawer-body__footer">
 | 
			
		||||
			<el-button type="primary" @click="goback()">关闭</el-button>
 | 
			
		||||
			<div v-if="!disabled" class="drawer-body__footer">
 | 
			
		||||
				<el-button type="primary" @click="goback()">关闭</el-button>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<attr-add
 | 
			
		||||
@@ -255,10 +263,10 @@ export default {
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
.action_btn {
 | 
			
		||||
  /* float: right; */
 | 
			
		||||
  float: right;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	justify-content: right;
 | 
			
		||||
  margin: 5px 15px;
 | 
			
		||||
  margin: -35px 15px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
.add {
 | 
			
		||||
@@ -312,4 +320,7 @@ export default {
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
.content {
 | 
			
		||||
	padding: 0 20px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="250"
 | 
			
		||||
				:width="180"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
@@ -34,7 +34,7 @@
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			width="35%"
 | 
			
		||||
			width="50%"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
@@ -44,12 +44,14 @@
 | 
			
		||||
				v-model="form"
 | 
			
		||||
				:disabled="mode == 'detail'"
 | 
			
		||||
				:has-files="false"
 | 
			
		||||
				:rows="rows" />
 | 
			
		||||
				:rows="rows"
 | 
			
		||||
				style="margin: 0 30px" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
		<addSparts
 | 
			
		||||
			v-if="addOrUpdateVisible"
 | 
			
		||||
			ref="addOrUpdate"
 | 
			
		||||
			@refreshDataList="getList" />
 | 
			
		||||
			@refreshDataList="getList"
 | 
			
		||||
			@destroy="addOrUpdateVisible = false" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -79,22 +81,24 @@ export default {
 | 
			
		||||
				// 			btnName: '详情',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:update')
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:addParts')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
							type: 'addParts',
 | 
			
		||||
							btnName: '添加',
 | 
			
		||||
							showTip: '添加备件'
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:queryParts')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'queryParts',
 | 
			
		||||
							btnName: '查看备件',
 | 
			
		||||
							btnName: '查看',
 | 
			
		||||
							showTip: '查看备件'
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:addParts')
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'addParts',
 | 
			
		||||
							btnName: '添加备件',
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:spare-parts-config:delete')
 | 
			
		||||
@@ -105,15 +109,15 @@ export default {
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'name', label: '配置名' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名' },
 | 
			
		||||
				{ prop: 'equipmentCode', label: '设备编码' },
 | 
			
		||||
				{ prop: 'responsible', label: '负责人' },
 | 
			
		||||
				{ prop: 'name', label: '配置名', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'lineName', label: '产线', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名', minWidth: 120, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'equipmentCode', label: '设备编码', minWidth: 100, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'responsible', label: '负责人', minWidth: 150, showOverflowtooltip: true },
 | 
			
		||||
				// { prop: 'unit', label: '单位', filter: publicFormatter('unit_dict') },
 | 
			
		||||
				{ prop: 'description', label: '描述', subcomponent: htmls },
 | 
			
		||||
				{ prop: 'sparePartNumber', label: '备品备件数量' },
 | 
			
		||||
				{ prop: 'description', label: '描述', subcomponent: htmls, minWidth: 120, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'sparePartNumber', label: '备品备件数量', width: 130 },
 | 
			
		||||
				// { prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
@@ -198,7 +202,7 @@ export default {
 | 
			
		||||
						prop: 'description', // TODO: 富文本
 | 
			
		||||
						subcomponent: Editor,
 | 
			
		||||
						bind: {
 | 
			
		||||
							'min-height': 192
 | 
			
		||||
							'min-height': 150
 | 
			
		||||
						}
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
 
 | 
			
		||||
@@ -9,81 +9,84 @@
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="false"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		:wrapper-closable="!isLog"
 | 
			
		||||
		class="drawer"
 | 
			
		||||
		size="60%">
 | 
			
		||||
		<small-title slot="title" :no-padding="true">
 | 
			
		||||
			{{ !isLog ? '操作页面' : '更换记录' }}
 | 
			
		||||
		</small-title>
 | 
			
		||||
		<el-form
 | 
			
		||||
			ref="form"
 | 
			
		||||
			:model="dataForm"
 | 
			
		||||
			label-width="100px"
 | 
			
		||||
			v-loading="formLoading">
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item v-if="!isLog" label="配置名" prop="name">
 | 
			
		||||
						<span>{{ dataForm.name }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
					<el-form-item v-else label="产线名称" prop="lineName">
 | 
			
		||||
						<span>{{ dataForm.lineName }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="12">
 | 
			
		||||
					<el-form-item label="设备名称" prop="equipmentName">
 | 
			
		||||
						<span>{{ dataForm.equipmentName }}</span>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-form-item label="描述" prop="faultTime">
 | 
			
		||||
				<editor v-model="dataForm.description" read-only :min-height="200"/>
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
		</el-form>
 | 
			
		||||
		
 | 
			
		||||
		<div v-if="!isLog">
 | 
			
		||||
			<base-table
 | 
			
		||||
				:table-props="tableProps"
 | 
			
		||||
				:page="listQuery.pageNo"
 | 
			
		||||
				:limit="listQuery.pageSize"
 | 
			
		||||
				:table-data="list">
 | 
			
		||||
				<method-btn
 | 
			
		||||
					v-if="!isLog"
 | 
			
		||||
					slot="handleBtn"
 | 
			
		||||
					:width="120"
 | 
			
		||||
					label="操作"
 | 
			
		||||
					:method-list="tableBtn"
 | 
			
		||||
					@clickBtn="handleClick" />
 | 
			
		||||
			</base-table>
 | 
			
		||||
			<pagination
 | 
			
		||||
				v-show="listQuery.total > 0"
 | 
			
		||||
				:total="listQuery.total"
 | 
			
		||||
				:page.sync="listQuery.pageNo"
 | 
			
		||||
				:limit.sync="listQuery.pageSize"
 | 
			
		||||
				:page-sizes="[5, 10, 15]"
 | 
			
		||||
				@pagination="getList" />
 | 
			
		||||
		<div class="content">
 | 
			
		||||
			<el-form
 | 
			
		||||
				ref="form"
 | 
			
		||||
				:model="dataForm"
 | 
			
		||||
				label-width="90px"
 | 
			
		||||
				v-loading="formLoading">
 | 
			
		||||
				<el-row :gutter="20">
 | 
			
		||||
					<el-col :span="12">
 | 
			
		||||
						<el-form-item v-if="!isLog" label="配置名" prop="name">
 | 
			
		||||
							<span style="margin-left: 5px">{{ dataForm.name }}</span>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item v-else label="产线名称" prop="lineName">
 | 
			
		||||
							<span style="margin-left: 5px">{{ dataForm.lineName }}</span>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-col>
 | 
			
		||||
					<el-col :span="12">
 | 
			
		||||
						<el-form-item label="设备名称" prop="equipmentName">
 | 
			
		||||
							<span style="margin-left: 5px">{{ dataForm.equipmentName }}</span>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-col>
 | 
			
		||||
				</el-row>
 | 
			
		||||
				<el-form-item label="描述" prop="description">
 | 
			
		||||
					<div v-html="dataForm.description" style="padding: 5px; margin-left: 5px; border: 1px solid #dfdfdf" />
 | 
			
		||||
					<!-- <editor v-model="dataForm.description" :read-only="true" :min-height="200"/> -->
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-form>
 | 
			
		||||
			
 | 
			
		||||
			<div v-if="!isLog">
 | 
			
		||||
				<base-table
 | 
			
		||||
					:table-props="tableProps"
 | 
			
		||||
					:page="listQuery.pageNo"
 | 
			
		||||
					:limit="listQuery.pageSize"
 | 
			
		||||
					:table-data="list">
 | 
			
		||||
					<method-btn
 | 
			
		||||
						v-if="!isLog"
 | 
			
		||||
						slot="handleBtn"
 | 
			
		||||
						:width="120"
 | 
			
		||||
						label="操作"
 | 
			
		||||
						:method-list="tableBtn"
 | 
			
		||||
						@clickBtn="handleClick" />
 | 
			
		||||
				</base-table>
 | 
			
		||||
				<pagination
 | 
			
		||||
					v-show="listQuery.total > 0"
 | 
			
		||||
					:total="listQuery.total"
 | 
			
		||||
					:page.sync="listQuery.pageNo"
 | 
			
		||||
					:limit.sync="listQuery.pageSize"
 | 
			
		||||
					:page-sizes="[5, 10, 15]"
 | 
			
		||||
					@pagination="getList" />
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<div v-else>
 | 
			
		||||
				<!-- 搜索工作栏 -->
 | 
			
		||||
				<SearchBar
 | 
			
		||||
					:formConfigs="formConfig"
 | 
			
		||||
					ref="search-bar"
 | 
			
		||||
					@headBtnClick="buttonClick" />
 | 
			
		||||
				<base-table
 | 
			
		||||
					:table-props="tableProps1"
 | 
			
		||||
					:page="listQuery1.pageNo"
 | 
			
		||||
					:limit="listQuery1.pageSize"
 | 
			
		||||
					:table-data="list1" />
 | 
			
		||||
				<pagination
 | 
			
		||||
					v-show="listQuery1.total > 0"
 | 
			
		||||
					:total="listQuery1.total"
 | 
			
		||||
					:page.sync="listQuery1.pageNo"
 | 
			
		||||
					:limit.sync="listQuery1.pageSize"
 | 
			
		||||
					:page-sizes="[5, 10, 15]"
 | 
			
		||||
					@pagination="getList1" />
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<div v-else>
 | 
			
		||||
			<!-- 搜索工作栏 -->
 | 
			
		||||
			<SearchBar
 | 
			
		||||
				:formConfigs="formConfig"
 | 
			
		||||
				ref="search-bar"
 | 
			
		||||
				@headBtnClick="buttonClick" />
 | 
			
		||||
			<base-table
 | 
			
		||||
				:table-props="tableProps1"
 | 
			
		||||
				:page="listQuery1.pageNo"
 | 
			
		||||
				:limit="listQuery1.pageSize"
 | 
			
		||||
				:table-data="list1" />
 | 
			
		||||
			<pagination
 | 
			
		||||
				v-show="listQuery1.total > 0"
 | 
			
		||||
				:total="listQuery1.total"
 | 
			
		||||
				:page.sync="listQuery1.pageNo"
 | 
			
		||||
				:limit.sync="listQuery1.pageSize"
 | 
			
		||||
				:page-sizes="[5, 10, 15]"
 | 
			
		||||
				@pagination="getList1" />
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
		<div class="drawer-body__footer">
 | 
			
		||||
		<div v-if="isLog" class="drawer-body__footer">
 | 
			
		||||
			<el-button type="primary" @click="goback()">关闭</el-button>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
@@ -249,7 +252,7 @@ export default {
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'warning',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
@@ -429,4 +432,7 @@ export default {
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
.content {
 | 
			
		||||
	padding: 0 20px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -74,8 +74,7 @@ const remainBox = {
 | 
			
		||||
		value() {
 | 
			
		||||
			const temp = this.injectData[this.injectData.prop] || null;
 | 
			
		||||
			if (temp) {
 | 
			
		||||
				console.log('12', temp);
 | 
			
		||||
				return temp === 'Green' ? 'green' : 'red';
 | 
			
		||||
				return temp === 'Green' ? '未超期' : temp === 'Red' ? '已超期' : '即将超期';
 | 
			
		||||
			}
 | 
			
		||||
			return this.injectData[this.injectData.prop] || null;
 | 
			
		||||
		},
 | 
			
		||||
@@ -83,7 +82,7 @@ const remainBox = {
 | 
			
		||||
			if (this.value) {
 | 
			
		||||
				// const v = +this.value;
 | 
			
		||||
				// return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
 | 
			
		||||
				return this.value;
 | 
			
		||||
				return this.value === '未超期' ? '#37D97F' : this.value === '已超期' ? '#FF5454' : '#FFD767';
 | 
			
		||||
			}
 | 
			
		||||
			return 'unset';
 | 
			
		||||
		},
 | 
			
		||||
@@ -95,9 +94,9 @@ const remainBox = {
 | 
			
		||||
					this.color
 | 
			
		||||
					// this.color == 'Green' ? 'green' : this.color == 'Red' ? 'red' : 'yellow'
 | 
			
		||||
				}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
 | 
			
		||||
					this.color == 'red' || this.color == 'green' ? '#fff' : 'unset'
 | 
			
		||||
					'#fff'
 | 
			
		||||
				}`}>
 | 
			
		||||
				{this.injectData[this.injectData.prop] || ''}
 | 
			
		||||
				{this.value}
 | 
			
		||||
			</div>
 | 
			
		||||
		);
 | 
			
		||||
	},
 | 
			
		||||
@@ -155,18 +154,19 @@ export default {
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'name', label: '配置名' },
 | 
			
		||||
				{ prop: 'lineName', label: '产线名称' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段名' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称' },
 | 
			
		||||
				{ prop: 'responsible', label: '负责人' },
 | 
			
		||||
				{ prop: 'name', label: '配置名', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'lineName', label: '产线名称', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段名', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称', showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'responsible', label: '负责人', minWidth: 130, showOverflowtooltip: true },
 | 
			
		||||
				{ prop: 'color', label: '是否超期', subcomponent: remainBox },
 | 
			
		||||
				{ prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn },
 | 
			
		||||
				{ prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn, width: 110 },
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'opt2',
 | 
			
		||||
					label: '更换记录',
 | 
			
		||||
					name: '更新记录',
 | 
			
		||||
					subcomponent: btn,
 | 
			
		||||
					width: 110
 | 
			
		||||
				}, // TODO: 是否换成按钮, 群里问
 | 
			
		||||
				// { prop: 'remark', label: '备注' },
 | 
			
		||||
			],
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-11-28 10:03:20
 | 
			
		||||
 * @LastEditTime: 2023-12-08 13:59:20
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -11,11 +11,11 @@
 | 
			
		||||
      {{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
 | 
			
		||||
    </small-title>
 | 
			
		||||
    <div class="content">
 | 
			
		||||
      <div class="visual-part">
 | 
			
		||||
      <!-- <div class="visual-part"> -->
 | 
			
		||||
        <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
          label-width="100px" label-position="top">
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col :span="12">
 | 
			
		||||
          <el-row :gutter="24">
 | 
			
		||||
            <el-col :span="8">
 | 
			
		||||
              <el-form-item label="设备名称" prop="equipmentId">
 | 
			
		||||
                <el-select v-model="dataForm.equipmentId" filterable :disabled="isdetail" style="width: 100%"
 | 
			
		||||
                  @change="getCode" placeholder="请选择设备名称">
 | 
			
		||||
@@ -23,44 +23,39 @@
 | 
			
		||||
                </el-select>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="12">
 | 
			
		||||
            <el-col :span="8">
 | 
			
		||||
              <el-form-item label="设备编码" prop="equipmentCode">
 | 
			
		||||
                <el-input v-model="dataForm.equipmentCode" clearable :disabled="isdetail" placeholder="请输入设备编码" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col :span="12">
 | 
			
		||||
            <el-col :span="8">
 | 
			
		||||
              <el-form-item label="设备Bom编码" prop="code">
 | 
			
		||||
                <el-input v-model="dataForm.code" clearable :disabled="isdetail" placeholder="请输入设备Bom编码" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="12">
 | 
			
		||||
          </el-row>
 | 
			
		||||
          <el-row :gutter="24">
 | 
			
		||||
            <el-col :span="8">
 | 
			
		||||
              <el-form-item label="设备物料BOM名称" prop="name">
 | 
			
		||||
                <el-input v-model="dataForm.name" clearable :disabled="isdetail" placeholder="请输入设备物料BOM名称" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col :span="12">
 | 
			
		||||
            <el-col :span="8">
 | 
			
		||||
              <el-form-item label="当前状态" prop="enabled">
 | 
			
		||||
                <el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0" />
 | 
			
		||||
                <el-select v-model="dataForm.enabled" filterable :disabled="isdetail" style="width: 100%"
 | 
			
		||||
                  placeholder="请选择当前状态">
 | 
			
		||||
                  <el-option v-for="dict in enableList" :key=" dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
                </el-select>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="8">
 | 
			
		||||
              <el-form-item label="备注" prop="remark">
 | 
			
		||||
                <el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
          <el-form-item label="备注" prop="remark">
 | 
			
		||||
            <el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-form>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div v-if="!isdetail" class="drawer-body__footer">
 | 
			
		||||
        <el-button style="" @click="goback()">取消</el-button>
 | 
			
		||||
        <el-button v-if="isdetail" type="primary" @click="goEdit()">
 | 
			
		||||
          编辑
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <!-- </div> -->
 | 
			
		||||
      <div class="attr-list" v-if="idAttrShow">
 | 
			
		||||
        <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
 | 
			
		||||
          设备物料明细
 | 
			
		||||
@@ -80,14 +75,12 @@
 | 
			
		||||
        </base-table>
 | 
			
		||||
        <pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo"
 | 
			
		||||
          :limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" />
 | 
			
		||||
 | 
			
		||||
        <div class="drawer-body__footer">
 | 
			
		||||
          <el-button type="primary" @click="goback()">关闭</el-button>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div  class="drawer-body__footer">
 | 
			
		||||
      <el-button style="" @click="goback()">取消</el-button>
 | 
			
		||||
      <el-button  type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
    </div>
 | 
			
		||||
    <attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :product-id="dataForm.id" @refreshDataList="getList" />
 | 
			
		||||
  </el-drawer>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -200,6 +193,29 @@ export default {
 | 
			
		||||
  mounted() {
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    dataFormSubmit() {
 | 
			
		||||
      this.$refs["dataForm"].validate((valid) => {
 | 
			
		||||
        if (!valid) {
 | 
			
		||||
          return false;
 | 
			
		||||
        }
 | 
			
		||||
        // 修改的提交
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.urlOptions.updateURL(this.dataForm).then(response => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
            this.visible = false;
 | 
			
		||||
            this.$emit("refreshDataList");
 | 
			
		||||
          });
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        // 添加的提交
 | 
			
		||||
        this.urlOptions.createURL(this.dataForm).then(response => {
 | 
			
		||||
          this.$modal.msgSuccess("新增成功");
 | 
			
		||||
          this.idAttrShow = true;
 | 
			
		||||
          this.dataForm.id = res.data
 | 
			
		||||
          this.$emit("refreshDataList");
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    getCode(val) {
 | 
			
		||||
      this.equipmentList.forEach((ele) => {
 | 
			
		||||
        if (val === ele.id) {
 | 
			
		||||
@@ -232,8 +248,8 @@ export default {
 | 
			
		||||
				this.$confirm(
 | 
			
		||||
					`确定对${
 | 
			
		||||
          raw.data.materialName
 | 
			
		||||
            ? '[物料名称为' + raw.data.materialName + ']'
 | 
			
		||||
            : '[序号为' + raw.data.materialName + ']'
 | 
			
		||||
            ? '[物料名为' + raw.data.materialName + ']'
 | 
			
		||||
            : '[序号为' + raw.data.id + ']'
 | 
			
		||||
					}进行删除操作?`,
 | 
			
		||||
					'提示',
 | 
			
		||||
					{
 | 
			
		||||
@@ -374,7 +390,7 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
.action_btn {
 | 
			
		||||
  float: right;
 | 
			
		||||
  margin: 5px 15px;
 | 
			
		||||
  margin: -40px 15px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
.add {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-12-04 14:02:52
 | 
			
		||||
 * @LastEditTime: 2023-12-08 13:59:10
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -11,7 +11,7 @@
 | 
			
		||||
      {{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
 | 
			
		||||
    </small-title>
 | 
			
		||||
    <div class="content">
 | 
			
		||||
      <div class="visual-part">
 | 
			
		||||
      <!-- <div class="visual-part"> -->
 | 
			
		||||
        <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
          label-width="100px" label-position="top">
 | 
			
		||||
          <el-row :gutter="24">
 | 
			
		||||
@@ -57,7 +57,7 @@
 | 
			
		||||
          </el-row>
 | 
			
		||||
 | 
			
		||||
        </el-form>
 | 
			
		||||
      </div>
 | 
			
		||||
      <!-- </div> -->
 | 
			
		||||
      <!-- <div v-if="!isdetail" class="drawer-body__footer">
 | 
			
		||||
 | 
			
		||||
      </div> -->
 | 
			
		||||
@@ -65,13 +65,12 @@
 | 
			
		||||
      <div class="attr-list" v-if="idAttrShow">
 | 
			
		||||
        <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
 | 
			
		||||
          设备参数
 | 
			
		||||
          <el-button type="success" plain="true" @click="addNew()" icon="el-icon-plus">新增</el-button>
 | 
			
		||||
        </small-title>
 | 
			
		||||
 | 
			
		||||
        <div v-if="!isdetail" class="action_btn">
 | 
			
		||||
          <template>
 | 
			
		||||
            <span style="display: inline-block;">
 | 
			
		||||
 | 
			
		||||
              <el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
 | 
			
		||||
            </span>
 | 
			
		||||
          </template>
 | 
			
		||||
        </div>
 | 
			
		||||
@@ -84,7 +83,7 @@
 | 
			
		||||
          :limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" />
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="drawer-body__footer">
 | 
			
		||||
    <div  v-if="!isdetail" class="drawer-body__footer">
 | 
			
		||||
      <el-button style="" @click="goback()">取消</el-button>
 | 
			
		||||
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
    </div>
 | 
			
		||||
@@ -253,8 +252,8 @@ export default {
 | 
			
		||||
				this.$confirm(
 | 
			
		||||
					`确定对${
 | 
			
		||||
          raw.data.valueName
 | 
			
		||||
            ? '[物料名称为' + raw.data.valueName + ']'
 | 
			
		||||
            : '[序号为' + raw.data.valueName + ']'
 | 
			
		||||
            ? '[参数名为' + raw.data.valueName + ']'
 | 
			
		||||
            : '[序号为' + raw.data.id + ']'
 | 
			
		||||
					}进行删除操作?`,
 | 
			
		||||
					'提示',
 | 
			
		||||
					{
 | 
			
		||||
@@ -298,6 +297,7 @@ export default {
 | 
			
		||||
        this.urlOptions.createURL(this.dataForm).then(response => {
 | 
			
		||||
          this.$modal.msgSuccess("新增成功");
 | 
			
		||||
          this.idAttrShow = true;
 | 
			
		||||
          this.dataForm.id = res.data
 | 
			
		||||
          this.$emit("refreshDataList");
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
@@ -416,12 +416,13 @@ export default {
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
.action_btn {
 | 
			
		||||
  float: right;
 | 
			
		||||
  margin: 5px 15px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.add {
 | 
			
		||||
	color: #0b58ff;
 | 
			
		||||
}
 | 
			
		||||
.action_btn {
 | 
			
		||||
  float: right;
 | 
			
		||||
  margin: -40px 15px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-08 15:30:27
 | 
			
		||||
 * @LastEditTime: 2023-11-28 10:11:40
 | 
			
		||||
 * @LastEditTime: 2023-12-04 15:19:33
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
@@ -15,36 +15,40 @@
 | 
			
		||||
      </slot>
 | 
			
		||||
    </template>
 | 
			
		||||
 | 
			
		||||
    <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
 | 
			
		||||
    <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" label-position="top"
 | 
			
		||||
      @keyup.enter.native="dataFormSubmit()">
 | 
			
		||||
      <el-form-item label="参数名称" prop="paramId">
 | 
			
		||||
        <el-select v-model="dataForm.paramId" filterable placeholder="参数名称" @change="getData" multiple >
 | 
			
		||||
          <el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
        </el-select>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <!-- <el-form-item label="参数编码" prop="code">
 | 
			
		||||
        <el-input v-model="dataForm.code" placeholder="请输入参数编码" clearable />
 | 
			
		||||
      </el-form-item> -->
 | 
			
		||||
      <!-- <el-form-item label="标准最小值" prop="standardMinValue">
 | 
			
		||||
        <el-input v-model="dataForm.standardMinValue" placeholder="请输入标准最小值" clearable />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="标准最大值" prop="standardMaxValue">
 | 
			
		||||
        <el-input v-model="dataForm.standardMaxValue" placeholder="请输入标准最大值" clearable />
 | 
			
		||||
      </el-form-item> -->
 | 
			
		||||
      <el-form-item label="工艺最小值" prop="minValue">
 | 
			
		||||
        <el-input v-model="dataForm.minValue" placeholder="请输入工艺最小值" clearable />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="工艺最大值" prop="maxValue">
 | 
			
		||||
        <el-input v-model="dataForm.maxValue" placeholder="请输入工艺最大值" clearable />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="工艺标准值" prop="defaultValue">
 | 
			
		||||
        <el-input v-model="dataForm.defaultValue" placeholder="请输入工艺标准值" clearable />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="备注" prop="remark">
 | 
			
		||||
        <el-input v-model="dataForm.remark" placeholder="请输入备注" clearable />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-row :gutter="24">
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <el-form-item label="参数名称" prop="paramId">
 | 
			
		||||
            <el-select v-model="dataForm.paramId" filterable placeholder="参数名称" @change="getData" multiple>
 | 
			
		||||
              <el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
            </el-select>
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <el-form-item label="工艺最小值" prop="minValue">
 | 
			
		||||
            <el-input v-model="dataForm.minValue" placeholder="请输入工艺最小值" clearable />
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <el-form-item label="工艺最大值" prop="maxValue">
 | 
			
		||||
            <el-input v-model="dataForm.maxValue" placeholder="请输入工艺最大值" clearable />
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
      </el-row>
 | 
			
		||||
      <el-row :gutter="24">
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <el-form-item label="工艺标准值" prop="defaultValue">
 | 
			
		||||
            <el-input v-model="dataForm.defaultValue" placeholder="请输入工艺标准值" clearable />
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <el-form-item label="备注" prop="remark">
 | 
			
		||||
            <el-input v-model="dataForm.remark" placeholder="请输入备注" clearable />
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
      </el-row>
 | 
			
		||||
    </el-form>
 | 
			
		||||
 | 
			
		||||
    <el-row style="text-align: right">
 | 
			
		||||
      <el-button @click="visible = false">取消</el-button>
 | 
			
		||||
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form ref="form" :model="dataForm" label-width="120px" v-loading="formLoading">
 | 
			
		||||
  <el-form ref="dataForm" :model="dataForm" label-width="120px" v-loading="formLoading" label-position="top">
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="产线" prop="productionLineId"
 | 
			
		||||
@@ -24,8 +24,22 @@
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
      <el-col :span="24">
 | 
			
		||||
        <el-form-item label="检测内容" prop="inspectionDetIdList"
 | 
			
		||||
          :rules="[{ required: true, message: '不能为空', trigger: 'change' }]">
 | 
			
		||||
          <div class="itemDet" v-for="item in inspectionDetList" :key="item.typeId" style="padding: 0 20px;">
 | 
			
		||||
            <div>{{ item.typeName}} </div>
 | 
			
		||||
            <!-- <div>{{ item.data }} </div> -->
 | 
			
		||||
            <div class="content">
 | 
			
		||||
              <el-checkbox-group v-model="dataForm.inspectionDetIdList" @change="handleCheckedCitiesChange">
 | 
			
		||||
                <el-checkbox v-for="i in item.data" :key="i.content" :label="i.detId">{{ i.content }}
 | 
			
		||||
                </el-checkbox>
 | 
			
		||||
              </el-checkbox-group>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <!-- <el-col :span="12">
 | 
			
		||||
        <el-form-item label="按钮盒识别码" prop="buttonId" :rules="[
 | 
			
		||||
        	{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
        	{
 | 
			
		||||
@@ -65,28 +79,36 @@
 | 
			
		||||
            <el-option v-for="opt in inspectionDetList" :key="opt.value" :label="opt.label" :value="opt.value" />
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      </el-col> -->
 | 
			
		||||
    </el-row>
 | 
			
		||||
  </el-form>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicAdd from '../../mixins/basic-add';
 | 
			
		||||
import {
 | 
			
		||||
  createQualityInspectionBoxBtn,
 | 
			
		||||
  updateQualityInspectionBoxBtn,
 | 
			
		||||
  getQualityInspectionBoxBtn,
 | 
			
		||||
  getListByLineSection
 | 
			
		||||
} from '@/api/base/qualityInspectionBoxBtn';
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'DialogForm',
 | 
			
		||||
	model: {
 | 
			
		||||
		prop: 'dataForm',
 | 
			
		||||
		event: 'update',
 | 
			
		||||
	},
 | 
			
		||||
	emits: ['update'],
 | 
			
		||||
	components: {},
 | 
			
		||||
	props: {
 | 
			
		||||
		dataForm: {
 | 
			
		||||
			type: Object,
 | 
			
		||||
			default: () => ({}),
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
  mixins: [basicAdd],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        // isGetCode: false,
 | 
			
		||||
        // codeURL: getCode,
 | 
			
		||||
        createURL: createQualityInspectionBoxBtn,
 | 
			
		||||
        updateURL: updateQualityInspectionBoxBtn,
 | 
			
		||||
        infoURL: getQualityInspectionBoxBtn,
 | 
			
		||||
      },
 | 
			
		||||
      dataForm: {
 | 
			
		||||
        // id: null,
 | 
			
		||||
        sectionId: null,
 | 
			
		||||
        productionLineId: null,
 | 
			
		||||
        inspectionDetIdList:[],
 | 
			
		||||
      },
 | 
			
		||||
			formLoading: true,
 | 
			
		||||
      productionLineList: [],
 | 
			
		||||
      inspectionDetList:[],
 | 
			
		||||
@@ -96,6 +118,7 @@ export default {
 | 
			
		||||
	mounted() {
 | 
			
		||||
    this.getProductionLineList()
 | 
			
		||||
    this.getQualityInspectionDetList()
 | 
			
		||||
    // this.getList()
 | 
			
		||||
		// this.getWorksectionList();
 | 
			
		||||
		// this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
 | 
			
		||||
		// 	this.formLoading = false;
 | 
			
		||||
@@ -108,13 +131,56 @@ export default {
 | 
			
		||||
	watch: {
 | 
			
		||||
		'dataForm.productionId': {
 | 
			
		||||
			handler(id) {
 | 
			
		||||
				if (id != null) this.getWorksectionList(id);
 | 
			
		||||
				if (id != null) this.getWorksectionList(id)
 | 
			
		||||
			},
 | 
			
		||||
			immediate: true,
 | 
			
		||||
			immediate: true
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		/** 模拟透传 ref  */
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(obj) {
 | 
			
		||||
      // console.log(productionLineId);
 | 
			
		||||
      console.log(obj);
 | 
			
		||||
      this.visible = true;
 | 
			
		||||
      // if(obj.id)
 | 
			
		||||
      this.dataForm.id = obj.id ? obj.id : ""
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs["dataForm"].resetFields()
 | 
			
		||||
        if (obj) {
 | 
			
		||||
          getListByLineSection({
 | 
			
		||||
            productionLineId: obj.productionLineId,
 | 
			
		||||
            sectionId: obj.sectionId,
 | 
			
		||||
          }).then((res) => {
 | 
			
		||||
            console.log(res);
 | 
			
		||||
            this.dataForm.inspectionDetIdList = res.data
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.urlOptions.infoURL(obj.id).then(response => {
 | 
			
		||||
            this.dataForm.id = response.data.id
 | 
			
		||||
            this.dataForm.productionLineId = response.data.productionLineId
 | 
			
		||||
            this.dataForm.sectionId = response.data.sectionId
 | 
			
		||||
            // if (this.setData) {
 | 
			
		||||
            //   this.setDataForm()
 | 
			
		||||
            // }
 | 
			
		||||
          });
 | 
			
		||||
        } else {
 | 
			
		||||
          // if (this.urlOptions.isGetCode) {
 | 
			
		||||
          //   this.getCode()
 | 
			
		||||
          // }
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    /** 模拟透传 ref  */
 | 
			
		||||
    handleCheckedCitiesChange(value) {
 | 
			
		||||
      ;console.log(value);
 | 
			
		||||
      // let checkedCount = value.length;
 | 
			
		||||
      // this.checkAll = checkedCount === this.cities.length;
 | 
			
		||||
      // this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
 | 
			
		||||
    },
 | 
			
		||||
    // getList() {
 | 
			
		||||
    //   console.log(this.dataForm.sectionId);
 | 
			
		||||
 | 
			
		||||
    // },
 | 
			
		||||
		validate(cb) {
 | 
			
		||||
			return this.$refs.form.validate(cb);
 | 
			
		||||
		},
 | 
			
		||||
@@ -138,14 +204,34 @@ export default {
 | 
			
		||||
    async getQualityInspectionDetList() {
 | 
			
		||||
      this.formLoading = true;
 | 
			
		||||
      const res = await this.$axios({
 | 
			
		||||
        url: '/base/quality-inspection-det/listAll',
 | 
			
		||||
        url: '/base/quality-inspection-det/inspectionMap',
 | 
			
		||||
        method: 'get',
 | 
			
		||||
      });
 | 
			
		||||
      if (res.code == 0) {
 | 
			
		||||
        this.inspectionDetList = res.data.map((item) => ({
 | 
			
		||||
          label: item.content,
 | 
			
		||||
          value: item.content,
 | 
			
		||||
        }));
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        let arr = []
 | 
			
		||||
        for (let i in res.data) {
 | 
			
		||||
          let obj = {
 | 
			
		||||
            typeName: res.data[i].length !== 0 ? res.data[i][0].typeName : '',
 | 
			
		||||
            typeId: res.data[i].length !== 0 ? res.data[i][0].typeId : '',
 | 
			
		||||
            data:[]
 | 
			
		||||
          }
 | 
			
		||||
          let detArr = []
 | 
			
		||||
          res.data[i].forEach(ele => {
 | 
			
		||||
            detArr.push({
 | 
			
		||||
              detId: ele.id,
 | 
			
		||||
              content: ele.content
 | 
			
		||||
            })
 | 
			
		||||
          })
 | 
			
		||||
          obj.data = detArr
 | 
			
		||||
          arr.push(obj)
 | 
			
		||||
        }
 | 
			
		||||
        this.inspectionDetList = arr
 | 
			
		||||
        console.log(this.inspectionDetList);
 | 
			
		||||
        // this.inspectionDetList = res.data.map((item) => ({
 | 
			
		||||
        //   label: item.content,
 | 
			
		||||
        //   value: item.content,
 | 
			
		||||
        // }));
 | 
			
		||||
      }
 | 
			
		||||
      this.formLoading = false;
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -1,47 +1,24 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="buttonClick" />
 | 
			
		||||
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				fixed="right"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData">
 | 
			
		||||
      <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick" />
 | 
			
		||||
    </base-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
    <!-- 分页组件 -->
 | 
			
		||||
    <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
 | 
			
		||||
      @pagination="getDataList" />
 | 
			
		||||
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			width="50%"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
    <!-- 对话框(添加 / 修改) -->
 | 
			
		||||
    <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" width="50%" @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm" :before-close="handleCancel">
 | 
			
		||||
      <add-or-update ref="addOrUpdate" @refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
@@ -53,84 +30,21 @@ import {
 | 
			
		||||
	getQualityInspectionBoxBtnPage,
 | 
			
		||||
	exportQualityInspectionBoxBtnExcel,
 | 
			
		||||
} from '@/api/base/qualityInspectionBoxBtn';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
import basicPage from '../../mixins/basic-page';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import DialogForm from './dialogForm.vue';
 | 
			
		||||
import addOrUpdate from './dialogForm.vue';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'QualityInspectionBoxBtn',
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	components: { DialogForm },
 | 
			
		||||
  mixins: [basicPage],
 | 
			
		||||
  components: { addOrUpdate },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '产线',
 | 
			
		||||
						url: '/base/production-line/listAll',
 | 
			
		||||
						prop: 'productionId',
 | 
			
		||||
						rules: [{ required: true, message: '产线不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '工段',
 | 
			
		||||
						url: '/base/workshop-section/listAll',
 | 
			
		||||
						prop: 'sectionId',
 | 
			
		||||
						rules: [{ required: true, message: '工段不能为空', trigger: 'blur' }],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '按钮盒识别码',
 | 
			
		||||
						prop: 'buttonId',
 | 
			
		||||
						rules: [
 | 
			
		||||
							{
 | 
			
		||||
								type: 'number',
 | 
			
		||||
								message: '请输入整数',
 | 
			
		||||
								trigger: 'blur',
 | 
			
		||||
								transform: (val) =>
 | 
			
		||||
									Number.isInteger(Number(val)) && Number(val),
 | 
			
		||||
							},
 | 
			
		||||
						],
 | 
			
		||||
					},
 | 
			
		||||
					{ input: true, label: '按钮盒模式', prop: 'model' },
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						input: true,
 | 
			
		||||
						label: '按钮值',
 | 
			
		||||
						prop: 'keyValue',
 | 
			
		||||
						rules: [
 | 
			
		||||
							{
 | 
			
		||||
								type: 'number',
 | 
			
		||||
								message: '请输入100以内的整数',
 | 
			
		||||
								trigger: 'blur',
 | 
			
		||||
								transform: (val) =>
 | 
			
		||||
									Number(val) <= 100 && Number.isInteger(+val) && Number(val),
 | 
			
		||||
							},
 | 
			
		||||
						],
 | 
			
		||||
						bind: { type: 'number', min: 0, max: 100 },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            select: true,
 | 
			
		||||
            label: '检测内容',
 | 
			
		||||
            url: '/base/quality-inspection-det/listAll',
 | 
			
		||||
            prop: 'inspectionDetId',
 | 
			
		||||
            rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
			
		||||
            bind: {
 | 
			
		||||
              filterable: true,
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        getDataListURL: getQualityInspectionBoxBtnPage,
 | 
			
		||||
        deleteURL: deleteQualityInspectionBoxBtn,
 | 
			
		||||
        // exportURL: exportFactoryExcel,
 | 
			
		||||
      },
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
@@ -170,15 +84,17 @@ export default {
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      tableData: [],
 | 
			
		||||
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'createTime',
 | 
			
		||||
					label: '添加时间',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 180,
 | 
			
		||||
					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	prop: 'createTime',
 | 
			
		||||
				// 	label: '添加时间',
 | 
			
		||||
				// 	fixed: true,
 | 
			
		||||
				// 	width: 180,
 | 
			
		||||
				// 	filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
          prop: 'productionLineName',
 | 
			
		||||
					label: '产线',
 | 
			
		||||
@@ -190,39 +106,22 @@ export default {
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'inspectionDetContent',
 | 
			
		||||
					label: '检测内容',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					width: 160,
 | 
			
		||||
					prop: 'buttonId',
 | 
			
		||||
					label: '按钮盒识别码',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	width: 256,
 | 
			
		||||
				// 	prop: 'productionId',
 | 
			
		||||
				// 	label: '按钮盒所在产线ID',
 | 
			
		||||
				// 	,
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	width: 256,
 | 
			
		||||
				// 	prop: 'sectionId',
 | 
			
		||||
				// 	label: '按钮盒所在工段ID',
 | 
			
		||||
				// 	,
 | 
			
		||||
				// },
 | 
			
		||||
				{ width: 90, prop: 'keyValue', label: '按钮值' },
 | 
			
		||||
				{ width: 128, prop: 'model', label: '按钮盒模式' },
 | 
			
		||||
				}
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				inspectionDetContent: null,
 | 
			
		||||
			},
 | 
			
		||||
			// 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
 | 
			
		||||
      },
 | 
			
		||||
      addOrUpdateVisible: false,
 | 
			
		||||
      addOrEditTitle:'',
 | 
			
		||||
			// 搜索框需要的 keys, 与上面 listQuery 的除 pageNo, pageSize 之外的 key 一一对应
 | 
			
		||||
			searchBarKeys: ['inspectionDetContent'],
 | 
			
		||||
			form: {
 | 
			
		||||
				id: null,
 | 
			
		||||
				buttonId: null,
 | 
			
		||||
        inspectionDetContent: null,
 | 
			
		||||
        inspectionDetContent: [],
 | 
			
		||||
        productionLineId: null,
 | 
			
		||||
				sectionId: null,
 | 
			
		||||
				model: null,
 | 
			
		||||
@@ -231,19 +130,19 @@ export default {
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
		// this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			getQualityInspectionBoxBtnPage(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
				this.loading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// getList() {
 | 
			
		||||
		// 	this.loading = true;
 | 
			
		||||
		// 	// 执行查询
 | 
			
		||||
		// 	getQualityInspectionBoxBtnPage(this.listQuery).then((response) => {
 | 
			
		||||
		// 		this.list = response.data.list;
 | 
			
		||||
		// 		this.total = response.data.total;
 | 
			
		||||
		// 		this.loading = false;
 | 
			
		||||
		// 	});
 | 
			
		||||
		// },
 | 
			
		||||
		/** 表单重置 */
 | 
			
		||||
		reset() {
 | 
			
		||||
			this.form = {
 | 
			
		||||
@@ -256,78 +155,28 @@ export default {
 | 
			
		||||
				keyValue: null,
 | 
			
		||||
			};
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
		handleAdd() {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			this.open = true;
 | 
			
		||||
			this.title = '添加安灯按钮16键对应';
 | 
			
		||||
		},
 | 
			
		||||
		/** 修改按钮操作 */
 | 
			
		||||
		handleUpdate(row) {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			getQualityInspectionBoxBtn(id).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改安灯按钮16键对应';
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 提交按钮 */
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['form'].validate((valid) => {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					updateQualityInspectionBoxBtn(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
						this.open = false;
 | 
			
		||||
						this.getList();
 | 
			
		||||
					});
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				// 添加的提交
 | 
			
		||||
				createQualityInspectionBoxBtn(this.form).then((response) => {
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
					this.getList();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除"' + row.sectionName + '"?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return deleteQualityInspectionBoxBtn(id);
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		/** 导出按钮操作 */
 | 
			
		||||
		handleExport() {
 | 
			
		||||
			// 处理查询参数
 | 
			
		||||
			let params = { ...this.queryParams };
 | 
			
		||||
			params.pageNo = undefined;
 | 
			
		||||
			params.pageSize = undefined;
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认导出所有安灯按钮16键对应数据项?')
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.exportLoading = true;
 | 
			
		||||
					return exportQualityInspectionBoxBtnExcel(params);
 | 
			
		||||
				})
 | 
			
		||||
				.then((response) => {
 | 
			
		||||
					this.$download.excel(response, '安灯按钮16键对应.xls');
 | 
			
		||||
					this.exportLoading = false;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case 'search':
 | 
			
		||||
          this.listQuery.pageNo = 1;
 | 
			
		||||
          this.listQuery.pageSize = 10;
 | 
			
		||||
          this.listQuery.inspectionDetContent = val.inspectionDetContent ? val.inspectionDetContent : undefined;
 | 
			
		||||
          // this.listQuery.teamId = val.teamId ? val.teamId : undefined;
 | 
			
		||||
          this.getDataList()
 | 
			
		||||
          break;
 | 
			
		||||
        case 'add':
 | 
			
		||||
          this.addOrEditTitle = '新增';
 | 
			
		||||
          this.addOrUpdateVisible = true;
 | 
			
		||||
          this.addOrUpdateHandle();
 | 
			
		||||
          break;
 | 
			
		||||
        case 'export':
 | 
			
		||||
          this.handleExport();
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          console.log(val);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										100
									
								
								src/views/quality/base/mixins/basic-add.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										100
									
								
								src/views/quality/base/mixins/basic-add.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,100 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2022-08-24 11:19:43
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-12-13 15:57:27
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    /* eslint-disable */
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        createURL: '',
 | 
			
		||||
        updateURL: '',
 | 
			
		||||
        infoURL: '',
 | 
			
		||||
        codeURL: '',
 | 
			
		||||
        getOption: false,
 | 
			
		||||
        isGetCode: false,
 | 
			
		||||
        optionArrUrl: [],
 | 
			
		||||
        optionArr: {}
 | 
			
		||||
      },
 | 
			
		||||
      visible: false,
 | 
			
		||||
      setData: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
  },
 | 
			
		||||
  activated() {
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(id) {
 | 
			
		||||
      this.dataForm.id = id || "";
 | 
			
		||||
      this.visible = true;
 | 
			
		||||
      if (this.urlOptions.getOption) {
 | 
			
		||||
        this.getArr()
 | 
			
		||||
      }
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs["dataForm"].resetFields();
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.urlOptions.infoURL(id).then(response => {
 | 
			
		||||
            this.dataForm = response.data
 | 
			
		||||
            if (this.setData) {
 | 
			
		||||
              this.setDataForm()
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
        } else {
 | 
			
		||||
          if (this.urlOptions.isGetCode) {
 | 
			
		||||
            this.getCode()
 | 
			
		||||
          }
 | 
			
		||||
				}
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
		getCode() {
 | 
			
		||||
			this.urlOptions.codeURL()
 | 
			
		||||
				.then(({ data: res }) => {
 | 
			
		||||
					this.dataForm.code = res;
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
    getArr() {
 | 
			
		||||
      const params = {
 | 
			
		||||
        pageSize: 100,
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
      }
 | 
			
		||||
      this.urlOptions.optionArrUrl.forEach((item, index) => {
 | 
			
		||||
        item(params).then(({ data: res }) => {
 | 
			
		||||
          this.$set(this.urlOptions.optionArr, `arr${index}`, res.list)
 | 
			
		||||
        })
 | 
			
		||||
          .catch(() => {
 | 
			
		||||
          });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    // 表单提交
 | 
			
		||||
    dataFormSubmit() {
 | 
			
		||||
      this.$refs["dataForm"].validate((valid) => {
 | 
			
		||||
        if (!valid) {
 | 
			
		||||
          return false;
 | 
			
		||||
        }
 | 
			
		||||
        // 修改的提交
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.urlOptions.updateURL(this.dataForm).then(response => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
            this.visible = false;
 | 
			
		||||
            this.$emit("refreshDataList");
 | 
			
		||||
          });
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        // 添加的提交
 | 
			
		||||
        this.urlOptions.createURL(this.dataForm).then(response => {
 | 
			
		||||
          this.$modal.msgSuccess("新增成功");
 | 
			
		||||
          this.visible = false;
 | 
			
		||||
          this.$emit("refreshDataList");
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    formClear() {
 | 
			
		||||
      this.$refs.dataForm.resetFields()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										168
									
								
								src/views/quality/base/mixins/basic-page.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										168
									
								
								src/views/quality/base/mixins/basic-page.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,168 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2022-08-24 11:19:43
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-12-13 16:19:04
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    /* eslint-disable */
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        getDataListURL: '',
 | 
			
		||||
        deleteURL: '',
 | 
			
		||||
        statusUrl: '',
 | 
			
		||||
        exportURL: ''
 | 
			
		||||
      },
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        total: 1,
 | 
			
		||||
      },
 | 
			
		||||
      exportLoading: false,
 | 
			
		||||
      dataListLoading: false,
 | 
			
		||||
      addOrEditTitle: '',
 | 
			
		||||
      addOrUpdateVisible: false,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
			
		||||
        this.tableData = response.data.list;
 | 
			
		||||
        this.listQuery.total = response.data.total;
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    // 每页数
 | 
			
		||||
    sizeChangeHandle(val) {
 | 
			
		||||
      this.listQuery.pageSize = val;
 | 
			
		||||
      this.listQuery.pageNo = 1;
 | 
			
		||||
      this.getDataList();
 | 
			
		||||
    },
 | 
			
		||||
    // 当前页
 | 
			
		||||
    currentChangeHandle(val) {
 | 
			
		||||
      this.listQuery.pageNo = val;
 | 
			
		||||
      this.getDataList();
 | 
			
		||||
    },
 | 
			
		||||
    // 新增 / 修改
 | 
			
		||||
    addOrUpdateHandle(id) {
 | 
			
		||||
      this.addOrUpdateVisible = true;
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs.addOrUpdate.init(id);
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    cancel(id) {
 | 
			
		||||
      this.$refs["popover-" + id].showPopper = false;
 | 
			
		||||
    },
 | 
			
		||||
    //改变状态
 | 
			
		||||
    changeStatus(id) {
 | 
			
		||||
      this.$http
 | 
			
		||||
        .post(this.urlOptions.statusUrl, { id })
 | 
			
		||||
        .then(({ data: res }) => {
 | 
			
		||||
          if (res.code !== 0) {
 | 
			
		||||
            return this.$message.error(res.msg);
 | 
			
		||||
          }
 | 
			
		||||
          this.$refs["popover-" + id].showPopper = false;
 | 
			
		||||
          this.$message({
 | 
			
		||||
            message: this.$t("prompt.success"),
 | 
			
		||||
            type: "success",
 | 
			
		||||
            duration: 500,
 | 
			
		||||
            onClose: () => {
 | 
			
		||||
              this.getDataList();
 | 
			
		||||
            },
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
    //tableBtn点击
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      if (val.type === "edit") {
 | 
			
		||||
        this.addOrUpdateVisible = true;
 | 
			
		||||
        this.addOrEditTitle = "编辑";
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.addOrUpdate.init(val.data);
 | 
			
		||||
        });
 | 
			
		||||
      } else if (val.type === "delete") {
 | 
			
		||||
        this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
 | 
			
		||||
      } else if (val.type === "change") {
 | 
			
		||||
        this.changeStatus(val.data.id)
 | 
			
		||||
      } else {
 | 
			
		||||
        this.otherMethods(val)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 删除
 | 
			
		||||
    deleteHandle(id, name, index) {
 | 
			
		||||
      this.$confirm(`确定对${name ? '[名称=' + name + ']' : '[序号=' + index + ']'}进行删除操作?`, "提示", {
 | 
			
		||||
        confirmButtonText: "确定",
 | 
			
		||||
        cancelButtonText: "取消",
 | 
			
		||||
        type: "warning",
 | 
			
		||||
      })
 | 
			
		||||
        .then(() => {
 | 
			
		||||
          this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
            this.$message({
 | 
			
		||||
              message: "操作成功",
 | 
			
		||||
              type: "success",
 | 
			
		||||
              duration: 1500,
 | 
			
		||||
              onClose: () => {
 | 
			
		||||
                this.getDataList();
 | 
			
		||||
              },
 | 
			
		||||
            });
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
    //search-bar点击
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case "search":
 | 
			
		||||
          this.listQuery.xm1 = val.xm1;
 | 
			
		||||
          this.listQuery.xm2 = val.xm2;
 | 
			
		||||
          this.listQuery.pageNo = 1;
 | 
			
		||||
          this.getDataList();
 | 
			
		||||
          break;
 | 
			
		||||
        case "add":
 | 
			
		||||
          this.addOrEditTitle = '新增'
 | 
			
		||||
          this.addOrUpdateVisible = true;
 | 
			
		||||
          this.addOrUpdateHandle()
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          console.log(val)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.addOrUpdate.formClear()
 | 
			
		||||
      this.addOrUpdateVisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.addOrUpdate.dataFormSubmit()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getDataList()
 | 
			
		||||
    },
 | 
			
		||||
    /** 导出按钮操作 */
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      let params = { ...this.queryParams };
 | 
			
		||||
      params.pageNo = undefined;
 | 
			
		||||
      params.pageSize = undefined;
 | 
			
		||||
      this.$modal.confirm('是否确认导出所有数据项?').then(() => {
 | 
			
		||||
        this.exportLoading = true;
 | 
			
		||||
        return this.urlOptions.exportURL(params);
 | 
			
		||||
      }).then(response => {
 | 
			
		||||
        this.$download.excel(response, '工厂.xls');
 | 
			
		||||
        this.exportLoading = false;
 | 
			
		||||
      }).catch(() => { });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										69
									
								
								src/views/quality/base/mixins/code-filter.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								src/views/quality/base/mixins/code-filter.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,69 @@
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * @Date: 2020-12-29 16:49:28
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2023-09-12 11:13:34
 | 
			
		||||
 * @FilePath: \basic-admin\src\filters\basicData\index.js
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
const table = {
 | 
			
		||||
  lineStatus: {
 | 
			
		||||
    1: '生产中',
 | 
			
		||||
    2: '停止',
 | 
			
		||||
    3: '未知',
 | 
			
		||||
  },
 | 
			
		||||
  reportType: {
 | 
			
		||||
    1: '日',
 | 
			
		||||
    2: '周',
 | 
			
		||||
    3: '月'
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 日期格式化
 | 
			
		||||
export function parseTime(time, pattern) {
 | 
			
		||||
  if (arguments.length === 0 || !time) {
 | 
			
		||||
    return null
 | 
			
		||||
  }
 | 
			
		||||
  const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
 | 
			
		||||
  let date
 | 
			
		||||
  if (typeof time === 'object') {
 | 
			
		||||
    date = time
 | 
			
		||||
  } else {
 | 
			
		||||
    if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
 | 
			
		||||
      time = parseInt(time)
 | 
			
		||||
    } else if (typeof time === 'string') {
 | 
			
		||||
      time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),'');
 | 
			
		||||
    }
 | 
			
		||||
    if ((typeof time === 'number') && (time.toString().length === 10)) {
 | 
			
		||||
      time = time * 1000
 | 
			
		||||
    }
 | 
			
		||||
    date = new Date(time)
 | 
			
		||||
  }
 | 
			
		||||
  const formatObj = {
 | 
			
		||||
    y: date.getFullYear(),
 | 
			
		||||
    m: date.getMonth() + 1,
 | 
			
		||||
    d: date.getDate(),
 | 
			
		||||
    h: date.getHours(),
 | 
			
		||||
    i: date.getMinutes(),
 | 
			
		||||
    s: date.getSeconds(),
 | 
			
		||||
    a: date.getDay()
 | 
			
		||||
  }
 | 
			
		||||
  const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
 | 
			
		||||
    let value = formatObj[key]
 | 
			
		||||
    // Note: getDay() returns 0 on Sunday
 | 
			
		||||
    if (key === 'a') {
 | 
			
		||||
      return ['日', '一', '二', '三', '四', '五', '六'][value]
 | 
			
		||||
    }
 | 
			
		||||
    if (result.length > 0 && value < 10) {
 | 
			
		||||
      value = '0' + value
 | 
			
		||||
    }
 | 
			
		||||
    return value || 0
 | 
			
		||||
  })
 | 
			
		||||
  return time_str
 | 
			
		||||
}
 | 
			
		||||
export default function (dictTable) {
 | 
			
		||||
  return function (val) {
 | 
			
		||||
    return table?.[dictTable]?.[val]
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										65
									
								
								src/views/quality/base/qualityHotMaterial/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								src/views/quality/base/qualityHotMaterial/SmallTitle.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,65 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-07 19:28:13
 | 
			
		||||
 * @LastEditTime: 2023-11-08 14:11:43
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div :class="[className, { 'p-0': noPadding }]">
 | 
			
		||||
		<slot />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	props: {
 | 
			
		||||
		size: {
 | 
			
		||||
			// 取值范围:  xl lg md sm
 | 
			
		||||
			type: String,
 | 
			
		||||
			default: 'de',
 | 
			
		||||
			validator: function (val) {
 | 
			
		||||
				return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		noPadding: {
 | 
			
		||||
			type: Boolean,
 | 
			
		||||
			default: false,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	computed: {
 | 
			
		||||
		className: function () {
 | 
			
		||||
			return `${this.size}-title`;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
 | 
			
		||||
$mgr: 8px;
 | 
			
		||||
@each $size, $height in $pxls {
 | 
			
		||||
	.#{$size}-title {
 | 
			
		||||
		font-size: 18px;
 | 
			
		||||
		line-height: $height;
 | 
			
		||||
		color: #000;
 | 
			
		||||
		font-weight: 500;
 | 
			
		||||
		font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
 | 
			
		||||
 | 
			
		||||
		&::before {
 | 
			
		||||
			content: '';
 | 
			
		||||
			display: inline-block;
 | 
			
		||||
			vertical-align: top;
 | 
			
		||||
			width: 4px;
 | 
			
		||||
			height: $height + 2px;
 | 
			
		||||
			border-radius: 1px;
 | 
			
		||||
			margin-right: $mgr;
 | 
			
		||||
			background-color: #0b58ff;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.p-0 {
 | 
			
		||||
	padding: 0;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										375
									
								
								src/views/quality/base/qualityHotMaterial/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										375
									
								
								src/views/quality/base/qualityHotMaterial/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,375 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-08 13:46:17
 | 
			
		||||
 * @LastEditTime: 2023-12-08 16:09:13
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="false" class="drawer" size="50%">
 | 
			
		||||
    <small-title slot="title" :no-padding="true">
 | 
			
		||||
      {{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
 | 
			
		||||
    </small-title>
 | 
			
		||||
    <div class="content">
 | 
			
		||||
      <!-- <div class="visual-part"> -->
 | 
			
		||||
      <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
        label-width="100px" label-position="top">
 | 
			
		||||
        <el-row :gutter="24">
 | 
			
		||||
          <el-col :span="8">
 | 
			
		||||
            <el-form-item label="供应商" prop="supplierId">
 | 
			
		||||
              <el-select v-model="dataForm.supplierId" filterable :disabled="isdetail" style="width: 100%"
 | 
			
		||||
                placeholder="请选择供应商">
 | 
			
		||||
                <el-option v-for="dict in supplierList" :key=" dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
              </el-select>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span="8">
 | 
			
		||||
            <el-form-item label="原料" prop="materialId">
 | 
			
		||||
              <el-select v-model="dataForm.materialId" filterable :disabled="isdetail" style="width: 100%"
 | 
			
		||||
                @change="getData" placeholder="请选择原料">
 | 
			
		||||
                <el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
              </el-select>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span="8">
 | 
			
		||||
            <el-form-item label="样品编码" prop="sampleCode">
 | 
			
		||||
              <el-input v-model="dataForm.sampleCode" clearable :disabled="isdetail" placeholder="请输入样品编码" />
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
        <el-row :gutter="24">
 | 
			
		||||
          <el-col :span="8">
 | 
			
		||||
            <el-form-item label="取样人" prop="samplerId">
 | 
			
		||||
              <el-select v-model="dataForm.samplerId" filterable :disabled="isdetail" style="width: 100%"
 | 
			
		||||
                placeholder="请选择取样人">
 | 
			
		||||
                <el-option v-for="dict in workerList" :key=" dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
              </el-select>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span="8">
 | 
			
		||||
            <el-form-item label="检测人" prop="checkerId">
 | 
			
		||||
              <el-select v-model="dataForm.checkerId" filterable :disabled="isdetail" style="width: 100%"
 | 
			
		||||
                placeholder="请选择检测人">
 | 
			
		||||
                <el-option v-for="dict in workerList" :key=" dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
              </el-select>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span="8">
 | 
			
		||||
            <el-form-item label="检测时间" prop="checkTime">
 | 
			
		||||
              <el-date-picker v-model="dataForm.checkTime" type="datetime" placeholder="选择检测时间">
 | 
			
		||||
              </el-date-picker>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <!-- </div> -->
 | 
			
		||||
      <div class="attr-list" v-if="idAttrShow">
 | 
			
		||||
        <!-- <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
 | 
			
		||||
          设备物料明细
 | 
			
		||||
        </small-title>
 | 
			
		||||
 | 
			
		||||
        <div v-if="!isdetail" class="action_btn">
 | 
			
		||||
          <template>
 | 
			
		||||
            <span style="display: inline-block;">
 | 
			
		||||
              <el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
 | 
			
		||||
            </span>
 | 
			
		||||
          </template>
 | 
			
		||||
        </div>
 | 
			
		||||
        <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
 | 
			
		||||
          :table-data="productAttrList">
 | 
			
		||||
          <method-btn v-if="!isdetail" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
 | 
			
		||||
            @clickBtn="handleClick" />
 | 
			
		||||
        </base-table>
 | 
			
		||||
        <pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo"
 | 
			
		||||
          :limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" /> -->
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="drawer-body__footer">
 | 
			
		||||
      <el-button style="" @click="goback()">取消</el-button>
 | 
			
		||||
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- <attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :product-id="dataForm.id" @refreshDataList="getList" /> -->
 | 
			
		||||
  </el-drawer>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
// import basicAdd from '../../core/mixins/basic-add';
 | 
			
		||||
import {
 | 
			
		||||
  getQualityHotMaterial,
 | 
			
		||||
  updateQualityHotMaterial,
 | 
			
		||||
  createQualityHotMaterial,
 | 
			
		||||
  getHotMaterialAllList,
 | 
			
		||||
  getSupplierList,
 | 
			
		||||
  getWorkerList,
 | 
			
		||||
  getMaterialCheckList
 | 
			
		||||
} from '@/api/base/qualityHotMaterial';
 | 
			
		||||
import SmallTitle from './SmallTitle';
 | 
			
		||||
// import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
// import attrAdd from './attr-add';
 | 
			
		||||
// import {DICT_TYPE, getDictDatas} from "@/utils/dict";
 | 
			
		||||
// import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
const topBtnConfig = [
 | 
			
		||||
  {
 | 
			
		||||
    type: 'add',
 | 
			
		||||
    btnName: 'btn.add'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	// mixins: [basicAdd],
 | 
			
		||||
	components: { SmallTitle },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			// tableBtn,
 | 
			
		||||
			// tableProps,
 | 
			
		||||
			// topBtnConfig,
 | 
			
		||||
			addOrUpdateVisible: false,
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
			  isGetCode: false,
 | 
			
		||||
        // codeURL: getCode,
 | 
			
		||||
        createURL: createQualityHotMaterial,
 | 
			
		||||
        updateURL: updateQualityHotMaterial,
 | 
			
		||||
        infoURL: getQualityHotMaterial,
 | 
			
		||||
			},
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				total: 0,
 | 
			
		||||
      },
 | 
			
		||||
      materialList: [],
 | 
			
		||||
      workerList: [],
 | 
			
		||||
      supplierList:[],
 | 
			
		||||
      equipmentList:[],
 | 
			
		||||
			dataForm: {
 | 
			
		||||
        id: undefined,
 | 
			
		||||
        materialId:null,
 | 
			
		||||
        supplierId: null,
 | 
			
		||||
        sampleCode: null,
 | 
			
		||||
        samplerId: null,
 | 
			
		||||
        checkerId: null,
 | 
			
		||||
        checkTime: null,
 | 
			
		||||
        appearance: null,
 | 
			
		||||
        checkResult: null,
 | 
			
		||||
        materialGrade: null,
 | 
			
		||||
			},
 | 
			
		||||
			productAttrList: [],
 | 
			
		||||
			visible: false,
 | 
			
		||||
			isdetail: false,
 | 
			
		||||
			idAttrShow: false,
 | 
			
		||||
			dataRule: {
 | 
			
		||||
        // code: [{ required: true, message: "设备物料编码不能为空", trigger: "blur" }],
 | 
			
		||||
        name: [{ required: true, message: "设备物料名称不能为空", trigger: "blur" }],
 | 
			
		||||
				equipmentId: [{ required: true, message: "设备名称不能为空", trigger: "change" }],
 | 
			
		||||
				// : [{ required: true, message: "产品类型不能为空", trigger: "change" }],
 | 
			
		||||
				// processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
 | 
			
		||||
      }
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
  mounted() {
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    dataFormSubmit() {
 | 
			
		||||
      this.$refs["dataForm"].validate((valid) => {
 | 
			
		||||
        if (!valid) {
 | 
			
		||||
          return false;
 | 
			
		||||
        }
 | 
			
		||||
        // 修改的提交
 | 
			
		||||
        if (this.dataForm.id) {
 | 
			
		||||
          this.urlOptions.updateURL(this.dataForm).then(response => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
            this.visible = false;
 | 
			
		||||
            this.$emit("refreshDataList");
 | 
			
		||||
          });
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
        // 添加的提交
 | 
			
		||||
        this.urlOptions.createURL(this.dataForm).then(response => {
 | 
			
		||||
          this.$modal.msgSuccess("新增成功");
 | 
			
		||||
          this.idAttrShow = true;
 | 
			
		||||
          this.dataForm.id = res.data
 | 
			
		||||
          this.$emit("refreshDataList");
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    getData(val) {
 | 
			
		||||
      console.log(val);
 | 
			
		||||
      getMaterialCheckList({
 | 
			
		||||
        materialId:val
 | 
			
		||||
      }).then((res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // clickTopBtn(val) {
 | 
			
		||||
    //   if (val === 'add') {
 | 
			
		||||
    //     this.addNew()
 | 
			
		||||
    //   }
 | 
			
		||||
    // },
 | 
			
		||||
		initData() {
 | 
			
		||||
			this.productAttrList.splice(0);
 | 
			
		||||
			this.listQuery.total = 0;
 | 
			
		||||
    },
 | 
			
		||||
    getDict() {
 | 
			
		||||
      getHotMaterialAllList().then((res) => {
 | 
			
		||||
        this.materialList = res.data
 | 
			
		||||
      })
 | 
			
		||||
      getWorkerList().then((res) => {
 | 
			
		||||
        this.workerList = res.data
 | 
			
		||||
      })
 | 
			
		||||
      getSupplierList().then(res => {
 | 
			
		||||
        this.supplierList = res.data
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
		handleClick(raw) {
 | 
			
		||||
			if (raw.type === 'delete') {
 | 
			
		||||
				this.$confirm(
 | 
			
		||||
					`确定对${
 | 
			
		||||
          raw.data.materialName
 | 
			
		||||
            ? '[物料名称为' + raw.data.materialName + ']'
 | 
			
		||||
            : '[序号为' + raw.data.materialName + ']'
 | 
			
		||||
					}进行删除操作?`,
 | 
			
		||||
					'提示',
 | 
			
		||||
					{
 | 
			
		||||
						confirmButtonText: '确定',
 | 
			
		||||
						cancelButtonText: '取消',
 | 
			
		||||
						type: 'warning',
 | 
			
		||||
					}
 | 
			
		||||
				)
 | 
			
		||||
					.then(() => {
 | 
			
		||||
            deleteProcessEquMaterialBomDet(raw.data.id).then(({ data }) => {
 | 
			
		||||
							this.$message({
 | 
			
		||||
								message: '操作成功',
 | 
			
		||||
								type: 'success',
 | 
			
		||||
								duration: 1500,
 | 
			
		||||
								onClose: () => {
 | 
			
		||||
									this.getList();
 | 
			
		||||
								},
 | 
			
		||||
							});
 | 
			
		||||
						});
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addNew(raw.data.id);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		getList() {
 | 
			
		||||
			// 获取产品属性列表
 | 
			
		||||
      processEquMaterialBomDetPage({
 | 
			
		||||
				...this.listQuery,
 | 
			
		||||
				bomId: this.dataForm.id,
 | 
			
		||||
			}).then((response) => {
 | 
			
		||||
				this.productAttrList = response.data.list;
 | 
			
		||||
				this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		init(id, isdetail) {
 | 
			
		||||
      this.initData()
 | 
			
		||||
      this.getDict()
 | 
			
		||||
			this.isdetail = isdetail || false;
 | 
			
		||||
			this.dataForm.id = id || undefined;
 | 
			
		||||
			this.visible = true;
 | 
			
		||||
			if (id) {
 | 
			
		||||
				this.idAttrShow = true
 | 
			
		||||
			} else {
 | 
			
		||||
				this.idAttrShow = false
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs['dataForm'].resetFields();
 | 
			
		||||
 | 
			
		||||
				if (this.dataForm.id) {
 | 
			
		||||
					// 获取产品详情
 | 
			
		||||
          this.urlOptions.infoURL({
 | 
			
		||||
            bomId: id,
 | 
			
		||||
            pageNo: 1,
 | 
			
		||||
            pageSize:10
 | 
			
		||||
          }).then(response => {
 | 
			
		||||
            this.dataForm = response.data
 | 
			
		||||
						this.dataForm.unit = String(this.dataForm.unit)
 | 
			
		||||
						this.dataForm.materialType = String(this.dataForm.materialType)
 | 
			
		||||
						this.dataForm.productType = String(this.dataForm.productType)
 | 
			
		||||
          });
 | 
			
		||||
					// 获取产品属性列表
 | 
			
		||||
					this.getList();
 | 
			
		||||
				} else {
 | 
			
		||||
					if (this.urlOptions.isGetCode) {
 | 
			
		||||
            this.getCode()
 | 
			
		||||
          }
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		goback() {
 | 
			
		||||
			this.$emit('refreshDataList');
 | 
			
		||||
			this.visible = false;
 | 
			
		||||
			// this.initData();
 | 
			
		||||
		},
 | 
			
		||||
		goEdit() {
 | 
			
		||||
			this.isdetail = false;
 | 
			
		||||
		},
 | 
			
		||||
		// 新增 / 修改
 | 
			
		||||
		addNew(id) {
 | 
			
		||||
			this.addOrUpdateVisible = true;
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs.addOrUpdate.init(id,this.dataForm.id);
 | 
			
		||||
			});
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped>
 | 
			
		||||
.drawer >>> .el-drawer {
 | 
			
		||||
	border-radius: 8px 0 0 8px;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-form-item__label {
 | 
			
		||||
	padding: 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-drawer__header {
 | 
			
		||||
	margin: 0;
 | 
			
		||||
	padding: 32px 32px 24px;
 | 
			
		||||
	border-bottom: 1px solid #dcdfe6;
 | 
			
		||||
}
 | 
			
		||||
.drawer >>> .el-drawer__body {
 | 
			
		||||
	flex: 1;
 | 
			
		||||
	height: 1px;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .content {
 | 
			
		||||
	padding: 30px 24px;
 | 
			
		||||
	flex: 1;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
	/* height: 100%; */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .visual-part {
 | 
			
		||||
	flex: 1 auto;
 | 
			
		||||
	max-height: 76vh;
 | 
			
		||||
	overflow: hidden;
 | 
			
		||||
	overflow-y: scroll;
 | 
			
		||||
	padding-right: 10px; /* 调整滚动条样式 */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-form,
 | 
			
		||||
.drawer >>> .attr-list {
 | 
			
		||||
	padding: 0 16px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer-body__footer {
 | 
			
		||||
	display: flex;
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
.action_btn {
 | 
			
		||||
  float: right;
 | 
			
		||||
  margin: -40px 15px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
.add {
 | 
			
		||||
	color: #0b58ff;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										182
									
								
								src/views/quality/base/qualityHotMaterial/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										182
									
								
								src/views/quality/base/qualityHotMaterial/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,182 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
 | 
			
		||||
    <base-table v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo"
 | 
			
		||||
      :limit="listQuery.pageSize" :table-data="tableData">
 | 
			
		||||
      <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick" />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
 | 
			
		||||
      @pagination="getDataList" />
 | 
			
		||||
    <!-- <base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="30%"> -->
 | 
			
		||||
    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
 | 
			
		||||
    <!-- </base-dialog> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import AddOrUpdate from './add-or-updata';
 | 
			
		||||
import basicPage from '../../../core/mixins/basic-page';
 | 
			
		||||
import { parseTime } from '../../../core/mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
  getQualityHotMaterialPage,
 | 
			
		||||
  deleteQualityHotMaterial,
 | 
			
		||||
  getHotMaterialAllList
 | 
			
		||||
} from '@/api/base/qualityHotMaterial';
 | 
			
		||||
// import { getList, } from "@/api/base/qualityScrapType";
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '添加时间',
 | 
			
		||||
		filter: parseTime
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'supplierName',
 | 
			
		||||
    label: '供应商'
 | 
			
		||||
  },
 | 
			
		||||
	{
 | 
			
		||||
    prop: 'materialName',
 | 
			
		||||
    label: '原料'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
    prop: 'sampleCode',
 | 
			
		||||
    label: '样品编号'
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
    prop: 'samplerName',
 | 
			
		||||
		label: '取样人'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'appearance',
 | 
			
		||||
    label: '是否合格'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'materialGrade',
 | 
			
		||||
    label: '原料等级'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'checkerName',
 | 
			
		||||
    label: '检测人员'
 | 
			
		||||
  },
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
        getDataListURL: getQualityHotMaterialPage,
 | 
			
		||||
        deleteURL: deleteQualityHotMaterial,
 | 
			
		||||
				// exportURL: exportFactoryExcel,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi(`base:quality-inspection-det:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
        this.$auth.hasPermi(`base:quality-inspection-det:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v)=>v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'input',
 | 
			
		||||
        //   label: '报废原因',
 | 
			
		||||
        //   placeholder: '报废原因',
 | 
			
		||||
        //   param: 'content',
 | 
			
		||||
        // },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '原料名称',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          labelField: 'name',
 | 
			
		||||
          valueField: 'id',
 | 
			
		||||
          param: 'materialId',
 | 
			
		||||
        },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
          type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {
 | 
			
		||||
		AddOrUpdate,
 | 
			
		||||
	},
 | 
			
		||||
  created() { },
 | 
			
		||||
  mounted () {
 | 
			
		||||
    this.getDict();
 | 
			
		||||
  },
 | 
			
		||||
	methods: {
 | 
			
		||||
		// 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
			
		||||
        this.tableData = response.data.list;
 | 
			
		||||
        this.listQuery.total = response.data.total;
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    async getDict() {
 | 
			
		||||
      // 物料列表
 | 
			
		||||
      const res = await getHotMaterialAllList();
 | 
			
		||||
      this.formConfig[0].selectOptions = res.data;
 | 
			
		||||
    },
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 10;
 | 
			
		||||
          this.listQuery.content = val.content ? val.content : undefined;
 | 
			
		||||
          this.listQuery.typeId = val.typeId ? val.typeId : undefined;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'reset':
 | 
			
		||||
					this.$refs.searchBarForm.resetForm();
 | 
			
		||||
					this.listQuery = {
 | 
			
		||||
						pageSize: 10,
 | 
			
		||||
						pageNo: 1,
 | 
			
		||||
						total: 1,
 | 
			
		||||
					};
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'add':
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.addOrUpdateVisible = true;
 | 
			
		||||
					this.addOrUpdateHandle();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'export':
 | 
			
		||||
					this.handleExport();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					console.log(val);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										270
									
								
								src/views/quality/base/qualityIsra/dialogForm.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										270
									
								
								src/views/quality/base/qualityIsra/dialogForm.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,270 @@
 | 
			
		||||
<!--
 | 
			
		||||
    filename: dialogForm.vue
 | 
			
		||||
    author: liubin
 | 
			
		||||
    date: 2023-09-11 15:55:13
 | 
			
		||||
    description: DialogForm for qualityInspectionRecord only
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
	<el-form
 | 
			
		||||
		ref="form"
 | 
			
		||||
		:model="innerDataForm"
 | 
			
		||||
		label-width="100px"
 | 
			
		||||
		v-loading="formLoading">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="检测内容"
 | 
			
		||||
					prop="inspectionDetId"
 | 
			
		||||
					:rules="[{ required: true, message: '检测内容不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="innerDataForm.inspectionDetId"
 | 
			
		||||
						placeholder="请选择检测内容"
 | 
			
		||||
						filterable
 | 
			
		||||
						clearable
 | 
			
		||||
						@change="handleInspectionDetChange">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="opt in inspectionDetList"
 | 
			
		||||
							:key="opt.value"
 | 
			
		||||
							:label="opt.label"
 | 
			
		||||
							:value="opt.value" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="来源"
 | 
			
		||||
					prop="source"
 | 
			
		||||
					:rules="[{ required: true, message: '来源不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="innerDataForm.source"
 | 
			
		||||
						placeholder="请选择来源"
 | 
			
		||||
						filterable
 | 
			
		||||
						clearable
 | 
			
		||||
						@change="$emit('update', innerDataForm)">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="opt in [
 | 
			
		||||
								{ label: '手动', value: 1 },
 | 
			
		||||
								{ label: '自动', value: 2 },
 | 
			
		||||
							]"
 | 
			
		||||
							:key="opt.value"
 | 
			
		||||
							:label="opt.label"
 | 
			
		||||
							:value="opt.value" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="产线"
 | 
			
		||||
					prop="productionLineId"
 | 
			
		||||
					:rules="[{ required: true, message: '产线不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="innerDataForm.productionLineId"
 | 
			
		||||
						placeholder="请选择产线"
 | 
			
		||||
						filterable
 | 
			
		||||
						clearable
 | 
			
		||||
						@change="handleProductlineChange">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="opt in productionLineList"
 | 
			
		||||
							:key="opt.value"
 | 
			
		||||
							:label="opt.label"
 | 
			
		||||
							:value="opt.value" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="工段"
 | 
			
		||||
					prop="sectionId"
 | 
			
		||||
					:rules="[{ required: true, message: '工段不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="innerDataForm.sectionId"
 | 
			
		||||
						placeholder="请选择工段"
 | 
			
		||||
						clearable
 | 
			
		||||
						filterable
 | 
			
		||||
						@change="$emit('update', innerDataForm)">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="opt in sectionList"
 | 
			
		||||
							:key="opt.value"
 | 
			
		||||
							:label="opt.label"
 | 
			
		||||
							:value="opt.value" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="检测人员" prop="checkPerson">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="innerDataForm.checkPerson"
 | 
			
		||||
						clearable
 | 
			
		||||
						@change="$emit('update', innerDataForm)"
 | 
			
		||||
						placeholder="请输入检测人员" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="检测时间"
 | 
			
		||||
					prop="checkTime"
 | 
			
		||||
					:rules="[{ required: true, message: '检测时间不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-date-picker
 | 
			
		||||
						v-model="innerDataForm.checkTime"
 | 
			
		||||
						type="datetime"
 | 
			
		||||
						placeholder="请选择检测时间"
 | 
			
		||||
						value-format="timestamp"
 | 
			
		||||
						@change="$emit('update', innerDataForm)"></el-date-picker>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col>
 | 
			
		||||
				<el-form-item label="描述" prop="explainText">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="innerDataForm.explainText"
 | 
			
		||||
						placeholder="请输入描述信息"
 | 
			
		||||
						@change="$emit('update', innerDataForm)"
 | 
			
		||||
						type="textarea"></el-input>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col>
 | 
			
		||||
				<el-form-item label="备注" prop="remark">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="innerDataForm.remark"
 | 
			
		||||
						@change="$emit('update', innerDataForm)"
 | 
			
		||||
						placeholder="请输入备注"></el-input>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'DialogForm',
 | 
			
		||||
	model: {
 | 
			
		||||
		prop: 'dataForm',
 | 
			
		||||
		event: 'update',
 | 
			
		||||
	},
 | 
			
		||||
	emits: ['update'],
 | 
			
		||||
	components: {},
 | 
			
		||||
	props: {
 | 
			
		||||
		dataForm: {
 | 
			
		||||
			type: Object,
 | 
			
		||||
			default: () => ({}),
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formLoading: true,
 | 
			
		||||
			inspectionDetList: [],
 | 
			
		||||
			productionLineList: [],
 | 
			
		||||
			sectionList: [],
 | 
			
		||||
			innerDataForm: {},
 | 
			
		||||
			cacheInspectionDetList: null,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		Promise.all([this.getProductLineList(), this.getInspectionDetList()]).then(
 | 
			
		||||
			() => {
 | 
			
		||||
				this.formLoading = false;
 | 
			
		||||
			}
 | 
			
		||||
		);
 | 
			
		||||
	},
 | 
			
		||||
	watch: {
 | 
			
		||||
		// 'innerDataForm.productionLineId': {
 | 
			
		||||
		// 	handler: async function (plId) {
 | 
			
		||||
		// 		if (plId) await this.getWorksectionList(plId);
 | 
			
		||||
		// 	},
 | 
			
		||||
		// 	immediate: true,
 | 
			
		||||
		// },
 | 
			
		||||
		dataForm: {
 | 
			
		||||
			handler: function (dataForm) {
 | 
			
		||||
				this.innerDataForm = Object.assign({}, dataForm);
 | 
			
		||||
 | 
			
		||||
				if (dataForm.productionLineId)
 | 
			
		||||
					this.getWorksectionList(dataForm.productionLineId);
 | 
			
		||||
			},
 | 
			
		||||
			immediate: true,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		/** 模拟透传 ref  */
 | 
			
		||||
		validate(cb) {
 | 
			
		||||
			return this.$refs.form.validate(cb);
 | 
			
		||||
		},
 | 
			
		||||
		resetFields(args) {
 | 
			
		||||
			return this.$refs.form.resetFields(args);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		handleInspectionDetChange(value) {
 | 
			
		||||
			const { id, content } = this.cacheInspectionDetList.find(
 | 
			
		||||
				(item) => item.id == value
 | 
			
		||||
			);
 | 
			
		||||
			this.innerDataForm.inspectionDetId = id;
 | 
			
		||||
			this.innerDataForm.inspectionDetContent = content;
 | 
			
		||||
			this.$emit('update', this.innerDataForm);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		async handleProductlineChange(id) {
 | 
			
		||||
			// await this.getWorksectionList(id);
 | 
			
		||||
			this.innerDataForm.sectionId = null;
 | 
			
		||||
			this.$emit('update', this.innerDataForm);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// getCode
 | 
			
		||||
		async getCode(url) {
 | 
			
		||||
			const response = await this.$axios(url);
 | 
			
		||||
			return response.data;
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// 获取产线列表
 | 
			
		||||
		async getProductLineList() {
 | 
			
		||||
      const response = await this.$axios('/base/core-production-line/listAll');
 | 
			
		||||
			this.productionLineList = response.data.map((item) => ({
 | 
			
		||||
				label: item.name,
 | 
			
		||||
				value: item.id,
 | 
			
		||||
			}));
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// 获取检测内容列表
 | 
			
		||||
		async getInspectionDetList() {
 | 
			
		||||
			const response = await this.$axios(
 | 
			
		||||
				'/base/quality-inspection-det/listAll'
 | 
			
		||||
			);
 | 
			
		||||
			this.cacheInspectionDetList = response.data;
 | 
			
		||||
			this.inspectionDetList = response.data.map((item) => ({
 | 
			
		||||
				label: item.content,
 | 
			
		||||
				value: item.id,
 | 
			
		||||
			}));
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// 获取工段列表
 | 
			
		||||
		async getWorksectionList(plId) {
 | 
			
		||||
			const response = await this.$axios(
 | 
			
		||||
				'/base/workshop-section/listByParentId',
 | 
			
		||||
				{
 | 
			
		||||
					params: {
 | 
			
		||||
						id: plId,
 | 
			
		||||
					},
 | 
			
		||||
				}
 | 
			
		||||
			);
 | 
			
		||||
			this.sectionList = response.data.map((item) => ({
 | 
			
		||||
				label: item.name,
 | 
			
		||||
				value: item.id,
 | 
			
		||||
			}));
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped lang="scss">
 | 
			
		||||
.el-date-editor,
 | 
			
		||||
.el-select {
 | 
			
		||||
	width: 100%;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										494
									
								
								src/views/quality/base/qualityIsra/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										494
									
								
								src/views/quality/base/qualityIsra/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,494 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="status-timegraph-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
 | 
			
		||||
    <el-row class="" style="
 | 
			
		||||
				margin-bottom: 12px;
 | 
			
		||||
				background: #fff;
 | 
			
		||||
				padding: 16px 16px 0;
 | 
			
		||||
				border-radius: 8px;
 | 
			
		||||
			">
 | 
			
		||||
      <!-- <div class="blue-title">生产节拍时序图</div> -->
 | 
			
		||||
      <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
      <!-- 列表 -->
 | 
			
		||||
      <base-table :table-props="tableProps" :page="1" :limit="10" :table-data="list">
 | 
			
		||||
      </base-table>
 | 
			
		||||
    </el-row>
 | 
			
		||||
 | 
			
		||||
    <el-row class="" style="
 | 
			
		||||
				height: 1px;
 | 
			
		||||
				flex: 1;
 | 
			
		||||
				margin-bottom: 12px;
 | 
			
		||||
				background: #fff;
 | 
			
		||||
				padding: 16px 16px 32px;
 | 
			
		||||
				border-radius: 8px;
 | 
			
		||||
				display: flex;
 | 
			
		||||
				flex-direction: column;
 | 
			
		||||
			">
 | 
			
		||||
      <el-row :gutter="20">
 | 
			
		||||
        <el-col :span="24">
 | 
			
		||||
          <div class="blue-title">
 | 
			
		||||
            <!-- <span > -->
 | 
			
		||||
            图表时间维度
 | 
			
		||||
            <!-- </span> -->
 | 
			
		||||
            <el-tabs style="margin-top: 10px;" v-model="activeName" type="card" @tab-click="handleClick">
 | 
			
		||||
              <el-tab-pane label="天" name="day">
 | 
			
		||||
                <div id="mapDayMain" style="height: 500px;width: 1000px;"></div>
 | 
			
		||||
                <div id="listDayMain" style="height: 500px;width: 1000px;"></div>
 | 
			
		||||
              </el-tab-pane>
 | 
			
		||||
              <el-tab-pane label="周" name="week">
 | 
			
		||||
                <div id="mapWeekMain" style="height: 500px;width: 1000px;"></div>
 | 
			
		||||
                <div id="listWeekMain" style="height: 500px;width: 1000px;"></div>
 | 
			
		||||
              </el-tab-pane>
 | 
			
		||||
              <el-tab-pane label="月" name="month">
 | 
			
		||||
                <div id="mapMonthMain" style="height: 500px;width: 1000px;"></div>
 | 
			
		||||
                <div id="listMonthMain" style="height: 500px;width: 1000px;"></div>
 | 
			
		||||
              </el-tab-pane>
 | 
			
		||||
              <!-- <el-tab-pane label="定时任务补偿" name="fourth">定时任务补偿</el-tab-pane> -->
 | 
			
		||||
            </el-tabs>
 | 
			
		||||
          </div>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <!-- <el-col :span="18" class="legend-row">
 | 
			
		||||
          <div class="legend">
 | 
			
		||||
            <div class="icon running"></div>
 | 
			
		||||
            <div>运行中</div>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="legend">
 | 
			
		||||
            <div class="icon fault"></div>
 | 
			
		||||
            <div>故障</div>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="legend">
 | 
			
		||||
            <div class="icon stop"></div>
 | 
			
		||||
            <div>计划停机</div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </el-col> -->
 | 
			
		||||
      </el-row>
 | 
			
		||||
      <!-- <div class="main-area" style="flex: 1; display: flex; flex-direction: column">
 | 
			
		||||
        <div class="graphs" v-show="graphList.length" id="status-chart" style="height: 1px; flex: 1"></div>
 | 
			
		||||
        <h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2>
 | 
			
		||||
      </div> -->
 | 
			
		||||
    </el-row>
 | 
			
		||||
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
  getQualityIsraPage,
 | 
			
		||||
  getQualityIsraDayMap,
 | 
			
		||||
  getQualityIsraWeekMap,
 | 
			
		||||
  getQualityIsraMonthMap,
 | 
			
		||||
  getQualityIsraDayList,
 | 
			
		||||
  getQualityIsraWeekList,
 | 
			
		||||
  getQualityIsraMonthList,
 | 
			
		||||
} from '@/api/monitoring/qualityIsra';
 | 
			
		||||
// import Editor from '@/components/Editor';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
// import DialogForm from './dialogForm.vue';
 | 
			
		||||
import * as echarts from 'echarts';
 | 
			
		||||
 | 
			
		||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'statisticalData',
 | 
			
		||||
	// components: {
 | 
			
		||||
	// 	DialogForm,
 | 
			
		||||
	// },
 | 
			
		||||
	// mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: [],
 | 
			
		||||
      dynamicProps: [],
 | 
			
		||||
      activeName: 'day',
 | 
			
		||||
      dayMapUrl: '/base/quality-isra-statistics/dayMap',
 | 
			
		||||
      weekMapUrl: '/base/quality-isra-statistics/weekMap',
 | 
			
		||||
      monthMapUrl: '/base/quality-isra-statistics/monthMap',
 | 
			
		||||
      dayListUrl: '/base/quality-isra-statistics/dayList',
 | 
			
		||||
      weekListUrl: '/base/quality-isra-statistics/weekList',
 | 
			
		||||
      monthListUrl: '/base/quality-isra-statistics/monthList',
 | 
			
		||||
      searchBarFormConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '缺陷类型',
 | 
			
		||||
          placeholder: '请选择缺陷类型',
 | 
			
		||||
          param: 'checkType',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          labelField: 'name',
 | 
			
		||||
          valueField: 'name',
 | 
			
		||||
          defaultSelect: []
 | 
			
		||||
        },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange', // datetimerange
 | 
			
		||||
					// format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始日期',
 | 
			
		||||
					endPlaceholder: '结束日期',
 | 
			
		||||
					defaultTime: ['00:00:00', '23:59:59'],
 | 
			
		||||
					param: 'checkTime',
 | 
			
		||||
					// width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
        checkType:undefined,
 | 
			
		||||
        // productionId: undefined,
 | 
			
		||||
        startTime: undefined,
 | 
			
		||||
        endTime: undefined,
 | 
			
		||||
				// productionLineId: null,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
  },
 | 
			
		||||
	created() {
 | 
			
		||||
		// this.getProductLineList();
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    tableProps() {
 | 
			
		||||
      return [
 | 
			
		||||
        {
 | 
			
		||||
          // width: 128,
 | 
			
		||||
          prop: 'checkType',
 | 
			
		||||
          label: '缺陷类型',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          // width: 128,
 | 
			
		||||
          prop: 'sumNum',
 | 
			
		||||
          label: '缺陷总数',
 | 
			
		||||
        },
 | 
			
		||||
        ...this.dynamicProps,
 | 
			
		||||
      ];
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // if (this.$route.query.woIdString) {
 | 
			
		||||
    //   console.log(this.$route.query.woIdString)
 | 
			
		||||
    //   this.queryParams.workOrderIdList = this.$route.query.woIdString.split(',')
 | 
			
		||||
    //   // this.queryParams.workOrderIdList = [this.$route.query.woIdString]
 | 
			
		||||
    //   // let arr =[]
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = this.$route.query.woIdString.split(',')
 | 
			
		||||
    //   console.log(this.searchBarFormConfig[0].defaultSelect);
 | 
			
		||||
    // }
 | 
			
		||||
    // if (this.$route.params.startTime && this.$route.params.endTime) {
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = [
 | 
			
		||||
    //     this.$route.params.startTime,
 | 
			
		||||
    //     this.$route.params.endTime,
 | 
			
		||||
    //   ];
 | 
			
		||||
    //   this.queryParams.param = {};
 | 
			
		||||
    //   this.$set(
 | 
			
		||||
    //     this.queryParams.param,
 | 
			
		||||
    //     'startTime',
 | 
			
		||||
    //     this.$route.params.startTime
 | 
			
		||||
    //   );
 | 
			
		||||
    //   this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
 | 
			
		||||
    // } else {
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = [];
 | 
			
		||||
    // }
 | 
			
		||||
    this.getList()
 | 
			
		||||
    this.getData()
 | 
			
		||||
    this.getDict()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    handleClick() {
 | 
			
		||||
      this.getData()
 | 
			
		||||
     },
 | 
			
		||||
    getData() {
 | 
			
		||||
      this.$axios({
 | 
			
		||||
        url: this.activeName === 'day' ? this.dayMapUrl : this.activeName === 'week' ? this.weekMapUrl : this.monthMapUrl,
 | 
			
		||||
          method: 'get',
 | 
			
		||||
          params: this.queryParams
 | 
			
		||||
      }).then((res) => {
 | 
			
		||||
        let mapArr= []
 | 
			
		||||
        let mapLegendData = []
 | 
			
		||||
        // let mapXAxisData = []
 | 
			
		||||
        for (let i in res.data) {
 | 
			
		||||
          let obj = {
 | 
			
		||||
            name: '',
 | 
			
		||||
            type: 'line',
 | 
			
		||||
            // stack: 'Total',
 | 
			
		||||
            data: [],
 | 
			
		||||
            mapXAxisData:[],
 | 
			
		||||
          }
 | 
			
		||||
          // console.log(i)
 | 
			
		||||
          let dataArr = []
 | 
			
		||||
          res.data[i].forEach(ele => {
 | 
			
		||||
            dataArr.push(ele.num)
 | 
			
		||||
            obj.mapXAxisData.push(ele.checkTime)
 | 
			
		||||
          })
 | 
			
		||||
          obj.name = i
 | 
			
		||||
          obj.data = dataArr
 | 
			
		||||
          mapLegendData.push(i)
 | 
			
		||||
          mapArr.push(obj)
 | 
			
		||||
        }
 | 
			
		||||
        // console.log(res.data[res]);
 | 
			
		||||
        var chartDom = this.activeName === 'day' ? document.getElementById('mapDayMain') : this.activeName === 'week' ? document.getElementById('mapWeekMain') : document.getElementById('mapMonthMain')
 | 
			
		||||
        var myChart = echarts.init(chartDom);
 | 
			
		||||
        var option;
 | 
			
		||||
        option = {
 | 
			
		||||
          title: {
 | 
			
		||||
            text: '各类型缺陷对比图'
 | 
			
		||||
          },
 | 
			
		||||
          tooltip: {
 | 
			
		||||
            trigger: 'axis'
 | 
			
		||||
          },
 | 
			
		||||
          legend: {
 | 
			
		||||
            data: mapLegendData
 | 
			
		||||
          },
 | 
			
		||||
          grid: {
 | 
			
		||||
            left: '3%',
 | 
			
		||||
            right: '4%',
 | 
			
		||||
            bottom: '3%',
 | 
			
		||||
            containLabel: true
 | 
			
		||||
          },
 | 
			
		||||
          // toolbox: {
 | 
			
		||||
          //   feature: {
 | 
			
		||||
          //     saveAsImage: {}
 | 
			
		||||
          //   }
 | 
			
		||||
          // },
 | 
			
		||||
          xAxis: {
 | 
			
		||||
            type: 'category',
 | 
			
		||||
            // boundaryGap: false,
 | 
			
		||||
            data: mapArr[0].mapXAxisData
 | 
			
		||||
          },
 | 
			
		||||
          yAxis: {
 | 
			
		||||
            type: 'value'
 | 
			
		||||
          },
 | 
			
		||||
          series: mapArr
 | 
			
		||||
        }
 | 
			
		||||
        option && myChart.setOption(option);
 | 
			
		||||
      })
 | 
			
		||||
      this.$axios({
 | 
			
		||||
        url: this.activeName === 'day' ? this.dayListUrl : this.activeName === 'week' ? this.weekListUrl : this.monthListUrl,
 | 
			
		||||
        method: 'get',
 | 
			
		||||
        params: this.queryParams
 | 
			
		||||
      }).then((res) => {
 | 
			
		||||
        // console.log(res);
 | 
			
		||||
        let listNumArr = []
 | 
			
		||||
        let listRatioArr = []
 | 
			
		||||
        // let listLegendData = []
 | 
			
		||||
        let listXAxisData = []
 | 
			
		||||
        // for (let i in res.data) {
 | 
			
		||||
          // console.log(i)
 | 
			
		||||
          // let dataArr = []
 | 
			
		||||
        res.data.forEach(ele => {;
 | 
			
		||||
            listNumArr.push(ele.num)
 | 
			
		||||
            listRatioArr.push(ele.ratio)
 | 
			
		||||
            listXAxisData.push(ele.checkTime)
 | 
			
		||||
        })
 | 
			
		||||
        console.log(listNumArr);
 | 
			
		||||
          // obj.name = i
 | 
			
		||||
          // obj.data = dataArr
 | 
			
		||||
          // listLegendData.push(i)
 | 
			
		||||
          // listArr.push(obj)
 | 
			
		||||
        // }
 | 
			
		||||
        // console.log(res.data[res]);
 | 
			
		||||
        var chartDom = this.activeName === 'day' ? document.getElementById('listDayMain') : this.activeName === 'week' ? document.getElementById('listWeekMain') : document.getElementById('listMonthMain')
 | 
			
		||||
        var myChart = echarts.init(chartDom);
 | 
			
		||||
        var option;
 | 
			
		||||
        option = {
 | 
			
		||||
          title: {
 | 
			
		||||
            text: '缺陷率趋势图'
 | 
			
		||||
          },
 | 
			
		||||
          tooltip: {
 | 
			
		||||
            trigger: 'axis'
 | 
			
		||||
          },
 | 
			
		||||
          legend: {
 | 
			
		||||
            data: ['缺陷数量', '缺陷率']
 | 
			
		||||
          },
 | 
			
		||||
          grid: {
 | 
			
		||||
            left: '3%',
 | 
			
		||||
            right: '4%',
 | 
			
		||||
            bottom: '3%',
 | 
			
		||||
            containLabel: true
 | 
			
		||||
          },
 | 
			
		||||
          // toolbox: {
 | 
			
		||||
          //   feature: {
 | 
			
		||||
          //     saveAsImage: {}
 | 
			
		||||
          //   }
 | 
			
		||||
          // },
 | 
			
		||||
          xAxis: {
 | 
			
		||||
            type: 'category',
 | 
			
		||||
            // boundaryGap: false,
 | 
			
		||||
            data: listXAxisData
 | 
			
		||||
          },
 | 
			
		||||
          yAxis: [
 | 
			
		||||
            {
 | 
			
		||||
              type: 'value',
 | 
			
		||||
              name: '缺陷数量',
 | 
			
		||||
              // min: 0,
 | 
			
		||||
              // max: 250,
 | 
			
		||||
              // interval: 50,
 | 
			
		||||
              // axisLabel: {
 | 
			
		||||
              //   formatter: '{value} ml'
 | 
			
		||||
              // }
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
              type: 'value',
 | 
			
		||||
              name: '缺陷率',
 | 
			
		||||
              // min: 0,
 | 
			
		||||
              // max: 25,
 | 
			
		||||
              // interval: 5,
 | 
			
		||||
              axisLabel: {
 | 
			
		||||
                formatter: '{value} %'
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          ],
 | 
			
		||||
          series: [
 | 
			
		||||
            {
 | 
			
		||||
              name: '缺陷数量',
 | 
			
		||||
              type: 'bar',
 | 
			
		||||
              barWidth: '3%',
 | 
			
		||||
              data: listNumArr,
 | 
			
		||||
              label: {
 | 
			
		||||
                show: true, //开启显示
 | 
			
		||||
                position: 'top', //在上方显示
 | 
			
		||||
                // formatter: '{c}%',//显示百分号
 | 
			
		||||
                textStyle: { //数值样式
 | 
			
		||||
                  color: 'black',//字体颜色
 | 
			
		||||
                  fontSize: 20//字体大小
 | 
			
		||||
                }
 | 
			
		||||
              }
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
              name: '缺陷率',
 | 
			
		||||
              type: 'line',
 | 
			
		||||
              yAxisIndex: 1,
 | 
			
		||||
              tooltip: {
 | 
			
		||||
                valueFormatter: function (value) {
 | 
			
		||||
                  return value + '%';
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              data: listRatioArr
 | 
			
		||||
            }
 | 
			
		||||
          ]
 | 
			
		||||
        }
 | 
			
		||||
        option && myChart.setOption(option);
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    /** 获取搜索栏的产线列表 */
 | 
			
		||||
    async getDict() {
 | 
			
		||||
      // const res = await getProductList()
 | 
			
		||||
      // const result = await getWorkOrderList()
 | 
			
		||||
      const res = await this.$axios({
 | 
			
		||||
        url: '/base/quality-isra-standards/page',
 | 
			
		||||
        method: 'get',
 | 
			
		||||
        params: {
 | 
			
		||||
          pageSize: 100,
 | 
			
		||||
          pageNo:1
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
      console.log(res)
 | 
			
		||||
      this.searchBarFormConfig[0].selectOptions = res.data.list
 | 
			
		||||
      // this.searchBarFormConfig[1].selectOptions = res.data.map((item) => {
 | 
			
		||||
      //   return {
 | 
			
		||||
      //     name: item.name,
 | 
			
		||||
      //     id:item.id
 | 
			
		||||
      //   }
 | 
			
		||||
      // })
 | 
			
		||||
      // this.searchBarFormConfig[0].selectOptions = result.data.map((item) => {
 | 
			
		||||
      //   return {
 | 
			
		||||
      //     name: item.name,
 | 
			
		||||
      //     id: item.id
 | 
			
		||||
      //   }
 | 
			
		||||
      // })
 | 
			
		||||
    },
 | 
			
		||||
		// getProductLineList() {
 | 
			
		||||
		// 	this.$axios('/base/production-line/listAll').then((response) => {
 | 
			
		||||
		// 		this.searchBarFormConfig[0].selectOptions = response.data.map(
 | 
			
		||||
		// 			(item) => {
 | 
			
		||||
		// 				return {
 | 
			
		||||
		// 					name: item.name,
 | 
			
		||||
		// 					id: item.id,
 | 
			
		||||
		// 				};
 | 
			
		||||
		// 			}
 | 
			
		||||
		// 		);
 | 
			
		||||
		// 	});
 | 
			
		||||
    // },
 | 
			
		||||
    getList() {
 | 
			
		||||
      this.getDataList()
 | 
			
		||||
    },
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      console.log(this.queryParams);
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
      const {
 | 
			
		||||
        data: { data, otherList, otherMap, nameData },
 | 
			
		||||
      } = await getQualityIsraPage(this.queryParams)
 | 
			
		||||
      console.log(this.queryParams);
 | 
			
		||||
      this.dynamicProps = this.filterNameData(nameData)
 | 
			
		||||
      this.list = this.filterData(data);
 | 
			
		||||
    },
 | 
			
		||||
    filterNameData(nameData) {
 | 
			
		||||
      const ndSet = new Set();
 | 
			
		||||
      nameData.forEach((nd) => {
 | 
			
		||||
        ndSet.add(nd.name);
 | 
			
		||||
      });
 | 
			
		||||
      return Array.from(ndSet.values())
 | 
			
		||||
        .sort()
 | 
			
		||||
        .map((name) => ({
 | 
			
		||||
          prop: name,
 | 
			
		||||
          label: name,
 | 
			
		||||
        }));
 | 
			
		||||
    },
 | 
			
		||||
    filterData(data) {
 | 
			
		||||
      return data.map((item) => {
 | 
			
		||||
        const { data: innerData } = item;
 | 
			
		||||
        const keyValuePairs = {};
 | 
			
		||||
        innerData.map((d) => {
 | 
			
		||||
          keyValuePairs[d.dynamicName] = d.dynamicValue;
 | 
			
		||||
        });
 | 
			
		||||
        return {
 | 
			
		||||
          // inspectionContent: item.inspectionContent,
 | 
			
		||||
          ...keyValuePairs,
 | 
			
		||||
          sumNum: item.sumNum,
 | 
			
		||||
          // sumInput: item.sumInput,
 | 
			
		||||
          // productionName: item.productionName,
 | 
			
		||||
          checkType: item.checkType,
 | 
			
		||||
          // scrapRatio: item.scrapRatio,
 | 
			
		||||
        };
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
    handleSearchBarBtnClick(val) {
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.queryParams.checkType = val.checkType ? val.checkType : undefined
 | 
			
		||||
        // this.queryParams.productionId = val.productionId ? val.productionId : undefined
 | 
			
		||||
        this.queryParams.startTime = val.checkTime ? val.checkTime[0] : undefined
 | 
			
		||||
        this.queryParams.endTime = val.checkTime ? val.checkTime[1] : undefined
 | 
			
		||||
 | 
			
		||||
        this.getList()
 | 
			
		||||
      }
 | 
			
		||||
     console.log(val);
 | 
			
		||||
    }
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style  lang="scss">
 | 
			
		||||
.blue-title {
 | 
			
		||||
  position: relative;
 | 
			
		||||
  padding: 4px 0;
 | 
			
		||||
  padding-left: 12px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
  color: #606266;
 | 
			
		||||
  font-weight: 700;
 | 
			
		||||
  margin-bottom: 12px;
 | 
			
		||||
 | 
			
		||||
  &::before {
 | 
			
		||||
    content: '';
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    left: 0;
 | 
			
		||||
    top: 6px;
 | 
			
		||||
    height: 16px;
 | 
			
		||||
    width: 4px;
 | 
			
		||||
    border-radius: 1px;
 | 
			
		||||
    background: #0b58ff;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										252
									
								
								src/views/quality/monitoring/originalGlassRetrace/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										252
									
								
								src/views/quality/monitoring/originalGlassRetrace/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,252 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 14:55:51
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-12-06 14:08:00
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
 | 
			
		||||
    <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
 | 
			
		||||
      <!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick" /> -->
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
 | 
			
		||||
      @pagination="getList" />
 | 
			
		||||
    <!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
// import AddOrUpdate from './add-or-updata';
 | 
			
		||||
// import unitDict from './unitDict';
 | 
			
		||||
// import basicPage from '../mixins/basic-page';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import { parseTime } from '../mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
  getOriginalGlassRetrace,
 | 
			
		||||
  getWorkOrderList,
 | 
			
		||||
  // exportEnergyPlcExcel
 | 
			
		||||
} from '@/api/quality/rawMaterialTraceability';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workOrderName',
 | 
			
		||||
    label: '工单名称',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'palletNumber',
 | 
			
		||||
    label: '托号',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'transportQuantity',
 | 
			
		||||
    label: '该托片数',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packagingCode',
 | 
			
		||||
    label: '包装条码',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '原片产线',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'originalGlassOutputTime',
 | 
			
		||||
    label: '原片下片时间',
 | 
			
		||||
    filter: parseTime
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'batch',
 | 
			
		||||
    label: '深加工产线',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deepProcessingInputTime',
 | 
			
		||||
    label: '深加工上片时间',
 | 
			
		||||
    filter: parseTime
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productionOutputTime',
 | 
			
		||||
    label: '深加工下片时间',
 | 
			
		||||
    filter: parseTime
 | 
			
		||||
  }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  // mixins: [basicPage],
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      // urlOptions: {
 | 
			
		||||
      //   getDataListURL: getMaterialUseLogPage,
 | 
			
		||||
      //   // deleteURL: deletePackingType,
 | 
			
		||||
      //   // exportURL: exportPackingExcel,
 | 
			
		||||
      // },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      // tableBtn: [
 | 
			
		||||
      //   this.$auth.hasPermi(`base:packaging-print-log:update`)
 | 
			
		||||
      //     ? {
 | 
			
		||||
      //       type: 'edit',
 | 
			
		||||
      //       btnName: '编辑',
 | 
			
		||||
      //     }
 | 
			
		||||
      //     : undefined,
 | 
			
		||||
      //   this.$auth.hasPermi(`base:packaging-print-log:delete`)
 | 
			
		||||
      //     ? {
 | 
			
		||||
      //       type: 'delete',
 | 
			
		||||
      //       btnName: '删除',
 | 
			
		||||
      //     }
 | 
			
		||||
      //     : undefined,
 | 
			
		||||
 | 
			
		||||
      // ].filter((v) => v),
 | 
			
		||||
      list: [],
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        total: 0,
 | 
			
		||||
        workOrderId: undefined,
 | 
			
		||||
        startTime: undefined,
 | 
			
		||||
        endTime:undefined,
 | 
			
		||||
      },
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '工单',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          labelField: 'name',
 | 
			
		||||
          valueField: 'id',
 | 
			
		||||
          param: 'workOrderId'
 | 
			
		||||
        },
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'datePicker',
 | 
			
		||||
        //   label: '时间段',
 | 
			
		||||
        //   dateType: 'daterange',
 | 
			
		||||
        //   format: 'yyyy-MM-dd',
 | 
			
		||||
        //   valueFormat: "yyyy-MM-dd",
 | 
			
		||||
        //   rangeSeparator: '-',
 | 
			
		||||
        //   startPlaceholder: '开始时间',
 | 
			
		||||
        //   endPlaceholder: '结束时间',
 | 
			
		||||
        //   param: 'timeVal',
 | 
			
		||||
        //   defaultSelect: [],
 | 
			
		||||
        //   width: 250
 | 
			
		||||
        // },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
        },
 | 
			
		||||
        // {
 | 
			
		||||
        // 	type: 'separate',
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        // 	type: 'button',
 | 
			
		||||
        // 	btnName: '重置',
 | 
			
		||||
        // 	name: 'reset',
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'separate',
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
 | 
			
		||||
        //   btnName: '新增',
 | 
			
		||||
        //   name: 'add',
 | 
			
		||||
        //   color: 'success',
 | 
			
		||||
        //   plain: true,
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        // 	type: 'separate',
 | 
			
		||||
        // 	type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
 | 
			
		||||
        // 	btnName: '导出',
 | 
			
		||||
        // 	name: 'export',
 | 
			
		||||
        // 	color: 'warning',
 | 
			
		||||
        // },
 | 
			
		||||
      ],
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  components: {
 | 
			
		||||
    // AddOrUpdate,
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    this.getList()
 | 
			
		||||
    this.getDict()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList() {
 | 
			
		||||
      getOriginalGlassRetrace({ ...this.listQuery }).then(res => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        this.list = res.data || []
 | 
			
		||||
        console.log(this.list);
 | 
			
		||||
        // this.listQuery.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    getDict() {
 | 
			
		||||
      // 获取产品的属性列表
 | 
			
		||||
      // getCustomerList().then((response) => {
 | 
			
		||||
      //   console.log(response);
 | 
			
		||||
      //   this.customerList = response.data
 | 
			
		||||
      //   // this.listQuery.total = response.data.total;
 | 
			
		||||
      // })
 | 
			
		||||
      // getModelList().then((response) => {
 | 
			
		||||
      //   console.log(response);
 | 
			
		||||
      //   this.modelList = response.data
 | 
			
		||||
      //   // this.listQuery.total = response.data.total;
 | 
			
		||||
      // })
 | 
			
		||||
      getWorkOrderList().then((response) => {
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.formConfig[0].selectOptions = response.data.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            name: item.name,
 | 
			
		||||
            id: item.id
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // handleExport() {
 | 
			
		||||
    //   // 处理查询参数
 | 
			
		||||
    //   let params = { ...this.listQuery };
 | 
			
		||||
    //   params.pageNo = undefined;
 | 
			
		||||
    //   params.pageSize = undefined;
 | 
			
		||||
    //   this.$modal.confirm('是否确认导出所有数据项?').then(() => {
 | 
			
		||||
    //     this.exportLoading = true;
 | 
			
		||||
    //     return exportEnergyPlcExcel(params);
 | 
			
		||||
    //   }).then(response => {
 | 
			
		||||
    //     this.$download.excel(response, '物料信息追溯  ');
 | 
			
		||||
    //     this.exportLoading = false;
 | 
			
		||||
    //   }).catch(() => { });
 | 
			
		||||
    // },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.listQuery.workOrderId = val.workOrderId ? val.workOrderId :undefined
 | 
			
		||||
        // this.queryParams.status = val.status
 | 
			
		||||
        // if (val.timeVal && val.timeVal.length != 0 ) {
 | 
			
		||||
        // this.listQuery.startTime =  val.timeVal[0] + ' 00:00:00'
 | 
			
		||||
        // this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
 | 
			
		||||
        // } else {
 | 
			
		||||
        //   this.listQuery.startTime = undefined
 | 
			
		||||
        //   this.listQuery.endTime = undefined
 | 
			
		||||
        // }
 | 
			
		||||
        this.getList()
 | 
			
		||||
      } else {
 | 
			
		||||
        // this.handleExport()
 | 
			
		||||
        // this.addOrEditTitle = '新增'
 | 
			
		||||
        // this.centervisible = true
 | 
			
		||||
        // this.$nextTick(() => {
 | 
			
		||||
        //   this.$refs.orderAdd.init()
 | 
			
		||||
        // })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    otherMethods(val) {
 | 
			
		||||
      this.addOrUpdateVisible = true;
 | 
			
		||||
      this.addOrEditTitle = '详情';
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs.addOrUpdate.init(val.data.id, true);
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 14:55:51
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2023-12-01 16:38:00
 | 
			
		||||
 * @LastEditTime: 2023-12-06 08:57:53
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -75,21 +75,21 @@ export default {
 | 
			
		||||
      //   // exportURL: exportPackingExcel,
 | 
			
		||||
      // },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi(`base:packaging-print-log:update`)
 | 
			
		||||
          ? {
 | 
			
		||||
            type: 'edit',
 | 
			
		||||
            btnName: '编辑',
 | 
			
		||||
          }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi(`base:packaging-print-log:delete`)
 | 
			
		||||
          ? {
 | 
			
		||||
            type: 'delete',
 | 
			
		||||
            btnName: '删除',
 | 
			
		||||
          }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      // tableBtn: [
 | 
			
		||||
      //   this.$auth.hasPermi(`base:packaging-print-log:update`)
 | 
			
		||||
      //     ? {
 | 
			
		||||
      //       type: 'edit',
 | 
			
		||||
      //       btnName: '编辑',
 | 
			
		||||
      //     }
 | 
			
		||||
      //     : undefined,
 | 
			
		||||
      //   this.$auth.hasPermi(`base:packaging-print-log:delete`)
 | 
			
		||||
      //     ? {
 | 
			
		||||
      //       type: 'delete',
 | 
			
		||||
      //       btnName: '删除',
 | 
			
		||||
      //     }
 | 
			
		||||
      //     : undefined,
 | 
			
		||||
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      // ].filter((v) => v),
 | 
			
		||||
      list: [],
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										37
									
								
								src/views/report/productionMonthReport/InputArea.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								src/views/report/productionMonthReport/InputArea.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="tableInner">
 | 
			
		||||
    <el-input v-model="list[itemProp]" @blur="changeInput" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'InputArea',
 | 
			
		||||
  props: {
 | 
			
		||||
    injectData: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => ({})
 | 
			
		||||
    },
 | 
			
		||||
    itemProp: {
 | 
			
		||||
      type: String
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: this.injectData
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    changeInput() {
 | 
			
		||||
      console.log(this.list)
 | 
			
		||||
      this.$emit('emitData', this.list)
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style>
 | 
			
		||||
.tableInner .el-input__inner {
 | 
			
		||||
  border: none;
 | 
			
		||||
  padding: 0;
 | 
			
		||||
  height: 33px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										530
									
								
								src/views/report/productionMonthReport/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										530
									
								
								src/views/report/productionMonthReport/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,530 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-12 13:45:25
 | 
			
		||||
 * @LastEditTime: 2023-12-13 15:17:53
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <el-form :inline="true" :model="dataForm" class="demo-form-inline">
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-date-picker v-model="monthValue" type="monthrange" range-separator="至" start-placeholder="开始日期"
 | 
			
		||||
          end-placeholder="结束日期" value-format="timestamp" :clearable="false" :picker-options="pickerOptions"
 | 
			
		||||
          size="small" style='width:350px;' @change="timeSelect">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button type="primary" @click="getDataList()">查询</el-button>
 | 
			
		||||
      <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
 | 
			
		||||
      <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button>
 | 
			
		||||
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <el-table :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }">
 | 
			
		||||
      <el-table-column  :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
 | 
			
		||||
        <el-table-column prop="lineId" label="生产线">
 | 
			
		||||
          <template slot-scope="scope">
 | 
			
		||||
            <el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
 | 
			
		||||
            <span v-else>{{ scope.row.lineId }} </span>
 | 
			
		||||
          </template>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="投入数㎡">
 | 
			
		||||
          <el-table-column prop="inputNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.inputNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="inputHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.inputHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="inputTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.inputTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="完成良品产量">
 | 
			
		||||
          <el-table-column prop="goodProductNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="原片漏检率">
 | 
			
		||||
          <el-table-column prop="missCheckNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.missCheckNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="missCheckHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.missCheckHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="missCheckTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.missCheckTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="综合良品率">
 | 
			
		||||
          <el-table-column prop="goodProductPassNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductPassNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductPassHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductPassHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductPassTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductPassTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <div style="height: 50px;" class="remark" slot="append">
 | 
			
		||||
        <h3 style="float: left;text-align: center;margin-left: 20px;">备注:</h3>
 | 
			
		||||
        <el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
 | 
			
		||||
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <!-- <base-table :table-props="tableProps" :page="1" :limit="10" :summary-method="getSummaries" show-summary
 | 
			
		||||
      :table-data="list">
 | 
			
		||||
    </base-table> -->
 | 
			
		||||
    <!-- 分页组件 -->
 | 
			
		||||
    <!-- <pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" /> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
  getProductionDataList,
 | 
			
		||||
  updateProductionDataList,
 | 
			
		||||
  updateSumProductionDataList
 | 
			
		||||
} from '@/api/report/production';
 | 
			
		||||
// import Editor from '@/components/Editor';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
// import DialogForm from './dialogForm.vue';
 | 
			
		||||
 | 
			
		||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
    {
 | 
			
		||||
      // width: 128,
 | 
			
		||||
    prop: 'lineId',
 | 
			
		||||
    label: '生产线',
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      // width: 128,
 | 
			
		||||
      prop: '',
 | 
			
		||||
      label: '投入数㎡',
 | 
			
		||||
      align: 'center',
 | 
			
		||||
      children: [
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'inputNow',
 | 
			
		||||
          label: '本周'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'inputHis',
 | 
			
		||||
          label: '上周'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'inputTrend',
 | 
			
		||||
          label: '增减'
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
  {
 | 
			
		||||
    // width: 128,
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '完成良品产量',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductNow',
 | 
			
		||||
        label: '本周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductHis',
 | 
			
		||||
        label: '上周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductTrend',
 | 
			
		||||
        label: '增减'
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    // width: 128,
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '原片漏检率',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'missCheckNow',
 | 
			
		||||
        label: '本周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'missCheckHis',
 | 
			
		||||
        label: '上周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'missCheckTrend',
 | 
			
		||||
        label: '增减'
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    // width: 128,
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '综合良品率',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductPassNow',
 | 
			
		||||
        label: '本周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductPassHis',
 | 
			
		||||
        label: '上周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductPassTrend',
 | 
			
		||||
        label: '增减'
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  ];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'statisticalData',
 | 
			
		||||
	// components: {
 | 
			
		||||
	// 	DialogForm,
 | 
			
		||||
	// },
 | 
			
		||||
	// mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: [],
 | 
			
		||||
      remark: '',
 | 
			
		||||
      monthValue:[],
 | 
			
		||||
      // dynamicProps: [],
 | 
			
		||||
      tableProps,
 | 
			
		||||
      // dataForm: {
 | 
			
		||||
      //   reportTime:undefined
 | 
			
		||||
      // },
 | 
			
		||||
      isSave:false,
 | 
			
		||||
      disabled: true,
 | 
			
		||||
      sumArr: [],
 | 
			
		||||
      timeTips:'',
 | 
			
		||||
      searchBarFormConfig: [
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'select',
 | 
			
		||||
        //   label: '工单名称',
 | 
			
		||||
        //   placeholder: '请选择工单名称',
 | 
			
		||||
        //   param: 'workOrderIdList',
 | 
			
		||||
        //   selectOptions: [],
 | 
			
		||||
        //   multiple: true,
 | 
			
		||||
        //   labelField: 'name',
 | 
			
		||||
        //   valueField: 'id',
 | 
			
		||||
        //   defaultSelect: []
 | 
			
		||||
        // },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'select',
 | 
			
		||||
				// 	label: '产品',
 | 
			
		||||
        //   placeholder: '请选择产品',
 | 
			
		||||
        //   param: 'productionId',
 | 
			
		||||
				// 	selectOptions: [],
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'input',
 | 
			
		||||
				// 	label: '检测内容',
 | 
			
		||||
				// 	placeholder: '请输入检测内容',
 | 
			
		||||
				// 	param: 'inspectionDetContent',
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange', // datetimerange
 | 
			
		||||
					// format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始日期',
 | 
			
		||||
					endPlaceholder: '结束日期',
 | 
			
		||||
					defaultTime: ['00:00:00', '23:59:59'],
 | 
			
		||||
					param: 'checkTime',
 | 
			
		||||
					// width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi(
 | 
			
		||||
				// 		'base:quality-inspection-record:create'
 | 
			
		||||
				// 	)
 | 
			
		||||
				// 		? 'button'
 | 
			
		||||
				// 		: '',
 | 
			
		||||
				// 	btnName: '新增',
 | 
			
		||||
				// 	name: 'add',
 | 
			
		||||
				// 	plain: true,
 | 
			
		||||
				// 	color: 'success',
 | 
			
		||||
				// },
 | 
			
		||||
      ],
 | 
			
		||||
      pickerOptions: {
 | 
			
		||||
        disabledDate(date) {
 | 
			
		||||
          return date.getTime() > Date.now()
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
			// tableBtn: [
 | 
			
		||||
			// 	this.$auth.hasPermi('base:quality-inspection-record:update')
 | 
			
		||||
			// 		? {
 | 
			
		||||
			// 				type: 'edit',
 | 
			
		||||
			// 				btnName: '修改',
 | 
			
		||||
			// 		  }
 | 
			
		||||
			// 		: undefined,
 | 
			
		||||
      //   this.$auth.hasPermi('base:quality-inspection-record:delete')
 | 
			
		||||
			// 		? {
 | 
			
		||||
			// 				type: 'delete',
 | 
			
		||||
			// 				btnName: '删除',
 | 
			
		||||
			// 		  }
 | 
			
		||||
			// 		: undefined,
 | 
			
		||||
			// ].filter((v) => v),
 | 
			
		||||
			// tableProps: [
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		prop: 'createTime',
 | 
			
		||||
			// 		label: '添加时间',
 | 
			
		||||
			// 		fixed: true,
 | 
			
		||||
			// 		width: 180,
 | 
			
		||||
			// 		filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
			// 	},
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		// width: 128,
 | 
			
		||||
			// 		prop: 'inspectionDetContent',
 | 
			
		||||
			// 		label: '检测内容',
 | 
			
		||||
			// 	},
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		// width: 128,
 | 
			
		||||
			// 		prop: 'lineName',
 | 
			
		||||
			// 		label: '产线',
 | 
			
		||||
			// 	},
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		// width: 128,
 | 
			
		||||
			// 		prop: 'checkPerson',
 | 
			
		||||
			// 		label: '检测人员',
 | 
			
		||||
			// 	},
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		// width: 160,
 | 
			
		||||
			// 		prop: 'checkTime',
 | 
			
		||||
			// 		label: '检测时间',
 | 
			
		||||
			// 		filter: (val) =>
 | 
			
		||||
			// 			val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '-',
 | 
			
		||||
			// 	},
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		width: 90,
 | 
			
		||||
			// 		prop: 'source',
 | 
			
		||||
			// 		label: '来源',
 | 
			
		||||
			// 		filter: (val) => ['未知', '手动', '自动'][val],
 | 
			
		||||
			// 	},
 | 
			
		||||
			// ],
 | 
			
		||||
      // 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
 | 
			
		||||
 | 
			
		||||
			// searchBarKeys: ['inspectionDetContent', 'checkTime', 'productionLineId'],
 | 
			
		||||
			// form: {
 | 
			
		||||
			// 	id: undefined,
 | 
			
		||||
			// 	inspectionDetId: undefined,
 | 
			
		||||
			// 	inspectionDetContent: undefined,
 | 
			
		||||
			// 	productionLineId: undefined,
 | 
			
		||||
			// 	sectionId: undefined,
 | 
			
		||||
			// 	checkPerson: undefined,
 | 
			
		||||
			// 	checkTime: undefined,
 | 
			
		||||
			// 	source: undefined,
 | 
			
		||||
			// 	explainText: undefined,
 | 
			
		||||
			// 	remark: undefined,
 | 
			
		||||
			// },
 | 
			
		||||
			// 查询参数
 | 
			
		||||
      dataForm: {
 | 
			
		||||
        // workOrderIdList:undefined,
 | 
			
		||||
        // productionId: undefined,
 | 
			
		||||
        // startTime: undefined,
 | 
			
		||||
        // endTime: undefined,
 | 
			
		||||
        reportTime: [],
 | 
			
		||||
        reportType:4,
 | 
			
		||||
				// productionLineId: null,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
  },
 | 
			
		||||
	created() {
 | 
			
		||||
		// this.getProductLineList();
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // if (this.$route.params.startTime && this.$route.params.endTime) {
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = [
 | 
			
		||||
    //     this.$route.params.startTime,
 | 
			
		||||
    //     this.$route.params.endTime,
 | 
			
		||||
    //   ];
 | 
			
		||||
    //   this.queryParams.param = {};
 | 
			
		||||
    //   this.$set(
 | 
			
		||||
    //     this.queryParams.param,
 | 
			
		||||
    //     'startTime',
 | 
			
		||||
    //     this.$route.params.startTime
 | 
			
		||||
    //   );
 | 
			
		||||
    //   this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
 | 
			
		||||
    // } else {
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = [];
 | 
			
		||||
    // }
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    timeSelect() {
 | 
			
		||||
      // switch (this.queryParams.timeDim) {
 | 
			
		||||
        // case '1':
 | 
			
		||||
        //   if (this.timeValue[1] - this.timeValue[0] > 7 * 24 * 3600000) {
 | 
			
		||||
        //     this.$modal.msgError('最大时间范围为7天,请重新选择')
 | 
			
		||||
        //     this.timeValue = []
 | 
			
		||||
        //   }
 | 
			
		||||
        //   break
 | 
			
		||||
        // case '2':
 | 
			
		||||
      if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
 | 
			
		||||
        this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
 | 
			
		||||
        this.monthValue = []
 | 
			
		||||
      }
 | 
			
		||||
        //   break
 | 
			
		||||
        // case '4':
 | 
			
		||||
        //   if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
 | 
			
		||||
        //     this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
 | 
			
		||||
        //     this.monthValue = []
 | 
			
		||||
        //   }
 | 
			
		||||
        //   break
 | 
			
		||||
        // default:
 | 
			
		||||
    },
 | 
			
		||||
    transformTime(timeStamp) {// 本月最后一天
 | 
			
		||||
      let year = moment(timeStamp).format('YYYY')
 | 
			
		||||
      let month = moment(timeStamp).format('MM')
 | 
			
		||||
      let newData = moment(new Date(year, month, 0)).format('YYYY-MM-DD') + ' 23:59:59'
 | 
			
		||||
      let value = newData
 | 
			
		||||
      console.log(value);
 | 
			
		||||
      return value
 | 
			
		||||
    },
 | 
			
		||||
    // selectTime() {
 | 
			
		||||
    //   switch (this.queryParams.type) {
 | 
			
		||||
    //     case 1:
 | 
			
		||||
    //       this.queryParams.searchTime = this.monthValue
 | 
			
		||||
    //       break;
 | 
			
		||||
    //     case 2:
 | 
			
		||||
    //       this.queryParams.searchTime = this.weekValue
 | 
			
		||||
    //       break;
 | 
			
		||||
    //     default:
 | 
			
		||||
    //       this.queryParams.searchTime = this.dateValue
 | 
			
		||||
    //   }
 | 
			
		||||
    // },
 | 
			
		||||
    editDataList() {
 | 
			
		||||
      this.disabled = false
 | 
			
		||||
      this.isSave = true
 | 
			
		||||
    },
 | 
			
		||||
    async saveDataList() {
 | 
			
		||||
      let obj = {}
 | 
			
		||||
      this.list.forEach((ele, index) => {
 | 
			
		||||
        if (ele.det === false) {
 | 
			
		||||
          this.list[index].lineId = ''
 | 
			
		||||
          this.list[index].remark = this.remark
 | 
			
		||||
          obj = ele
 | 
			
		||||
          this.list.splice(index,1)
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
      let updateArr = this.list
 | 
			
		||||
      // console.log(JSON.stringify(updateArr[1]))
 | 
			
		||||
      const result = await Promise.all([
 | 
			
		||||
        await updateSumProductionDataList(obj),
 | 
			
		||||
        await updateProductionDataList(updateArr),
 | 
			
		||||
      ]);
 | 
			
		||||
      if (result[0] == true && result[1] == true) {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        this.disabled = true
 | 
			
		||||
        this.isSave = false
 | 
			
		||||
        this.getDataList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$modal.msgError('更新失败');
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      if (this.monthValue.length > 0) {
 | 
			
		||||
        console.log(this.monthValue)
 | 
			
		||||
        this.dataForm.reportTime[0] = this.transformTime(this.monthValue[0])
 | 
			
		||||
        // this.queryParams.startTime = this.monthValue[0]
 | 
			
		||||
        this.dataForm.reportTime[1] = this.transformTime(this.monthValue[1])
 | 
			
		||||
        this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
 | 
			
		||||
        console.log(this.timeTips);
 | 
			
		||||
      } else {
 | 
			
		||||
        // this.$modal.msgError('月范围不能为空')
 | 
			
		||||
        // return false
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      console.log(this.dataForm);
 | 
			
		||||
      const res = await this.$axios({
 | 
			
		||||
        url: '/base/report-auto-production/page',
 | 
			
		||||
        method: 'get',
 | 
			
		||||
        params: this.dataForm
 | 
			
		||||
      })
 | 
			
		||||
      console.log(res)
 | 
			
		||||
      // let sum = undefined
 | 
			
		||||
      // res.data.list.forEach((ele, index) => {
 | 
			
		||||
      //   if (ele.det === false) {
 | 
			
		||||
      //    sum = res.data.list.splice(index, 1)
 | 
			
		||||
      //   }
 | 
			
		||||
      // })
 | 
			
		||||
      res.data.list.forEach((ele,index) => {
 | 
			
		||||
        if (ele.det === false) {
 | 
			
		||||
          res.data.list[index].lineId = '合计'
 | 
			
		||||
          this.remark = res.data.list[index].remark
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
      this.list = res.data.list
 | 
			
		||||
    },
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										37
									
								
								src/views/report/productionShipmentsReport/InputArea.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								src/views/report/productionShipmentsReport/InputArea.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="tableInner">
 | 
			
		||||
    <el-input v-model="list[itemProp]" @blur="changeInput" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'InputArea',
 | 
			
		||||
  props: {
 | 
			
		||||
    injectData: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => ({})
 | 
			
		||||
    },
 | 
			
		||||
    itemProp: {
 | 
			
		||||
      type: String
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: this.injectData
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    changeInput() {
 | 
			
		||||
      console.log(this.list)
 | 
			
		||||
      this.$emit('emitData', this.list)
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style>
 | 
			
		||||
.tableInner .el-input__inner {
 | 
			
		||||
  border: none;
 | 
			
		||||
  padding: 0;
 | 
			
		||||
  height: 33px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										532
									
								
								src/views/report/productionShipmentsReport/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										532
									
								
								src/views/report/productionShipmentsReport/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,532 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-12 13:45:25
 | 
			
		||||
 * @LastEditTime: 2023-12-13 16:36:33
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <el-form :inline="true" :model="dataForm" class="demo-form-inline">
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-date-picker v-model="monthValue" type="monthrange" range-separator="至" start-placeholder="开始日期"
 | 
			
		||||
          end-placeholder="结束日期" value-format="timestamp" :clearable="false" :picker-options="pickerOptions"
 | 
			
		||||
          size="small" style='width:350px;' @change="timeSelect">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button type="primary" @click="getDataList()">查询</el-button>
 | 
			
		||||
      <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
 | 
			
		||||
      <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button>
 | 
			
		||||
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <el-table :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }">
 | 
			
		||||
      <el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
 | 
			
		||||
        <el-table-column prop="glassType" label="品种">
 | 
			
		||||
          <template slot-scope="scope">
 | 
			
		||||
            <el-input v-if="scope.row.det === true" v-model="scope.row.glassType" :disabled="disabled"></el-input>
 | 
			
		||||
            <span v-else>{{ scope.row.glassType }} </span>
 | 
			
		||||
          </template>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="投入数㎡">
 | 
			
		||||
          <el-table-column prop="inputNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.inputNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="inputHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.inputHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="inputTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.inputTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="完成良品产量">
 | 
			
		||||
          <el-table-column prop="goodProductNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="原片漏检率">
 | 
			
		||||
          <el-table-column prop="missCheckNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.missCheckNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="missCheckHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.missCheckHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="missCheckTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.missCheckTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="综合良品率">
 | 
			
		||||
          <el-table-column prop="goodProductPassNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductPassNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductPassHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductPassHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductPassTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductPassTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <div style="height: 50px;" class="remark" slot="append">
 | 
			
		||||
        <h3 style="float: left;text-align: center;margin-left: 20px;">备注:</h3>
 | 
			
		||||
        <el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
 | 
			
		||||
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <!-- <base-table :table-props="tableProps" :page="1" :limit="10" :summary-method="getSummaries" show-summary
 | 
			
		||||
      :table-data="list">
 | 
			
		||||
    </base-table> -->
 | 
			
		||||
    <!-- 分页组件 -->
 | 
			
		||||
    <!-- <pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" /> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
  getAutoDeliveDataList,
 | 
			
		||||
  updateProductionDataList,
 | 
			
		||||
  updateSumProductionDataList
 | 
			
		||||
} from '@/api/report/production';
 | 
			
		||||
// import Editor from '@/components/Editor';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
// import DialogForm from './dialogForm.vue';
 | 
			
		||||
 | 
			
		||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
    {
 | 
			
		||||
      // width: 128,
 | 
			
		||||
    prop: 'lineId',
 | 
			
		||||
    label: '生产线',
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      // width: 128,
 | 
			
		||||
      prop: '',
 | 
			
		||||
      label: '投入数㎡',
 | 
			
		||||
      align: 'center',
 | 
			
		||||
      children: [
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'inputNow',
 | 
			
		||||
          label: '本周'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'inputHis',
 | 
			
		||||
          label: '上周'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'inputTrend',
 | 
			
		||||
          label: '增减'
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
  {
 | 
			
		||||
    // width: 128,
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '完成良品产量',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductNow',
 | 
			
		||||
        label: '本周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductHis',
 | 
			
		||||
        label: '上周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductTrend',
 | 
			
		||||
        label: '增减'
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    // width: 128,
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '原片漏检率',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'missCheckNow',
 | 
			
		||||
        label: '本周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'missCheckHis',
 | 
			
		||||
        label: '上周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'missCheckTrend',
 | 
			
		||||
        label: '增减'
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    // width: 128,
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '综合良品率',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductPassNow',
 | 
			
		||||
        label: '本周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductPassHis',
 | 
			
		||||
        label: '上周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductPassTrend',
 | 
			
		||||
        label: '增减'
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  ];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'statisticalData',
 | 
			
		||||
	// components: {
 | 
			
		||||
	// 	DialogForm,
 | 
			
		||||
	// },
 | 
			
		||||
	// mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: [],
 | 
			
		||||
      remark: '',
 | 
			
		||||
      monthValue:[],
 | 
			
		||||
      // dynamicProps: [],
 | 
			
		||||
      tableProps,
 | 
			
		||||
      // dataForm: {
 | 
			
		||||
      //   reportTime:undefined
 | 
			
		||||
      // },
 | 
			
		||||
      isSave:false,
 | 
			
		||||
      disabled: true,
 | 
			
		||||
      sumArr: [],
 | 
			
		||||
      timeTips:'',
 | 
			
		||||
      searchBarFormConfig: [
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'select',
 | 
			
		||||
        //   label: '工单名称',
 | 
			
		||||
        //   placeholder: '请选择工单名称',
 | 
			
		||||
        //   param: 'workOrderIdList',
 | 
			
		||||
        //   selectOptions: [],
 | 
			
		||||
        //   multiple: true,
 | 
			
		||||
        //   labelField: 'name',
 | 
			
		||||
        //   valueField: 'id',
 | 
			
		||||
        //   defaultSelect: []
 | 
			
		||||
        // },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'select',
 | 
			
		||||
				// 	label: '产品',
 | 
			
		||||
        //   placeholder: '请选择产品',
 | 
			
		||||
        //   param: 'productionId',
 | 
			
		||||
				// 	selectOptions: [],
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'input',
 | 
			
		||||
				// 	label: '检测内容',
 | 
			
		||||
				// 	placeholder: '请输入检测内容',
 | 
			
		||||
				// 	param: 'inspectionDetContent',
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange', // datetimerange
 | 
			
		||||
					// format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始日期',
 | 
			
		||||
					endPlaceholder: '结束日期',
 | 
			
		||||
					defaultTime: ['00:00:00', '23:59:59'],
 | 
			
		||||
					param: 'checkTime',
 | 
			
		||||
					// width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi(
 | 
			
		||||
				// 		'base:quality-inspection-record:create'
 | 
			
		||||
				// 	)
 | 
			
		||||
				// 		? 'button'
 | 
			
		||||
				// 		: '',
 | 
			
		||||
				// 	btnName: '新增',
 | 
			
		||||
				// 	name: 'add',
 | 
			
		||||
				// 	plain: true,
 | 
			
		||||
				// 	color: 'success',
 | 
			
		||||
				// },
 | 
			
		||||
      ],
 | 
			
		||||
      pickerOptions: {
 | 
			
		||||
        disabledDate(date) {
 | 
			
		||||
          return date.getTime() > Date.now()
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
			// tableBtn: [
 | 
			
		||||
			// 	this.$auth.hasPermi('base:quality-inspection-record:update')
 | 
			
		||||
			// 		? {
 | 
			
		||||
			// 				type: 'edit',
 | 
			
		||||
			// 				btnName: '修改',
 | 
			
		||||
			// 		  }
 | 
			
		||||
			// 		: undefined,
 | 
			
		||||
      //   this.$auth.hasPermi('base:quality-inspection-record:delete')
 | 
			
		||||
			// 		? {
 | 
			
		||||
			// 				type: 'delete',
 | 
			
		||||
			// 				btnName: '删除',
 | 
			
		||||
			// 		  }
 | 
			
		||||
			// 		: undefined,
 | 
			
		||||
			// ].filter((v) => v),
 | 
			
		||||
			// tableProps: [
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		prop: 'createTime',
 | 
			
		||||
			// 		label: '添加时间',
 | 
			
		||||
			// 		fixed: true,
 | 
			
		||||
			// 		width: 180,
 | 
			
		||||
			// 		filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
			// 	},
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		// width: 128,
 | 
			
		||||
			// 		prop: 'inspectionDetContent',
 | 
			
		||||
			// 		label: '检测内容',
 | 
			
		||||
			// 	},
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		// width: 128,
 | 
			
		||||
			// 		prop: 'lineName',
 | 
			
		||||
			// 		label: '产线',
 | 
			
		||||
			// 	},
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		// width: 128,
 | 
			
		||||
			// 		prop: 'checkPerson',
 | 
			
		||||
			// 		label: '检测人员',
 | 
			
		||||
			// 	},
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		// width: 160,
 | 
			
		||||
			// 		prop: 'checkTime',
 | 
			
		||||
			// 		label: '检测时间',
 | 
			
		||||
			// 		filter: (val) =>
 | 
			
		||||
			// 			val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '-',
 | 
			
		||||
			// 	},
 | 
			
		||||
			// 	{
 | 
			
		||||
			// 		width: 90,
 | 
			
		||||
			// 		prop: 'source',
 | 
			
		||||
			// 		label: '来源',
 | 
			
		||||
			// 		filter: (val) => ['未知', '手动', '自动'][val],
 | 
			
		||||
			// 	},
 | 
			
		||||
			// ],
 | 
			
		||||
      // 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
 | 
			
		||||
 | 
			
		||||
			// searchBarKeys: ['inspectionDetContent', 'checkTime', 'productionLineId'],
 | 
			
		||||
			// form: {
 | 
			
		||||
			// 	id: undefined,
 | 
			
		||||
			// 	inspectionDetId: undefined,
 | 
			
		||||
			// 	inspectionDetContent: undefined,
 | 
			
		||||
			// 	productionLineId: undefined,
 | 
			
		||||
			// 	sectionId: undefined,
 | 
			
		||||
			// 	checkPerson: undefined,
 | 
			
		||||
			// 	checkTime: undefined,
 | 
			
		||||
			// 	source: undefined,
 | 
			
		||||
			// 	explainText: undefined,
 | 
			
		||||
			// 	remark: undefined,
 | 
			
		||||
			// },
 | 
			
		||||
			// 查询参数
 | 
			
		||||
      dataForm: {
 | 
			
		||||
        // pageSize: 100,
 | 
			
		||||
        // pageNo:1,
 | 
			
		||||
        // workOrderIdList:undefined,
 | 
			
		||||
        // productionId: undefined,
 | 
			
		||||
        // startTime: undefined,
 | 
			
		||||
        // endTime: undefined,
 | 
			
		||||
        reportTime: [],
 | 
			
		||||
        // reportType:4,
 | 
			
		||||
				// productionLineId: null,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
  },
 | 
			
		||||
	created() {
 | 
			
		||||
		// this.getProductLineList();
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // if (this.$route.params.startTime && this.$route.params.endTime) {
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = [
 | 
			
		||||
    //     this.$route.params.startTime,
 | 
			
		||||
    //     this.$route.params.endTime,
 | 
			
		||||
    //   ];
 | 
			
		||||
    //   this.queryParams.param = {};
 | 
			
		||||
    //   this.$set(
 | 
			
		||||
    //     this.queryParams.param,
 | 
			
		||||
    //     'startTime',
 | 
			
		||||
    //     this.$route.params.startTime
 | 
			
		||||
    //   );
 | 
			
		||||
    //   this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
 | 
			
		||||
    // } else {
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = [];
 | 
			
		||||
    // }
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    timeSelect() {
 | 
			
		||||
      // switch (this.queryParams.timeDim) {
 | 
			
		||||
        // case '1':
 | 
			
		||||
        //   if (this.timeValue[1] - this.timeValue[0] > 7 * 24 * 3600000) {
 | 
			
		||||
        //     this.$modal.msgError('最大时间范围为7天,请重新选择')
 | 
			
		||||
        //     this.timeValue = []
 | 
			
		||||
        //   }
 | 
			
		||||
        //   break
 | 
			
		||||
        // case '2':
 | 
			
		||||
      if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
 | 
			
		||||
        this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
 | 
			
		||||
        this.monthValue = []
 | 
			
		||||
      }
 | 
			
		||||
        //   break
 | 
			
		||||
        // case '4':
 | 
			
		||||
        //   if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
 | 
			
		||||
        //     this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
 | 
			
		||||
        //     this.monthValue = []
 | 
			
		||||
        //   }
 | 
			
		||||
        //   break
 | 
			
		||||
        // default:
 | 
			
		||||
    },
 | 
			
		||||
    transformTime(timeStamp) {// 本月最后一天
 | 
			
		||||
      let year = moment(timeStamp).format('YYYY')
 | 
			
		||||
      let month = moment(timeStamp).format('MM')
 | 
			
		||||
      let newData = moment(new Date(year, month, 0)).format('YYYY-MM-DD') + ' 23:59:59'
 | 
			
		||||
      let value = newData
 | 
			
		||||
      console.log(value);
 | 
			
		||||
      return value
 | 
			
		||||
    },
 | 
			
		||||
    // selectTime() {
 | 
			
		||||
    //   switch (this.queryParams.type) {
 | 
			
		||||
    //     case 1:
 | 
			
		||||
    //       this.queryParams.searchTime = this.monthValue
 | 
			
		||||
    //       break;
 | 
			
		||||
    //     case 2:
 | 
			
		||||
    //       this.queryParams.searchTime = this.weekValue
 | 
			
		||||
    //       break;
 | 
			
		||||
    //     default:
 | 
			
		||||
    //       this.queryParams.searchTime = this.dateValue
 | 
			
		||||
    //   }
 | 
			
		||||
    // },
 | 
			
		||||
    editDataList() {
 | 
			
		||||
      this.disabled = false
 | 
			
		||||
      this.isSave = true
 | 
			
		||||
    },
 | 
			
		||||
    async saveDataList() {
 | 
			
		||||
      let obj = {}
 | 
			
		||||
      this.list.forEach((ele, index) => {
 | 
			
		||||
        if (ele.det === false) {
 | 
			
		||||
          this.list[index].lineId = ''
 | 
			
		||||
          this.list[index].remark = this.remark
 | 
			
		||||
          obj = ele
 | 
			
		||||
          this.list.splice(index,1)
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
      let updateArr = this.list
 | 
			
		||||
      // console.log(JSON.stringify(updateArr[1]))
 | 
			
		||||
      const result = await Promise.all([
 | 
			
		||||
        await updateSumProductionDataList(obj),
 | 
			
		||||
        await updateProductionDataList(updateArr),
 | 
			
		||||
      ]);
 | 
			
		||||
      if (result[0] == true && result[1] == true) {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        this.disabled = true
 | 
			
		||||
        this.isSave = false
 | 
			
		||||
        this.getDataList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$modal.msgError('更新失败');
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      if (this.monthValue.length > 0) {
 | 
			
		||||
        console.log(this.monthValue)
 | 
			
		||||
        this.dataForm.reportTime[0] = this.transformTime(this.monthValue[0])
 | 
			
		||||
        // this.queryParams.startTime = this.monthValue[0]
 | 
			
		||||
        this.dataForm.reportTime[1] = this.transformTime(this.monthValue[1])
 | 
			
		||||
        this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
 | 
			
		||||
        console.log(this.timeTips);
 | 
			
		||||
      } else {
 | 
			
		||||
        // this.$modal.msgError('月范围不能为空')
 | 
			
		||||
        // return false
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      console.log(this.dataForm);
 | 
			
		||||
      const res = await this.$axios({
 | 
			
		||||
        url: 'base/report-auto-delive/listPlus',
 | 
			
		||||
        method: 'get',
 | 
			
		||||
        params: this.dataForm
 | 
			
		||||
      })
 | 
			
		||||
      console.log(res)
 | 
			
		||||
      // let sum = undefined
 | 
			
		||||
      // res.data.list.forEach((ele, index) => {
 | 
			
		||||
      //   if (ele.det === false) {
 | 
			
		||||
      //    sum = res.data.list.splice(index, 1)
 | 
			
		||||
      //   }
 | 
			
		||||
      // })
 | 
			
		||||
      // res.data.forEach((ele,index) => {
 | 
			
		||||
      //   if (ele.det === false) {
 | 
			
		||||
      //     res.data.list[index].lineId = '合计'
 | 
			
		||||
      //     this.remark = res.data.list[index].remark
 | 
			
		||||
      //   }
 | 
			
		||||
      // });
 | 
			
		||||
      this.list = res.data
 | 
			
		||||
    },
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										37
									
								
								src/views/report/productionWeekReport/InputArea.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								src/views/report/productionWeekReport/InputArea.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="tableInner">
 | 
			
		||||
    <el-input v-model="list[itemProp]" @blur="changeInput" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'InputArea',
 | 
			
		||||
  props: {
 | 
			
		||||
    injectData: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => ({})
 | 
			
		||||
    },
 | 
			
		||||
    itemProp: {
 | 
			
		||||
      type: String
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: this.injectData
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    changeInput() {
 | 
			
		||||
      console.log(this.list)
 | 
			
		||||
      this.$emit('emitData', this.list)
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style>
 | 
			
		||||
.tableInner .el-input__inner {
 | 
			
		||||
  border: none;
 | 
			
		||||
  padding: 0;
 | 
			
		||||
  height: 33px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										455
									
								
								src/views/report/productionWeekReport/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										455
									
								
								src/views/report/productionWeekReport/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,455 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-12 13:45:25
 | 
			
		||||
 * @LastEditTime: 2023-12-13 15:17:39
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <el-form :inline="true" :model="dataForm" class="demo-form-inline">
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-date-picker v-model="weekValue1" type="week" format="yyyy 第 WW 周" style='width:170px;'
 | 
			
		||||
          :picker-options="pickerOptionsWeek" @change="startWeek" :clearable="false" size="small" placeholder="选择周">
 | 
			
		||||
        </el-date-picker>-
 | 
			
		||||
        <el-date-picker v-model="weekValue2" type="week" format="yyyy 第 WW 周" :picker-options="pickerOptionsWeek"
 | 
			
		||||
          style='width:170px;' @change="endWeek" :clearable="false" size="small" placeholder="选择周">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button type="primary" @click="getDataList()">查询</el-button>
 | 
			
		||||
      <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
 | 
			
		||||
      <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button>
 | 
			
		||||
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <el-table :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }">
 | 
			
		||||
      <el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
 | 
			
		||||
        <el-table-column prop="lineId" label="生产线">
 | 
			
		||||
          <template slot-scope="scope">
 | 
			
		||||
            <el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
 | 
			
		||||
            <span v-else>{{ scope.row.lineId }} </span>
 | 
			
		||||
          </template>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="投入数㎡">
 | 
			
		||||
          <el-table-column prop="inputNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.inputNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="inputHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.inputHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="inputTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.inputTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="完成良品产量">
 | 
			
		||||
          <el-table-column prop="goodProductNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="原片漏检率">
 | 
			
		||||
          <el-table-column prop="missCheckNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.missCheckNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="missCheckHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.missCheckHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="missCheckTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.missCheckTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="综合良品率">
 | 
			
		||||
          <el-table-column prop="goodProductPassNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductPassNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductPassHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductPassHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductPassTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductPassTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <div style="height: 50px;" class="remark" slot="append">
 | 
			
		||||
        <h3 style="float: left;text-align: center;margin-left: 20px;">备注:</h3>
 | 
			
		||||
        <el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
 | 
			
		||||
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <!-- <base-table :table-props="tableProps" :page="1" :limit="10" :summary-method="getSummaries" show-summary
 | 
			
		||||
      :table-data="list">
 | 
			
		||||
    </base-table> -->
 | 
			
		||||
    <!-- 分页组件 -->
 | 
			
		||||
    <!-- <pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" /> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
  getProductionDataList,
 | 
			
		||||
  updateProductionDataList,
 | 
			
		||||
  updateSumProductionDataList
 | 
			
		||||
} from '@/api/report/production';
 | 
			
		||||
// import Editor from '@/components/Editor';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
// import DialogForm from './dialogForm.vue';
 | 
			
		||||
 | 
			
		||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
    {
 | 
			
		||||
      // width: 128,
 | 
			
		||||
    prop: 'lineId',
 | 
			
		||||
    label: '生产线',
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      // width: 128,
 | 
			
		||||
      prop: '',
 | 
			
		||||
      label: '投入数㎡',
 | 
			
		||||
      align: 'center',
 | 
			
		||||
      children: [
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'inputNow',
 | 
			
		||||
          label: '本周'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'inputHis',
 | 
			
		||||
          label: '上周'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'inputTrend',
 | 
			
		||||
          label: '增减'
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
  {
 | 
			
		||||
    // width: 128,
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '完成良品产量',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductNow',
 | 
			
		||||
        label: '本周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductHis',
 | 
			
		||||
        label: '上周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductTrend',
 | 
			
		||||
        label: '增减'
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    // width: 128,
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '原片漏检率',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'missCheckNow',
 | 
			
		||||
        label: '本周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'missCheckHis',
 | 
			
		||||
        label: '上周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'missCheckTrend',
 | 
			
		||||
        label: '增减'
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    // width: 128,
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '综合良品率',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductPassNow',
 | 
			
		||||
        label: '本周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductPassHis',
 | 
			
		||||
        label: '上周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductPassTrend',
 | 
			
		||||
        label: '增减'
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  ];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'statisticalData',
 | 
			
		||||
	// components: {
 | 
			
		||||
	// 	DialogForm,
 | 
			
		||||
	// },
 | 
			
		||||
	// mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: [],
 | 
			
		||||
      remark:'',
 | 
			
		||||
      // dynamicProps: [],
 | 
			
		||||
      tableProps,
 | 
			
		||||
      timeTips:'',
 | 
			
		||||
      // dataForm: {
 | 
			
		||||
      //   reportTime:undefined
 | 
			
		||||
      // },
 | 
			
		||||
      isSave:false,
 | 
			
		||||
      disabled: true,
 | 
			
		||||
      sumArr: [],
 | 
			
		||||
      weekValue1: null,//最多24周
 | 
			
		||||
      weekValue2: null,
 | 
			
		||||
      searchBarFormConfig: [
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'select',
 | 
			
		||||
        //   label: '工单名称',
 | 
			
		||||
        //   placeholder: '请选择工单名称',
 | 
			
		||||
        //   param: 'workOrderIdList',
 | 
			
		||||
        //   selectOptions: [],
 | 
			
		||||
        //   multiple: true,
 | 
			
		||||
        //   labelField: 'name',
 | 
			
		||||
        //   valueField: 'id',
 | 
			
		||||
        //   defaultSelect: []
 | 
			
		||||
        // },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'select',
 | 
			
		||||
				// 	label: '产品',
 | 
			
		||||
        //   placeholder: '请选择产品',
 | 
			
		||||
        //   param: 'productionId',
 | 
			
		||||
				// 	selectOptions: [],
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'input',
 | 
			
		||||
				// 	label: '检测内容',
 | 
			
		||||
				// 	placeholder: '请输入检测内容',
 | 
			
		||||
				// 	param: 'inspectionDetContent',
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange', // datetimerange
 | 
			
		||||
					// format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始日期',
 | 
			
		||||
					endPlaceholder: '结束日期',
 | 
			
		||||
					defaultTime: ['00:00:00', '23:59:59'],
 | 
			
		||||
					param: 'checkTime',
 | 
			
		||||
					// width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi(
 | 
			
		||||
				// 		'base:quality-inspection-record:create'
 | 
			
		||||
				// 	)
 | 
			
		||||
				// 		? 'button'
 | 
			
		||||
				// 		: '',
 | 
			
		||||
				// 	btnName: '新增',
 | 
			
		||||
				// 	name: 'add',
 | 
			
		||||
				// 	plain: true,
 | 
			
		||||
				// 	color: 'success',
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
      pickerOptionsWeek: {
 | 
			
		||||
        disabledDate(time) {
 | 
			
		||||
          let day = Date.now()
 | 
			
		||||
          let limitTime = moment(day).day(-1)
 | 
			
		||||
          return time.getTime() > new Date(limitTime).getTime()
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      dataForm: {
 | 
			
		||||
        // workOrderIdList:undefined,
 | 
			
		||||
        // productionId: undefined,
 | 
			
		||||
        // startTime: undefined,
 | 
			
		||||
        // endTime: undefined,
 | 
			
		||||
        reportTime: [],
 | 
			
		||||
        reportType:3
 | 
			
		||||
				// productionLineId: null,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
  },
 | 
			
		||||
	created() {
 | 
			
		||||
		// this.getProductLineList();
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // if (this.$route.params.startTime && this.$route.params.endTime) {
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = [
 | 
			
		||||
    //     this.$route.params.startTime,
 | 
			
		||||
    //     this.$route.params.endTime,
 | 
			
		||||
    //   ];
 | 
			
		||||
    //   this.queryParams.param = {};
 | 
			
		||||
    //   this.$set(
 | 
			
		||||
    //     this.queryParams.param,
 | 
			
		||||
    //     'startTime',
 | 
			
		||||
    //     this.$route.params.startTime
 | 
			
		||||
    //   );
 | 
			
		||||
    //   this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
 | 
			
		||||
    // } else {
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = [];
 | 
			
		||||
    // }
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    startWeek() {
 | 
			
		||||
      if (this.weekValue1 && this.weekValue2) {
 | 
			
		||||
        let a = new Date(this.weekValue1).getTime()
 | 
			
		||||
        let b = new Date(this.weekValue2).getTime()
 | 
			
		||||
        if (a > b) {
 | 
			
		||||
          this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
 | 
			
		||||
          this.weekValue1 = null
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
        if (b - a > 167 * 24 * 3600000) {
 | 
			
		||||
          this.$modal.msgError('最大时间范围为24周,请重新选择')
 | 
			
		||||
          this.weekValue1 = null
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    endWeek() {
 | 
			
		||||
      if (this.weekValue1 && this.weekValue2) {
 | 
			
		||||
        let a = new Date(this.weekValue1).getTime()
 | 
			
		||||
        let b = new Date(this.weekValue2).getTime()
 | 
			
		||||
        if (a > b) {
 | 
			
		||||
          this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
 | 
			
		||||
          this.weekValue2 = null
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
        if (b - a > 167 * 24 * 3600000) {
 | 
			
		||||
          this.$modal.msgError('最大时间范围为24周,请重新选择')
 | 
			
		||||
          this.weekValue2 = null
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    editDataList() {
 | 
			
		||||
      this.disabled = false
 | 
			
		||||
      this.isSave = true
 | 
			
		||||
    },
 | 
			
		||||
    async saveDataList() {
 | 
			
		||||
      let obj = {}
 | 
			
		||||
      this.list.forEach((ele, index) => {
 | 
			
		||||
        if (ele.det === false) {
 | 
			
		||||
          this.list[index].lineId = ''
 | 
			
		||||
          this.list[index].remark = this.remark
 | 
			
		||||
          obj = ele
 | 
			
		||||
          this.list.splice(index,1)
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
      let updateArr = this.list
 | 
			
		||||
      // console.log(JSON.stringify(updateArr[1]))
 | 
			
		||||
      const result = await Promise.all([
 | 
			
		||||
        await updateSumProductionDataList(obj),
 | 
			
		||||
        await updateProductionDataList(updateArr),
 | 
			
		||||
      ]);
 | 
			
		||||
      if (result[0] == true && result[1] == true) {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        this.disabled = true
 | 
			
		||||
        this.isSave = false
 | 
			
		||||
        this.getDataList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$modal.msgError('更新失败');
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      if (this.weekValue1 && this.weekValue2) {
 | 
			
		||||
        this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 00:00:00'
 | 
			
		||||
        // this.queryParams.startTime = this.monthValue[0]
 | 
			
		||||
        this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 23:59:59'
 | 
			
		||||
        this.timeTips = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' - ' + moment(this.weekValue2).day(0).format('YYYY-MM-DD')
 | 
			
		||||
      } else {
 | 
			
		||||
      }
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
      const res = await this.$axios({
 | 
			
		||||
        url: '/base/report-auto-production/page',
 | 
			
		||||
        method: 'get',
 | 
			
		||||
        params: this.dataForm
 | 
			
		||||
      })
 | 
			
		||||
      // console.log(this.queryParams);
 | 
			
		||||
      console.log(res)
 | 
			
		||||
      // let sum = undefined
 | 
			
		||||
      // res.data.list.forEach((ele, index) => {
 | 
			
		||||
      //   if (ele.det === false) {
 | 
			
		||||
      //    sum = res.data.list.splice(index, 1)
 | 
			
		||||
      //   }
 | 
			
		||||
      // })
 | 
			
		||||
      res.data.list.forEach((ele,index) => {
 | 
			
		||||
        if (ele.det === false) {
 | 
			
		||||
          res.data.list[index].lineId = '合计'
 | 
			
		||||
          this.remark = res.data.list[index].remark
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
      this.list = res.data.list
 | 
			
		||||
    },
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										37
									
								
								src/views/report/productionYearReport/InputArea.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								src/views/report/productionYearReport/InputArea.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="tableInner">
 | 
			
		||||
    <el-input v-model="list[itemProp]" @blur="changeInput" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'InputArea',
 | 
			
		||||
  props: {
 | 
			
		||||
    injectData: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => ({})
 | 
			
		||||
    },
 | 
			
		||||
    itemProp: {
 | 
			
		||||
      type: String
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: this.injectData
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    changeInput() {
 | 
			
		||||
      console.log(this.list)
 | 
			
		||||
      this.$emit('emitData', this.list)
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style>
 | 
			
		||||
.tableInner .el-input__inner {
 | 
			
		||||
  border: none;
 | 
			
		||||
  padding: 0;
 | 
			
		||||
  height: 33px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										459
									
								
								src/views/report/productionYearReport/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										459
									
								
								src/views/report/productionYearReport/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,459 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-12 13:45:25
 | 
			
		||||
 * @LastEditTime: 2023-12-13 15:16:03
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <el-form :inline="true" :model="dataForm" class="demo-form-inline">
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-date-picker style='width:170px;' v-model="yearValue1" type="year" :picker-options="pickerOptions"
 | 
			
		||||
          value-format="timestamp" placeholder="选择年" @change="startYear" size="small" :clearable="false">
 | 
			
		||||
        </el-date-picker>-
 | 
			
		||||
        <el-date-picker style='width:170px;' v-model="yearValue2" type="year" :picker-options="pickerOptions"
 | 
			
		||||
          value-format="timestamp" placeholder="选择年" @change="endYear" size="small" :clearable="false">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button type="primary" @click="getDataList()">查询</el-button>
 | 
			
		||||
      <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
 | 
			
		||||
      <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button>
 | 
			
		||||
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <el-table :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }">
 | 
			
		||||
 | 
			
		||||
      <el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
 | 
			
		||||
        <el-table-column prop="lineId" label="生产线">
 | 
			
		||||
          <template slot-scope="scope">
 | 
			
		||||
            <el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
 | 
			
		||||
            <span v-else>{{ scope.row.lineId }} </span>
 | 
			
		||||
          </template>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="投入数㎡">
 | 
			
		||||
          <el-table-column prop="inputNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.inputNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="inputHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.inputHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="inputTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.inputTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="完成良品产量">
 | 
			
		||||
          <el-table-column prop="goodProductNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="原片漏检率">
 | 
			
		||||
          <el-table-column prop="missCheckNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.missCheckNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="missCheckHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.missCheckHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="missCheckTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.missCheckTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="综合良品率">
 | 
			
		||||
          <el-table-column prop="goodProductPassNow" label="本周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductPassNow }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductPassHis" label="上周">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductPassHis }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column prop="goodProductPassTrend" label="增减">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
 | 
			
		||||
              </el-input>
 | 
			
		||||
              <span v-else>{{ scope.row.goodProductPassTrend }} </span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <div style="height: 50px;" class="remark" slot="append">
 | 
			
		||||
        <h3 style="float: left;text-align: center;margin-left: 20px;">备注:</h3>
 | 
			
		||||
        <el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
 | 
			
		||||
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <!-- <base-table :table-props="tableProps" :page="1" :limit="10" :summary-method="getSummaries" show-summary
 | 
			
		||||
      :table-data="list">
 | 
			
		||||
    </base-table> -->
 | 
			
		||||
    <!-- 分页组件 -->
 | 
			
		||||
    <!-- <pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" /> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
  getProductionDataList,
 | 
			
		||||
  updateProductionDataList,
 | 
			
		||||
  updateSumProductionDataList
 | 
			
		||||
} from '@/api/report/production';
 | 
			
		||||
// import Editor from '@/components/Editor';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
// import DialogForm from './dialogForm.vue';
 | 
			
		||||
 | 
			
		||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
    {
 | 
			
		||||
      // width: 128,
 | 
			
		||||
    prop: 'lineId',
 | 
			
		||||
    label: '生产线',
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      // width: 128,
 | 
			
		||||
      prop: '',
 | 
			
		||||
      label: '投入数㎡',
 | 
			
		||||
      align: 'center',
 | 
			
		||||
      children: [
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'inputNow',
 | 
			
		||||
          label: '本周'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'inputHis',
 | 
			
		||||
          label: '上周'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'inputTrend',
 | 
			
		||||
          label: '增减'
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
  {
 | 
			
		||||
    // width: 128,
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '完成良品产量',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductNow',
 | 
			
		||||
        label: '本周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductHis',
 | 
			
		||||
        label: '上周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductTrend',
 | 
			
		||||
        label: '增减'
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    // width: 128,
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '原片漏检率',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'missCheckNow',
 | 
			
		||||
        label: '本周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'missCheckHis',
 | 
			
		||||
        label: '上周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'missCheckTrend',
 | 
			
		||||
        label: '增减'
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    // width: 128,
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '综合良品率',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductPassNow',
 | 
			
		||||
        label: '本周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductPassHis',
 | 
			
		||||
        label: '上周'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'goodProductPassTrend',
 | 
			
		||||
        label: '增减'
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  ];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'statisticalData',
 | 
			
		||||
	// components: {
 | 
			
		||||
	// 	DialogForm,
 | 
			
		||||
	// },
 | 
			
		||||
	// mixins: [basicPageMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: [],
 | 
			
		||||
      remark: '',
 | 
			
		||||
      timeTips:'',
 | 
			
		||||
      yearValue1: null,//最多10年
 | 
			
		||||
      yearValue2: null,
 | 
			
		||||
      // dynamicProps: [],
 | 
			
		||||
      tableProps,
 | 
			
		||||
      dataForm: {
 | 
			
		||||
        // workOrderIdList:undefined,
 | 
			
		||||
        // productionId: undefined,
 | 
			
		||||
        // startTime: undefined,
 | 
			
		||||
        // endTime: undefined,
 | 
			
		||||
        reportTime: [],
 | 
			
		||||
        reportType: 5
 | 
			
		||||
        // productionLineId: null,
 | 
			
		||||
      },
 | 
			
		||||
      // dataForm: {
 | 
			
		||||
      //   reportTime:undefined
 | 
			
		||||
      // },
 | 
			
		||||
      isSave:false,
 | 
			
		||||
      disabled: true,
 | 
			
		||||
      sumArr: [],
 | 
			
		||||
      pickerOptions: {
 | 
			
		||||
        disabledDate(date) {
 | 
			
		||||
          return date.getTime() > Date.now()
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      searchBarFormConfig: [
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'select',
 | 
			
		||||
        //   label: '工单名称',
 | 
			
		||||
        //   placeholder: '请选择工单名称',
 | 
			
		||||
        //   param: 'workOrderIdList',
 | 
			
		||||
        //   selectOptions: [],
 | 
			
		||||
        //   multiple: true,
 | 
			
		||||
        //   labelField: 'name',
 | 
			
		||||
        //   valueField: 'id',
 | 
			
		||||
        //   defaultSelect: []
 | 
			
		||||
        // },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'select',
 | 
			
		||||
				// 	label: '产品',
 | 
			
		||||
        //   placeholder: '请选择产品',
 | 
			
		||||
        //   param: 'productionId',
 | 
			
		||||
				// 	selectOptions: [],
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'input',
 | 
			
		||||
				// 	label: '检测内容',
 | 
			
		||||
				// 	placeholder: '请输入检测内容',
 | 
			
		||||
				// 	param: 'inspectionDetContent',
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange', // datetimerange
 | 
			
		||||
					// format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始日期',
 | 
			
		||||
					endPlaceholder: '结束日期',
 | 
			
		||||
					defaultTime: ['00:00:00', '23:59:59'],
 | 
			
		||||
					param: 'checkTime',
 | 
			
		||||
					// width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
        },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: this.$auth.hasPermi(
 | 
			
		||||
				// 		'base:quality-inspection-record:create'
 | 
			
		||||
				// 	)
 | 
			
		||||
				// 		? 'button'
 | 
			
		||||
				// 		: '',
 | 
			
		||||
				// 	btnName: '新增',
 | 
			
		||||
				// 	name: 'add',
 | 
			
		||||
				// 	plain: true,
 | 
			
		||||
				// 	color: 'success',
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
  },
 | 
			
		||||
	created() {
 | 
			
		||||
		// this.getProductLineList();
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // if (this.$route.params.startTime && this.$route.params.endTime) {
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = [
 | 
			
		||||
    //     this.$route.params.startTime,
 | 
			
		||||
    //     this.$route.params.endTime,
 | 
			
		||||
    //   ];
 | 
			
		||||
    //   this.queryParams.param = {};
 | 
			
		||||
    //   this.$set(
 | 
			
		||||
    //     this.queryParams.param,
 | 
			
		||||
    //     'startTime',
 | 
			
		||||
    //     this.$route.params.startTime
 | 
			
		||||
    //   );
 | 
			
		||||
    //   this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
 | 
			
		||||
    // } else {
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = [];
 | 
			
		||||
    // }
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    startYear() {
 | 
			
		||||
      if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
 | 
			
		||||
        this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
 | 
			
		||||
        this.yearValue1 = null
 | 
			
		||||
        return false
 | 
			
		||||
      }
 | 
			
		||||
      if (this.yearValue1 && this.yearValue2) {
 | 
			
		||||
        if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
 | 
			
		||||
          this.$modal.msgError('最大时间范围为10年,请重新选择')
 | 
			
		||||
          this.yearValue1 = null
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    endYear() {
 | 
			
		||||
      if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
 | 
			
		||||
        this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
 | 
			
		||||
        this.yearValue2 = null
 | 
			
		||||
        return false
 | 
			
		||||
      }
 | 
			
		||||
      if (this.yearValue1 && this.yearValue2) {
 | 
			
		||||
        if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
 | 
			
		||||
          this.$modal.msgError('最大时间范围为10年,请重新选择')
 | 
			
		||||
          this.yearValue2 = null
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    editDataList() {
 | 
			
		||||
      this.disabled = false
 | 
			
		||||
      this.isSave = true
 | 
			
		||||
    },
 | 
			
		||||
    async saveDataList() {
 | 
			
		||||
      let obj = {}
 | 
			
		||||
      this.list.forEach((ele, index) => {
 | 
			
		||||
        if (ele.det === false) {
 | 
			
		||||
          this.list[index].lineId = ''
 | 
			
		||||
          this.list[index].remark = this.remark
 | 
			
		||||
          obj = ele
 | 
			
		||||
          this.list.splice(index,1)
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
      let updateArr = this.list
 | 
			
		||||
      // console.log(JSON.stringify(updateArr[1]))
 | 
			
		||||
      const result = await Promise.all([
 | 
			
		||||
        await updateSumProductionDataList(obj),
 | 
			
		||||
        await updateProductionDataList(updateArr),
 | 
			
		||||
      ]);
 | 
			
		||||
      if (result[0] == true && result[1] == true) {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        this.disabled = true
 | 
			
		||||
        this.isSave = false
 | 
			
		||||
        this.getDataList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$modal.msgError('更新失败');
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    transformYear(timeStamp) {// 本年最后一天
 | 
			
		||||
      let year = moment(timeStamp).format('YYYY')
 | 
			
		||||
      let newData = year + '-12-31 23:59:59'
 | 
			
		||||
      let value = newData
 | 
			
		||||
      return value
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      if (this.yearValue1 && this.yearValue2) {
 | 
			
		||||
        if (this.yearValue2 < this.yearValue1) {
 | 
			
		||||
          this.$modal.msgError('结束时间不能早于开始时间')
 | 
			
		||||
          return false
 | 
			
		||||
        } else {
 | 
			
		||||
          this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
 | 
			
		||||
          this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
 | 
			
		||||
          this.timeTips = this.transformYear(this.yearValue1) + " - "  + this.transformYear(this.yearValue1)
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
      const res = await this.$axios({
 | 
			
		||||
        url: '/base/report-auto-production/page',
 | 
			
		||||
        method: 'get',
 | 
			
		||||
        params: this.dataForm
 | 
			
		||||
      })
 | 
			
		||||
      // console.log(this.queryParams);
 | 
			
		||||
      console.log(res)
 | 
			
		||||
      let sum = undefined
 | 
			
		||||
      // res.data.list.forEach((ele, index) => {
 | 
			
		||||
      //   if (ele.det === false) {
 | 
			
		||||
      //    sum = res.data.list.splice(index, 1)
 | 
			
		||||
      //   }
 | 
			
		||||
      // })
 | 
			
		||||
      res.data.list.forEach((ele,index) => {
 | 
			
		||||
        if (ele.det === false) {
 | 
			
		||||
          res.data.list[index].lineId = '合计'
 | 
			
		||||
          this.remark = res.data.list[index].remark
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
      this.list = res.data.list
 | 
			
		||||
    },
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
		Reference in New Issue
	
	Block a user