Compare commits
	
		
			23 Commits
		
	
	
		
			028c14a174
			...
			projects/m
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ceeb853783 | |||
| 6ed21030f5 | |||
| 73feff0d8b | |||
| d49a698136 | |||
| 6e774dfc5d | |||
| 3eeded056f | |||
| 881eace12f | |||
| dad3b2da95 | |||
| f5cfc5d2bb | |||
| 235b0a6512 | |||
| 13bf1e0fd0 | |||
| 
						 | 
					97acb4faac | ||
| 
						 | 
					04a5359eda | ||
| 7ae7dfad95 | |||
| e202ac542e | |||
| eb8736178a | |||
| 580a66549c | |||
| 30c45e6f74 | |||
| e9c2917c77 | |||
| 0a9bd0c6de | |||
| 84dbd8d5b2 | |||
| 
						 | 
					00f54f3de6 | ||
| 
						 | 
					f26d7abc64 | 
							
								
								
									
										2
									
								
								.env.dev
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								.env.dev
									
									
									
									
									
								
							@@ -18,7 +18,7 @@ VUE_APP_BASE_API = 'http://mes2.kszny.picaiba.com'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# 积木报表指向地址
 | 
			
		||||
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
 | 
			
		||||
VUE_APP_JIMU_API = 'http://mes2.kszny.picaiba.com'
 | 
			
		||||
 | 
			
		||||
# 路由懒加载
 | 
			
		||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
 | 
			
		||||
 
 | 
			
		||||
@@ -78,3 +78,11 @@ export function deleteLogDet(id) {
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getEqMaintainPlanPageData(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/equipment-maintain-plan-det/page',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ export function getWorkOrderList(query) {
 | 
			
		||||
 | 
			
		||||
export function getCoreProduct(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/base/core-product/get?id=' + id,
 | 
			
		||||
    url: '/base/core-product-material/get?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -44,11 +44,7 @@ export function updateRole(data) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 角色状态修改
 | 
			
		||||
export function changeRoleStatus(id, status) {
 | 
			
		||||
  const data = {
 | 
			
		||||
    id,
 | 
			
		||||
    status
 | 
			
		||||
  }
 | 
			
		||||
export function changeRoleStatus(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/system/role/update-status',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,3 @@
 | 
			
		||||
<!--
 | 
			
		||||
    filename: index.vue
 | 
			
		||||
    author: liubin
 | 
			
		||||
    date: 2024-04-02 09:49:36
 | 
			
		||||
    description:
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
  <!-- 按钮切换 -->
 | 
			
		||||
  <div v-if="buttonMode" class="button-nav">
 | 
			
		||||
@@ -12,9 +5,8 @@
 | 
			
		||||
      v-for="m in menus"
 | 
			
		||||
      :key="m"
 | 
			
		||||
      @click="currentMenu = m"
 | 
			
		||||
      :data-text="m"
 | 
			
		||||
      :class="[m === currentMenu ? 'active' : '']"
 | 
			
		||||
    ></button>
 | 
			
		||||
    >{{m}}</button>
 | 
			
		||||
  </div>
 | 
			
		||||
  <!-- 标签切换 -->
 | 
			
		||||
  <div v-else class="custom-tabs" style="height: 100%; width: 100%">
 | 
			
		||||
@@ -75,33 +67,24 @@ export default {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  button {
 | 
			
		||||
    height: 48px;
 | 
			
		||||
    line-height: 48px;
 | 
			
		||||
    cursor: pointer;
 | 
			
		||||
    appearance: none;
 | 
			
		||||
    outline: none;
 | 
			
		||||
    border: none;
 | 
			
		||||
    background: #fff;
 | 
			
		||||
    border-radius: 8px;
 | 
			
		||||
    padding: 15px;
 | 
			
		||||
    color: #888;
 | 
			
		||||
    font-size: 16px;
 | 
			
		||||
    font-weight: 500;
 | 
			
		||||
    color: rgba(22, 22, 22, 0.65);
 | 
			
		||||
    letter-spacing: 2px;
 | 
			
		||||
    flex: 1;
 | 
			
		||||
    box-sizing: padding-box;
 | 
			
		||||
    position: relative;
 | 
			
		||||
 | 
			
		||||
    &::after {
 | 
			
		||||
      content: attr(data-text);
 | 
			
		||||
      position: absolute;
 | 
			
		||||
      top: 5px;
 | 
			
		||||
      left: 50%;
 | 
			
		||||
      font-size: 16px;
 | 
			
		||||
      font-weight: 500;
 | 
			
		||||
      transform: translate(-50%);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    &.active {
 | 
			
		||||
      color: #111;
 | 
			
		||||
      //border-bottom: 2px solid #0b58ff;
 | 
			
		||||
      box-shadow: 0px 2px 1px 1px #0b58ff;
 | 
			
		||||
      color: rgba(22, 22, 22, 1);
 | 
			
		||||
      border-bottom: 4px solid #0b58ff;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -110,6 +110,8 @@ export default {
 | 
			
		||||
		},
 | 
			
		||||
		// 处理搜索栏按钮
 | 
			
		||||
    handleSearchBarBtnClick(btn) {
 | 
			
		||||
      console.log(btn);
 | 
			
		||||
 | 
			
		||||
			// const keys = ['name', 'createTime']; // timeVal // 已被 searchBarKeys 替代
 | 
			
		||||
			switch (btn.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@ const permission = {
 | 
			
		||||
      state.topbarRouters = routes
 | 
			
		||||
    },
 | 
			
		||||
    SET_SIDEBAR_ROUTERS: (state, routes) => {
 | 
			
		||||
      console.log('==SET_SIDEBAR_ROUTERS==:',routes)
 | 
			
		||||
      // console.log('==SET_SIDEBAR_ROUTERS==:',routes)
 | 
			
		||||
      state.sidebarRouters = routes
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
 
 | 
			
		||||
@@ -89,6 +89,7 @@ export const DICT_TYPE = {
 | 
			
		||||
 | 
			
		||||
  // ============== ENERGY - 能源模块 =============
 | 
			
		||||
  ENERGY_UNIT: 'energy_unit',
 | 
			
		||||
  ENERGY_TYPE: 'energy_type',
 | 
			
		||||
  EQU_ALARM_LEVEL: 'equ_alarm_level',
 | 
			
		||||
  MONITOR_INDEX_TYPE: 'monitor_index_type',
 | 
			
		||||
  OBJECT_TYPE: 'object_type',
 | 
			
		||||
 
 | 
			
		||||
@@ -92,7 +92,8 @@ export default {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '能源类型',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          param: 'energyTypeId'
 | 
			
		||||
          param: 'energyTypeId',
 | 
			
		||||
          clearable: false
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
@@ -162,7 +163,6 @@ export default {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList();
 | 
			
		||||
    this.getTypeList()
 | 
			
		||||
    // 获取对象树形结构
 | 
			
		||||
    this.getObjTree()
 | 
			
		||||
@@ -171,7 +171,10 @@ export default {
 | 
			
		||||
    getTypeList() {
 | 
			
		||||
      getEnergyTypeListAll().then((res) => {
 | 
			
		||||
        this.formConfig[0].selectOptions = res.data || []
 | 
			
		||||
        this.formConfig[0].defaultSelect = res.data[0].id
 | 
			
		||||
        this.queryParams.energyTypeId = res.data[0].id
 | 
			
		||||
        this.energyTypeList = res.data || []
 | 
			
		||||
        this.getList();
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
 
 | 
			
		||||
@@ -82,6 +82,7 @@ export default {
 | 
			
		||||
    init(param) {
 | 
			
		||||
      this.form.connectId = param.connectId
 | 
			
		||||
      getEnergyTypeListAll().then((res) => {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        this.energyListType = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
      if (param.id) {
 | 
			
		||||
 
 | 
			
		||||
@@ -37,7 +37,7 @@
 | 
			
		||||
      @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm"
 | 
			
		||||
      :before-close="handleCancel"
 | 
			
		||||
      width='30%'
 | 
			
		||||
      width='50%'
 | 
			
		||||
    >
 | 
			
		||||
      <energy-plc-connect-add ref="energyPlcConnect" :objList="objList" @successSubmit="successSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
@@ -60,7 +60,8 @@ const tableProps = [
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'objCode',
 | 
			
		||||
    label: '对象编码'
 | 
			
		||||
    label: '对象编码',
 | 
			
		||||
    minWidth: 160,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'plcTableName',
 | 
			
		||||
@@ -69,7 +70,8 @@ const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'plcTableCode',
 | 
			
		||||
    label: '关联表编码',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
    minWidth: 160,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'cnName',
 | 
			
		||||
 
 | 
			
		||||
@@ -60,7 +60,8 @@ export default {
 | 
			
		||||
        name: '',
 | 
			
		||||
        code: '',
 | 
			
		||||
        type: '',
 | 
			
		||||
        energyTypeId: ''
 | 
			
		||||
        energyTypeId: '',
 | 
			
		||||
        remark: ''
 | 
			
		||||
      },
 | 
			
		||||
      plcList: [],
 | 
			
		||||
      objList: [],
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
      type="text"
 | 
			
		||||
      class="tableInnerButton"
 | 
			
		||||
      @click="showInnerTable(injectData)"
 | 
			
		||||
      >详情</el-button
 | 
			
		||||
      >价格详情</el-button
 | 
			
		||||
    >
 | 
			
		||||
  </el-popover>
 | 
			
		||||
</template>
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,14 @@
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="能源类型" prop="name">
 | 
			
		||||
          <el-input v-model="form.name"></el-input>
 | 
			
		||||
          <el-select v-model="form.name" placeholder="请选择" style="width: 100%;">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in getDictDatas(DICT_TYPE.ENERGY_TYPE)"
 | 
			
		||||
              :key="item.value"
 | 
			
		||||
              :label="item.label"
 | 
			
		||||
              :value="item.label">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
@@ -213,10 +220,6 @@ export default {
 | 
			
		||||
    // 增加
 | 
			
		||||
    emitButtonClick1() {
 | 
			
		||||
      let n = this.tableData1.length
 | 
			
		||||
      if (n >=3) {
 | 
			
		||||
        this.$modal.msgWarning('最多可添加3档计价')
 | 
			
		||||
        return false
 | 
			
		||||
      }
 | 
			
		||||
      let obj = {}
 | 
			
		||||
      obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime
 | 
			
		||||
      obj.endTime = ''
 | 
			
		||||
@@ -225,10 +228,6 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    emitButtonClick2() {
 | 
			
		||||
      let n = this.tableData2.length
 | 
			
		||||
      if (n >=3) {
 | 
			
		||||
        this.$modal.msgWarning('最多可添加3档计价')
 | 
			
		||||
        return false
 | 
			
		||||
      }
 | 
			
		||||
      let obj = {}
 | 
			
		||||
      obj.startUsed = n === 0 ? 0 : this.tableData2[n-1].endUsed
 | 
			
		||||
      obj.endUsed = 0
 | 
			
		||||
 
 | 
			
		||||
@@ -80,10 +80,14 @@ export default {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '能源类型',
 | 
			
		||||
          selectOptions: this.getDictDatas(this.DICT_TYPE.ENERGY_TYPE),
 | 
			
		||||
          placeholder: '能源类型',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
          labelField: 'label',
 | 
			
		||||
          valueField: 'label',
 | 
			
		||||
          param: 'name',
 | 
			
		||||
          flilterable: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
 
 | 
			
		||||
@@ -13,60 +13,6 @@
 | 
			
		||||
		v-loading="formLoading">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="产线"
 | 
			
		||||
					prop="productionLineId"
 | 
			
		||||
					:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.productionLineId"
 | 
			
		||||
						placeholder="请选择产线"
 | 
			
		||||
						filterable
 | 
			
		||||
						@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="dataForm.sectionId"
 | 
			
		||||
						placeholder="请选择工段"
 | 
			
		||||
						filterable
 | 
			
		||||
						@change="$emit('update', dataForm)">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="opt in workshopSectionList"
 | 
			
		||||
							: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="buttonId"
 | 
			
		||||
					:rules="[
 | 
			
		||||
						{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
						{
 | 
			
		||||
							type: 'number',
 | 
			
		||||
							message: '请输入整数',
 | 
			
		||||
							trigger: 'blur',
 | 
			
		||||
							transform: (val) => Number.isInteger(Number(val)) && Number(val),
 | 
			
		||||
						},
 | 
			
		||||
					]">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.buttonId"
 | 
			
		||||
						@change="$emit('update', dataForm)"
 | 
			
		||||
						placeholder="请输入整数" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="产线"
 | 
			
		||||
					prop="productionLineId"
 | 
			
		||||
@@ -130,13 +76,22 @@
 | 
			
		||||
						placeholder="请输入整数" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="按钮盒模式"
 | 
			
		||||
					prop="model">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.model"
 | 
			
		||||
						@change="$emit('update', dataForm)"
 | 
			
		||||
						placeholder="请输入按钮盒模式" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="按钮值"
 | 
			
		||||
					prop="keyValue"
 | 
			
		||||
					:rules="[
 | 
			
		||||
						{ required: true, message: '不能为空', trigger: 'blur' },
 | 
			
		||||
						{ required: true, message: '按钮值不能为空', trigger: 'blur' },
 | 
			
		||||
						{
 | 
			
		||||
							type: 'number',
 | 
			
		||||
							message: '请输入100以内的整数',
 | 
			
		||||
@@ -154,17 +109,22 @@
 | 
			
		||||
						min="0"
 | 
			
		||||
						max="100"
 | 
			
		||||
						@change="$emit('update', dataForm)"
 | 
			
		||||
						placeholder="请输入按钮盒模式" />
 | 
			
		||||
						placeholder="请输入按钮值" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item label="检测内容" prop="inspectionDetId">
 | 
			
		||||
				<el-form-item 
 | 
			
		||||
					label="检测内容"
 | 
			
		||||
					prop="inspectionDetId"
 | 
			
		||||
					:rules="[
 | 
			
		||||
						{ required: true, message: '检测内容不能为空', trigger: 'blur' },
 | 
			
		||||
					]">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.inspectionDetId"
 | 
			
		||||
						placeholder="请选择检测内容"
 | 
			
		||||
						filterable
 | 
			
		||||
						@change="$emit('update', dataForm)">
 | 
			
		||||
						@change="handleInspectionDetChange">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="opt in inspectionDetList"
 | 
			
		||||
							:key="opt.value"
 | 
			
		||||
@@ -203,14 +163,9 @@ export default {
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getProductionLineList();
 | 
			
		||||
		this.getQualityInspectionDetList();
 | 
			
		||||
		// this.getWorksectionList();
 | 
			
		||||
		// this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
 | 
			
		||||
		// 	this.formLoading = false;
 | 
			
		||||
		// 	this.$emit('update', {
 | 
			
		||||
		// 		...this.dataForm,
 | 
			
		||||
		// 		code,
 | 
			
		||||
		// 	});
 | 
			
		||||
		// });
 | 
			
		||||
		if (this.dataForm.productionLineId) {
 | 
			
		||||
			this.getWorksectionList(this.dataForm.productionLineId);
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	watch: {
 | 
			
		||||
		'dataForm.productionId': {
 | 
			
		||||
@@ -279,11 +234,18 @@ export default {
 | 
			
		||||
			this.dataForm.sectionId = null;
 | 
			
		||||
			this.$emit('update', this.dataForm);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		async getCode(url) {
 | 
			
		||||
			const response = await this.$axios(url);
 | 
			
		||||
			return response.data;
 | 
			
		||||
		},
 | 
			
		||||
		handleInspectionDetChange(id) {
 | 
			
		||||
			this.inspectionDetList.forEach((item) => {
 | 
			
		||||
				if (item.value == id) {
 | 
			
		||||
					this.dataForm.inspectionDetContent = item.label;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
			this.$emit('update', this.dataForm);
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
 | 
			
		||||
			<DialogForm v-if="open" ref="form" v-model="form"/>
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -65,78 +65,6 @@ export default {
 | 
			
		||||
	components: { DialogForm },
 | 
			
		||||
	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,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			],
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
@@ -230,6 +158,7 @@ export default {
 | 
			
		||||
				id: null,
 | 
			
		||||
				buttonId: null,
 | 
			
		||||
				inspectionDetId: null,
 | 
			
		||||
				inspectionDetContent: null,
 | 
			
		||||
				productionLineId: null,
 | 
			
		||||
				sectionId: null,
 | 
			
		||||
				model: null,
 | 
			
		||||
@@ -256,12 +185,13 @@ export default {
 | 
			
		||||
			this.form = {
 | 
			
		||||
				id: null,
 | 
			
		||||
				buttonId: null,
 | 
			
		||||
				inspectionDetId: null,
 | 
			
		||||
				inspectionDetContent: null,
 | 
			
		||||
				productionId: null,
 | 
			
		||||
				productionLineId: null,
 | 
			
		||||
				sectionId: null,
 | 
			
		||||
				model: null,
 | 
			
		||||
				keyValue: null,
 | 
			
		||||
			};
 | 
			
		||||
			},
 | 
			
		||||
			this.resetForm('form');
 | 
			
		||||
		},
 | 
			
		||||
		/** 新增按钮操作 */
 | 
			
		||||
 
 | 
			
		||||
@@ -219,6 +219,7 @@ export default {
 | 
			
		||||
    getTypeList() {
 | 
			
		||||
      getEnergyTypeListAll().then((res) => {
 | 
			
		||||
        this.energyTypeList = res.data || []
 | 
			
		||||
        this.queryParams.energyTypeId = res.data[0].id
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // 范围选择器
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div>
 | 
			
		||||
		<div style="background: #f2f4f9; height: 40px; width: 100%">
 | 
			
		||||
		<div style="background: #f2f4f9; height: 56px; width: 100%">
 | 
			
		||||
			<ButtonNav
 | 
			
		||||
				:menus="['走势分析', '对比分析', '同比分析', '环比分析']"
 | 
			
		||||
				@change="currentMenu">
 | 
			
		||||
 
 | 
			
		||||
@@ -205,6 +205,7 @@ export default {
 | 
			
		||||
		getTypeList() {
 | 
			
		||||
			getEnergyTypeListAll().then((res) => {
 | 
			
		||||
				this.energyTypeList = res.data || [];
 | 
			
		||||
				this.queryParams.energyTypeId = res.data[0].id
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		getObjTree() {
 | 
			
		||||
 
 | 
			
		||||
@@ -119,12 +119,12 @@ export default {
 | 
			
		||||
		return {
 | 
			
		||||
			searchBarKeys: ['groupId', 'equipmentName'],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('equipment:bind-group:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '查看报警',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				// this.$auth.hasPermi('equipment:bind-group:update')
 | 
			
		||||
				// 	? {
 | 
			
		||||
				// 			type: 'detail',
 | 
			
		||||
				// 			btnName: '查看报警',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				this.$auth.hasPermi('equipment:bind-group:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
@@ -372,7 +372,7 @@ export default {
 | 
			
		||||
		handleTableBtnClick({ data, type }) {
 | 
			
		||||
			switch (type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
					this.handleDetail(data, 'edit');
 | 
			
		||||
          this.handleUpdate(data)
 | 
			
		||||
					break;
 | 
			
		||||
				case 'delete':
 | 
			
		||||
					this.handleDelete(data);
 | 
			
		||||
@@ -432,19 +432,19 @@ export default {
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 查看报警
 | 
			
		||||
		handleDetail(row, mode = 'detail') {
 | 
			
		||||
			const { equipmentId, equipmentName, groupCode, groupId, groupName, id } =
 | 
			
		||||
				row;
 | 
			
		||||
			// 打开抽屉
 | 
			
		||||
			this.editMode = mode;
 | 
			
		||||
			this.alarmForm.id = groupId;
 | 
			
		||||
			this.alarmForm.equipmentGroupCode = groupCode;
 | 
			
		||||
			this.alarmForm.equipmentGroupName = groupName;
 | 
			
		||||
			this.editVisible = true;
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs['drawer'].init();
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// handleDetail(row, mode = 'detail') {
 | 
			
		||||
		// 	const { equipmentId, equipmentName, groupCode, groupId, groupName, id } =
 | 
			
		||||
		// 		row;
 | 
			
		||||
		// 	// 打开抽屉
 | 
			
		||||
		// 	this.editMode = mode;
 | 
			
		||||
		// 	this.alarmForm.id = groupId;
 | 
			
		||||
		// 	this.alarmForm.equipmentGroupCode = groupCode;
 | 
			
		||||
		// 	this.alarmForm.equipmentGroupName = groupName;
 | 
			
		||||
		// 	this.editVisible = true;
 | 
			
		||||
		// 	this.$nextTick(() => {
 | 
			
		||||
		// 		this.$refs['drawer'].init();
 | 
			
		||||
		// 	});
 | 
			
		||||
		// },
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
 
 | 
			
		||||
@@ -198,8 +198,8 @@ export default {
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '关联表编码',
 | 
			
		||||
					placeholder: '请选择关联表编码',
 | 
			
		||||
          label: '标识名称',
 | 
			
		||||
					placeholder: '请选择标识名称',
 | 
			
		||||
					param: 'plcId',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					filterable: true,
 | 
			
		||||
 
 | 
			
		||||
@@ -195,7 +195,9 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		/** 批量确认 */
 | 
			
		||||
		async searchBarClicked(btn) {
 | 
			
		||||
    async handleSearchBarBtnClick(btn) {
 | 
			
		||||
      console.log(11111);
 | 
			
		||||
 | 
			
		||||
			switch (btn.btnName) {
 | 
			
		||||
				case 'batchConfirm':
 | 
			
		||||
					if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
 | 
			
		||||
@@ -260,6 +262,15 @@ export default {
 | 
			
		||||
						})
 | 
			
		||||
            .catch(() => { });
 | 
			
		||||
          break;
 | 
			
		||||
        case 'search':
 | 
			
		||||
          this.getList()
 | 
			
		||||
          break;
 | 
			
		||||
        case 'add':
 | 
			
		||||
          this.addOrUpdateVisible = true;
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.addOrUpdate.init();
 | 
			
		||||
          });
 | 
			
		||||
					break;
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleSelectionChange(list) {
 | 
			
		||||
 
 | 
			
		||||
@@ -201,7 +201,7 @@ export default {
 | 
			
		||||
			this.groupOptions =
 | 
			
		||||
				res1.data.map((item) => {
 | 
			
		||||
					item.label =
 | 
			
		||||
						item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict);
 | 
			
		||||
            item.name + (getDictDataLabel('workshop', item.roomNameDict) ? ' - ' + getDictDataLabel('workshop', item.roomNameDict) : '')
 | 
			
		||||
					return item;
 | 
			
		||||
				}) || [];
 | 
			
		||||
			// const res = await getEquipmentAll()
 | 
			
		||||
 
 | 
			
		||||
@@ -29,9 +29,9 @@ export default {
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  // mounted() {
 | 
			
		||||
  //   this.getDataList()
 | 
			
		||||
  // },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,6 @@ import moment from 'moment';
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
import { deleteProgramTypeData } from '@/api/equipment/base/maintain/items'
 | 
			
		||||
import showDetail  from './showDetail.vue'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'PlanConfig',
 | 
			
		||||
@@ -40,7 +39,7 @@ export default {
 | 
			
		||||
		const t = new Date();
 | 
			
		||||
		const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()];
 | 
			
		||||
		return {
 | 
			
		||||
      searchBarKeys: ['equipmentName', 'createTime'],
 | 
			
		||||
      searchBarKeys: ['equipmentTypeId'],
 | 
			
		||||
      equipmentTypeList:[],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				{
 | 
			
		||||
@@ -231,13 +230,14 @@ export default {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
        // 添加的提交
 | 
			
		||||
				this.post(this.form).then((response) => {
 | 
			
		||||
        this.post(this.form).then((res) => {
 | 
			
		||||
          console.log('res', res)
 | 
			
		||||
					this.$modal.msgSuccess('新增成功');
 | 
			
		||||
					this.open = false;
 | 
			
		||||
          this.getList()
 | 
			
		||||
          this.showDetailVisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.showDetail.init(this.form.equipmentTypeId)
 | 
			
		||||
            this.$refs.showDetail.init(res.data)
 | 
			
		||||
          })
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
 
 | 
			
		||||
@@ -100,9 +100,10 @@ export default {
 | 
			
		||||
      // console.log(this.tableData)
 | 
			
		||||
    },
 | 
			
		||||
    getDataList(id) {
 | 
			
		||||
      console.log(id)
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      this.queryParams.equipmentTypeId = id
 | 
			
		||||
      console.log(id);
 | 
			
		||||
      console.log(this.queryParams.equipmentTypeId)
 | 
			
		||||
      this.urlOptions.getDataListURL(this.queryParams).then(response => {
 | 
			
		||||
        this.tableData = response.data.list;
 | 
			
		||||
        this.listQuery.total = response.data.total;
 | 
			
		||||
 
 | 
			
		||||
@@ -37,8 +37,8 @@
 | 
			
		||||
        </el-form>
 | 
			
		||||
        <div class="blue-title">保养内容</div>
 | 
			
		||||
        <base-table v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData">
 | 
			
		||||
          <method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
 | 
			
		||||
            @clickBtn="handleClick" />
 | 
			
		||||
          <!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
 | 
			
		||||
            @clickBtn="handleClick" /> -->
 | 
			
		||||
        </base-table>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-drawer>
 | 
			
		||||
 
 | 
			
		||||
@@ -289,7 +289,7 @@ export default {
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			this.info({ id }).then((response) => {
 | 
			
		||||
				this.form = response.data;
 | 
			
		||||
				this.form.responsible = this.form.responsible ? this.form.responsible.split(',') : undefined
 | 
			
		||||
				// this.form.responsible = this.form.responsible ? this.form.responsible.split(',') : undefined
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改备品备件配置';
 | 
			
		||||
			});
 | 
			
		||||
@@ -300,7 +300,7 @@ export default {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				this.form.responsible = this.form.responsible.join(',')
 | 
			
		||||
				// this.form.responsible = this.form.responsible.join(',')/
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					this.put(this.form).then((response) => {
 | 
			
		||||
 
 | 
			
		||||
@@ -136,8 +136,8 @@ export default {
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '备件名称',
 | 
			
		||||
            prop: 'productMaterialId',
 | 
			
		||||
            url: '/base/core-product-material/listAll', // TODO: 供应商
 | 
			
		||||
						// options: [],
 | 
			
		||||
            // url: '/base/core-product-material/listAll', // TODO: 供应商
 | 
			
		||||
						options: [],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
							clearable: false,
 | 
			
		||||
@@ -404,19 +404,19 @@ export default {
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		async getDict() {
 | 
			
		||||
			const materRes = await getMaterialTree(); //
 | 
			
		||||
			let typeId = materRes.data.find((item) => item.product === 2).id;
 | 
			
		||||
			const listQuery = {
 | 
			
		||||
				typeId: typeId,
 | 
			
		||||
			};
 | 
			
		||||
			const materData = await getMaterialList(listQuery);
 | 
			
		||||
			this.rows[0][0].options = (materData.data || []).map((item) => ({
 | 
			
		||||
				label: item.name,
 | 
			
		||||
				value: item.id,
 | 
			
		||||
        ...item
 | 
			
		||||
			}));
 | 
			
		||||
			// const materRes = await getMaterialTree();
 | 
			
		||||
			// let typeId = materRes.data.find((item) => item.product === 2);
 | 
			
		||||
			// const listQuery = {
 | 
			
		||||
			// 	typeId: typeId,
 | 
			
		||||
			// };
 | 
			
		||||
			const materData = await getMaterialList();
 | 
			
		||||
      this.rows[0][0].options = (materData.data || []).filter(item => item.typeId === 3)
 | 
			
		||||
        .map(item => ({ label: item.name, value: item.id,...item }))
 | 
			
		||||
      console.log(this.rows[0][0].options);
 | 
			
		||||
 | 
			
		||||
		},
 | 
			
		||||
    updateDialogFormZ(val) {
 | 
			
		||||
      // console.log(this.rows[0][0].options)
 | 
			
		||||
			const selectData = this.rows[0][0].options.find(
 | 
			
		||||
				(item) => item.id === val.productMaterialId
 | 
			
		||||
			);
 | 
			
		||||
 
 | 
			
		||||
@@ -62,8 +62,8 @@ function getTodayStart(today) {
 | 
			
		||||
/** 颜色配置 */
 | 
			
		||||
const types = [
 | 
			
		||||
     { name: '运行', color: '#288AFF' },
 | 
			
		||||
    { name: '故障', color: '#FC9C91' },
 | 
			
		||||
    { name: '计划停机', color: '#FFDC94' },
 | 
			
		||||
    { name: '故障', color: '#FC9C91' },
 | 
			
		||||
    { name: '空白', color: '#F2F4F9' },
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
@@ -251,7 +251,7 @@ export default class GanttGraph {
 | 
			
		||||
                    y: 0,
 | 
			
		||||
                },
 | 
			
		||||
                data: arr.map(item => ({
 | 
			
		||||
                    name: ['运行', '故障', '计划停机'][item.status],
 | 
			
		||||
                    name: ['运行', '计划停机', '故障'][item.status],
 | 
			
		||||
                    value: [0, item.startTime, item.startTime + item.duration * 60 * 1000, 0],
 | 
			
		||||
                    itemStyle: {
 | 
			
		||||
                        color: types[item.status].color,
 | 
			
		||||
 
 | 
			
		||||
@@ -6,29 +6,19 @@
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
	<div
 | 
			
		||||
		class="status-timegraph-container"
 | 
			
		||||
		style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
 | 
			
		||||
		<el-row
 | 
			
		||||
			class=""
 | 
			
		||||
			style="
 | 
			
		||||
  <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"
 | 
			
		||||
				:remove-blue="true"
 | 
			
		||||
				@select-changed="handleSearchBarSelectChange"
 | 
			
		||||
				@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
      <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" :remove-blue="true"
 | 
			
		||||
        @select-changed="handleSearchBarSelectChange" @headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
    </el-row>
 | 
			
		||||
 | 
			
		||||
		<el-row
 | 
			
		||||
			class=""
 | 
			
		||||
			style="
 | 
			
		||||
    <el-row class="" style="
 | 
			
		||||
				height: 1px;
 | 
			
		||||
				flex: 1;
 | 
			
		||||
				margin-bottom: 12px;
 | 
			
		||||
@@ -47,48 +37,28 @@
 | 
			
		||||
            <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>
 | 
			
		||||
          <div class="legend">
 | 
			
		||||
            <div class="icon fault"></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>
 | 
			
		||||
      <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>
 | 
			
		||||
 | 
			
		||||
    <!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			dialogTitle="添加设备"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			width="500px"
 | 
			
		||||
			@close="open = false"
 | 
			
		||||
			@cancel="open = false"
 | 
			
		||||
    <base-dialog dialogTitle="添加设备" :dialogVisible="open" width="500px" @close="open = false" @cancel="open = false"
 | 
			
		||||
      @confirm="submitForm">
 | 
			
		||||
			<el-select
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				style="width: 100%"
 | 
			
		||||
				filterable
 | 
			
		||||
				clearable
 | 
			
		||||
				v-model="queryParams.equipmentId"
 | 
			
		||||
      <el-select v-if="open" style="width: 100%" filterable clearable v-model="queryParams.equipmentId"
 | 
			
		||||
        placeholder="请选择一个设备">
 | 
			
		||||
				<el-option
 | 
			
		||||
					v-for="eq in eqList"
 | 
			
		||||
					:key="eq.id"
 | 
			
		||||
					:value="eq.id"
 | 
			
		||||
					:label="eq.name"></el-option>
 | 
			
		||||
        <el-option v-for="eq in eqList" :key="eq.id" :value="eq.id" :label="eq.name"></el-option>
 | 
			
		||||
      </el-select>
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
@@ -103,12 +73,6 @@ export default {
 | 
			
		||||
	components: {},
 | 
			
		||||
	props: {},
 | 
			
		||||
	data() {
 | 
			
		||||
		const today = new Date();
 | 
			
		||||
		const todayStart = new Date(
 | 
			
		||||
			today.getFullYear(),
 | 
			
		||||
			today.getMonth(),
 | 
			
		||||
			today.getDate()
 | 
			
		||||
		);
 | 
			
		||||
		return {
 | 
			
		||||
			chart: null,
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
@@ -138,7 +102,7 @@ export default {
 | 
			
		||||
					placeholder: '选择日期',
 | 
			
		||||
					param: 'recordTime',
 | 
			
		||||
					required: true,
 | 
			
		||||
					defaultSelect: moment(todayStart).format('YYYY-MM-DD HH:mm:ss'),
 | 
			
		||||
					defaultSelect:null,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
@@ -196,9 +160,19 @@ export default {
 | 
			
		||||
    this.initProductline();
 | 
			
		||||
    this.initWorksection();
 | 
			
		||||
    this.initEquipment();
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    const today = new Date();
 | 
			
		||||
    const todayStart = new Date(
 | 
			
		||||
      today.getFullYear(),
 | 
			
		||||
      today.getMonth(),
 | 
			
		||||
      today.getDate()
 | 
			
		||||
    );
 | 
			
		||||
    this.searchBarFormConfig[2].defaultSelect = moment(todayStart).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
    console.log('111111', this.searchBarFormConfig[2].defaultSelect)
 | 
			
		||||
		// this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {},
 | 
			
		||||
	// mounted() {},
 | 
			
		||||
	watch: {
 | 
			
		||||
		graphList: {
 | 
			
		||||
			handler(val) {
 | 
			
		||||
@@ -323,6 +297,7 @@ export default {
 | 
			
		||||
						},
 | 
			
		||||
					}).then(({ code, data }) => {
 | 
			
		||||
            if (code == 0) {
 | 
			
		||||
              this.searchBarFormConfig[2].defaultSelect = null
 | 
			
		||||
							this.searchBarFormConfig[1].selectOptions = data.map((item) => {
 | 
			
		||||
								return {
 | 
			
		||||
									name: item.name,
 | 
			
		||||
 
 | 
			
		||||
@@ -288,7 +288,7 @@ export default {
 | 
			
		||||
			if (
 | 
			
		||||
				moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM')
 | 
			
		||||
			) {
 | 
			
		||||
				num = Number(moment().format('DD'));
 | 
			
		||||
				num = Number(moment().format('DD'))-1;
 | 
			
		||||
			} else {
 | 
			
		||||
				num = 0;
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -177,6 +177,8 @@ export default {
 | 
			
		||||
          res.data.list.forEach(item => {
 | 
			
		||||
            if(item.isProduction){
 | 
			
		||||
              item.str = item.strList?item.strList.join(','):'-'
 | 
			
		||||
            }else{
 | 
			
		||||
							item.str = '-'
 | 
			
		||||
						}
 | 
			
		||||
          });
 | 
			
		||||
					this.list = res.data.list;
 | 
			
		||||
 
 | 
			
		||||
@@ -125,13 +125,15 @@ export default {
 | 
			
		||||
			addButtonShow: '',
 | 
			
		||||
			planArr: [], //排班计划数组
 | 
			
		||||
			rules: {
 | 
			
		||||
				name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
 | 
			
		||||
				startDay: [
 | 
			
		||||
					{ required: true, message: '请选择排班开始时间', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
				endDay: [
 | 
			
		||||
					{ required: true, message: '请选择排班结束时间', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
				planId:[
 | 
			
		||||
					{ required: true, message: '请选择排班计划', trigger: 'change' },
 | 
			
		||||
				]
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
@@ -231,6 +233,10 @@ export default {
 | 
			
		||||
							};
 | 
			
		||||
							list.push(obj);
 | 
			
		||||
						});
 | 
			
		||||
						if (list.length === 0) {
 | 
			
		||||
							this.$modal.msgError('班组上班顺序不能为空');
 | 
			
		||||
							return false;
 | 
			
		||||
						}
 | 
			
		||||
						this.form.list = list;
 | 
			
		||||
						updateGroupRule({ ...this.form }).then((res) => {
 | 
			
		||||
							this.$modal.msgSuccess('操作成功');
 | 
			
		||||
@@ -246,6 +252,10 @@ export default {
 | 
			
		||||
							};
 | 
			
		||||
							list.push(obj);
 | 
			
		||||
						});
 | 
			
		||||
						if (list.length === 0) {
 | 
			
		||||
							this.$modal.msgError('班组上班顺序不能为空');
 | 
			
		||||
							return false;
 | 
			
		||||
						}
 | 
			
		||||
						this.form.list = list;
 | 
			
		||||
						createGroupRule({ ...this.form }).then((res) => {
 | 
			
		||||
							this.$modal.msgSuccess('操作成功');
 | 
			
		||||
@@ -268,13 +278,8 @@ export default {
 | 
			
		||||
	margin-bottom: 5px;
 | 
			
		||||
}
 | 
			
		||||
.min-title::before {
 | 
			
		||||
	content: '';
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	vertical-align: middle;
 | 
			
		||||
	width: 6px;
 | 
			
		||||
	height: 6px;
 | 
			
		||||
	border-radius: 50%;
 | 
			
		||||
	margin: auto 5px;
 | 
			
		||||
	background-color: #0b58ff;
 | 
			
		||||
	content: "*";
 | 
			
		||||
	color: #ff5454;
 | 
			
		||||
	margin-right: 4px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -46,6 +46,7 @@ import {
 | 
			
		||||
	getGroupRule,
 | 
			
		||||
	disableGroupRule
 | 
			
		||||
} from '@/api/base/groupSchedulingRule';
 | 
			
		||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
 | 
			
		||||
import schedulingRuleConfigAdd from './components/schedulingRuleConfigAdd.vue';
 | 
			
		||||
import { formatDate } from '@/utils';
 | 
			
		||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
 | 
			
		||||
@@ -78,10 +79,12 @@ export default {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
			{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '班次',
 | 
			
		||||
					placeholder: '班次',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'id',
 | 
			
		||||
					defaultSelect: '',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
@@ -155,19 +158,35 @@ export default {
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				name: null,
 | 
			
		||||
				id: null,
 | 
			
		||||
			},
 | 
			
		||||
			classNameList:[]
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getClassNameList();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getClassNameList() {
 | 
			
		||||
		  groupClassesListAll().then((res) => {
 | 
			
		||||
				this.formConfig[0].selectOptions = res.data;
 | 
			
		||||
				this.classNameList = res.data;
 | 
			
		||||
		  })
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.queryParams.pageNo = 1;
 | 
			
		||||
					this.queryParams.classesName = val.name || undefined;
 | 
			
		||||
					if (val.id) {
 | 
			
		||||
						this.classNameList.map((item) => {
 | 
			
		||||
							if (val.id === item.id) {
 | 
			
		||||
								this.queryParams.classesName = item.name
 | 
			
		||||
							}
 | 
			
		||||
						})
 | 
			
		||||
					}else{
 | 
			
		||||
						this.queryParams.classesName = ''
 | 
			
		||||
					}
 | 
			
		||||
					this.getList();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
@@ -187,7 +206,7 @@ export default {
 | 
			
		||||
							formatDate(item.startDay) +
 | 
			
		||||
							'至' +
 | 
			
		||||
							(item.endDay ? formatDate(item.endDay) : '永久');
 | 
			
		||||
						item.str = item.strList.join(',');
 | 
			
		||||
						item.str = item.strList.join(',');
 | 
			
		||||
					});
 | 
			
		||||
					this.list = res.data.list;
 | 
			
		||||
					this.total = res.data.total;
 | 
			
		||||
 
 | 
			
		||||
@@ -13,6 +13,8 @@
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
        <base-table
 | 
			
		||||
          :page="1"
 | 
			
		||||
          :limit="5000"
 | 
			
		||||
          :table-props="tableProps"
 | 
			
		||||
          :table-data="tableData"
 | 
			
		||||
          :max-height="tableH"
 | 
			
		||||
@@ -43,7 +45,7 @@ const tableProps = [
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workTime',
 | 
			
		||||
    label: '工作时长'
 | 
			
		||||
    label: '工作时长(h)'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
 
 | 
			
		||||
@@ -62,7 +62,8 @@ export default {
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          param: 'workOrderId',
 | 
			
		||||
          clearable: false,
 | 
			
		||||
          filterable: true
 | 
			
		||||
          filterable: true,
 | 
			
		||||
          required: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
 
 | 
			
		||||
@@ -38,6 +38,7 @@ import { groupTeamSchedulingPage, groupClassesListAll } from '@/api/monitoring/t
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import TeamProductionDetail from './components/teamProductionDetail'
 | 
			
		||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
 | 
			
		||||
import moment from 'moment'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
@@ -53,14 +54,12 @@ const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'startTime',
 | 
			
		||||
    label: '上班时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
    filter: (val) => moment(val).format('HH:mm')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'endTime',
 | 
			
		||||
    label: '下班时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
    filter: (val) => moment(val).format('HH:mm')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'classesName',
 | 
			
		||||
@@ -70,7 +69,8 @@ const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'teamName',
 | 
			
		||||
    label: '班组名称',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
    minWidth: 100
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
 
 | 
			
		||||
@@ -176,7 +176,6 @@ import {
 | 
			
		||||
} from "@/utils/constants";
 | 
			
		||||
import { getSpuSimpleList } from "@/api/mall/product/spu";
 | 
			
		||||
import { parseTime } from "@/utils/ruoyi";
 | 
			
		||||
import {changeRoleStatus} from "@/api/system/role";
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "PromotionCouponTemplate",
 | 
			
		||||
 
 | 
			
		||||
@@ -91,6 +91,12 @@ export default {
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '返回',
 | 
			
		||||
          name: 'return',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
        },
 | 
			
		||||
			],
 | 
			
		||||
			queryParams: {
 | 
			
		||||
@@ -279,6 +285,8 @@ export default {
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
    async handleSearchBarBtnClick({ btnName, timeVal }) {
 | 
			
		||||
      console.log(btnName);
 | 
			
		||||
      if (btnName === 'search') {
 | 
			
		||||
        if (timeVal && timeVal.length > 0) {
 | 
			
		||||
          console.log('nihc ', timeVal)
 | 
			
		||||
          if (new Date(timeVal[1]).getTime() - new Date(timeVal[0]).getTime() <= 30 * 60 * 1000) {
 | 
			
		||||
@@ -290,6 +298,9 @@ export default {
 | 
			
		||||
        } else {
 | 
			
		||||
          this.queryParams.recordTime = [];
 | 
			
		||||
          this.$message.warning('时间段必选!')
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$router.go(-1)
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
		},
 | 
			
		||||
 
 | 
			
		||||
@@ -1,304 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form ref="addWorkOrder" :rules="rules" label-width="130px" :model="form" label-position='top'>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="工单名称" prop="name" v-if='!isBind'>
 | 
			
		||||
          <el-input v-model="form.name"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="工单名称" prop="workOrderId"  v-if='isBind'>
 | 
			
		||||
          <el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable @change="getWorkOrderMsg">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in workOrderList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
              :label="item.name"
 | 
			
		||||
              :value="item.id">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="工单编码" prop="code">
 | 
			
		||||
          <el-input v-model="form.code" disabled></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="产品名称" prop="planProductId">
 | 
			
		||||
          <el-select v-model="form.planProductId" placeholder="请选择" disabled  style="width: 100%;">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in productList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
              :label="item.name+' | '+item.specifications"
 | 
			
		||||
              :value="item.id">
 | 
			
		||||
              <span style="float: left">{{ item.name }}</span>
 | 
			
		||||
              <span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="计划开始时间">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="planStartTime"
 | 
			
		||||
            type="datetime"
 | 
			
		||||
            value-format="yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
            style="width: 100%;"
 | 
			
		||||
            placeholder="选择日期"
 | 
			
		||||
            :disabled="isBind">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="计划完成时间">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="planFinishTime"
 | 
			
		||||
            type="datetime"
 | 
			
		||||
            value-format="yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
            style="width: 100%;"
 | 
			
		||||
            placeholder="选择日期"
 | 
			
		||||
            :disabled="isBind">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="计划投入数量" prop="planAssignQuantity">
 | 
			
		||||
          <el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="计划生产数量" prop="planQuantity">
 | 
			
		||||
          <el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="关联工艺" prop="processFlowId">
 | 
			
		||||
          <el-select v-model="form.processFlowId" placeholder="请选择" disabled style="width: 100%;">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in processFlowList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
              :label="item.name"
 | 
			
		||||
              :value="item.id">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="物料计算方式" prop="materialMethod">
 | 
			
		||||
          <el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" disabled>
 | 
			
		||||
            <el-option label="产品基础BOM" :value="1"></el-option>
 | 
			
		||||
            <el-option label="工艺扩展BOM" :value="2"></el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="优先级" prop="priority">
 | 
			
		||||
          <el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
 | 
			
		||||
              :key="item.value"
 | 
			
		||||
              :label="item.label"
 | 
			
		||||
              :value="item.value">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="工单类型" prop="type">
 | 
			
		||||
          <el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in workOrderTypeList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
              :label="item.name"
 | 
			
		||||
              :value="item.id">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="关联产线" prop="productLineId">
 | 
			
		||||
          <el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in productLineList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
              :label="item.name"
 | 
			
		||||
              :value="item.id">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="负责人" prop="workers">
 | 
			
		||||
          <el-input v-model="form.workers" :disabled="isBind"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
 | 
			
		||||
          <el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
  </el-form>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getProductAll } from '@/api/base/product'
 | 
			
		||||
import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage'
 | 
			
		||||
import { getLineAll } from '@/api/base/productionLine'
 | 
			
		||||
import moment from 'moment'
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'AddWorkOrder',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      form: {
 | 
			
		||||
        workOrderId: '',
 | 
			
		||||
        orderId: '',
 | 
			
		||||
        name: '',
 | 
			
		||||
        code: '',
 | 
			
		||||
        planProductId: '',
 | 
			
		||||
        planStartTime: '',
 | 
			
		||||
        planFinishTime: '',
 | 
			
		||||
        planAssignQuantity: 0,
 | 
			
		||||
        planQuantity: 0,
 | 
			
		||||
        processFlowId: '',
 | 
			
		||||
        materialMethod: 1,
 | 
			
		||||
        priority: '',
 | 
			
		||||
        productLineId: [],
 | 
			
		||||
        type: '',
 | 
			
		||||
        workers: '',
 | 
			
		||||
        planAssignmentQuantity: ''
 | 
			
		||||
      },
 | 
			
		||||
      rules: {
 | 
			
		||||
        name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
 | 
			
		||||
        planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
 | 
			
		||||
        planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
 | 
			
		||||
        planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
 | 
			
		||||
        productLineId: [{ required: true, message: "产线不能为空", trigger: "change" }],
 | 
			
		||||
        planAssignmentQuantity: [{ required: true, message: "计划分配订单量不能为空", trigger: "blur" }]
 | 
			
		||||
      },
 | 
			
		||||
      productList: [],
 | 
			
		||||
      processFlowList: [],
 | 
			
		||||
      productLineList: [],
 | 
			
		||||
      workOrderTypeList: [
 | 
			
		||||
        {id: 1,name:'标准工单'},
 | 
			
		||||
        {id: 2, name:'特殊工单'}
 | 
			
		||||
      ],
 | 
			
		||||
      planStartTime: '',
 | 
			
		||||
      planFinishTime: '',
 | 
			
		||||
      isBind: false,
 | 
			
		||||
      workOrderList: []
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(data, param) {
 | 
			
		||||
      this.form.orderId = data.id
 | 
			
		||||
      this.getList()
 | 
			
		||||
      if (param === 'add') {
 | 
			
		||||
        this.isBind = false
 | 
			
		||||
        getWorkOrderCode().then(res => {
 | 
			
		||||
          this.form.code = res.data || ''
 | 
			
		||||
        })
 | 
			
		||||
        this.form.planProductId = data.planProductId
 | 
			
		||||
        this.form.processFlowId = data.processFlowId
 | 
			
		||||
        this.form.materialMethod = data.materialMethod
 | 
			
		||||
      }else{//绑定
 | 
			
		||||
        this.isBind = true
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      // 产品
 | 
			
		||||
      getProductAll().then(res => {
 | 
			
		||||
        this.productList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
      // 产线
 | 
			
		||||
      getLineAll().then(res => {
 | 
			
		||||
        this.productLineList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
      // 工艺
 | 
			
		||||
      getProcessFlowList().then(res => {
 | 
			
		||||
        this.processFlowList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
      // 工单list
 | 
			
		||||
      workOrderList({
 | 
			
		||||
        status: 1
 | 
			
		||||
      }).then(res => {
 | 
			
		||||
        this.workOrderList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    addWorkOrderSubmit() {
 | 
			
		||||
      this.$refs['addWorkOrder'].validate((valid) => {
 | 
			
		||||
        if (valid) {
 | 
			
		||||
          if (this.isBind) {
 | 
			
		||||
            //绑定工单
 | 
			
		||||
            orderIssue({
 | 
			
		||||
              workOrderId: this.form.workOrderId,
 | 
			
		||||
              orderId: this.form.orderId,
 | 
			
		||||
              planAssignmentQuantity: this.form.planAssignmentQuantity
 | 
			
		||||
             }).then((res) => {
 | 
			
		||||
              if (res.code === 0) {
 | 
			
		||||
                this.$modal.msgSuccess("操作成功")
 | 
			
		||||
                this.$emit('addWorkOrderSubmit')
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          } else {
 | 
			
		||||
            // 新增工单
 | 
			
		||||
            let _this = this
 | 
			
		||||
            _this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : ''
 | 
			
		||||
            _this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : ''
 | 
			
		||||
            orderIssue({ ..._this.form }).then(res => {
 | 
			
		||||
              if (res.code === 0) {
 | 
			
		||||
                _this.$modal.msgSuccess("操作成功")
 | 
			
		||||
                let name = this.form.name
 | 
			
		||||
                _this.$emit('addWorkOrderSubmit')
 | 
			
		||||
                // 询问是否添加预使用主原料
 | 
			
		||||
                _this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
 | 
			
		||||
                    _this.$router.push({
 | 
			
		||||
                      path: '/core/core-work-order?workOrderName='+encodeURI(name)
 | 
			
		||||
                    })
 | 
			
		||||
                  })
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        } else {
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    formClear() {
 | 
			
		||||
      this.$refs.addWorkOrder.resetFields()
 | 
			
		||||
      this.form.materialMethod = 1
 | 
			
		||||
      this.form.planAssignQuantity = 0
 | 
			
		||||
      this.form.planQuantity = 0
 | 
			
		||||
      this.planFinishTime = ''
 | 
			
		||||
      this.planStartTime = ''
 | 
			
		||||
      this.form.planFinishTime = ''
 | 
			
		||||
      this.form.planStartTime = ''
 | 
			
		||||
      this.isBind = false
 | 
			
		||||
    },
 | 
			
		||||
    // 绑定工单,选择工单时获取工单信息
 | 
			
		||||
    getWorkOrderMsg() {
 | 
			
		||||
      if (this.form.workOrderId) {
 | 
			
		||||
        getWorkOrderById({id:this.form.workOrderId}).then(res => {
 | 
			
		||||
          if (res.code === 0) {
 | 
			
		||||
            this.form.code = res.data.code
 | 
			
		||||
            this.form.planProductId = res.data.planProductId
 | 
			
		||||
            this.planStartTime = res.data.planStartTime ? moment.unix(res.data.planStartTime).format('YYYY-MM-DD HH:mm:ss') : null
 | 
			
		||||
            this.planFinishTime = res.data.planFinishTime ? moment.unix(res.data.planFinishTime).format('YYYY-MM-DD HH:mm:ss') : null
 | 
			
		||||
            this.form.planAssignQuantity = res.data.planAssignQuantity
 | 
			
		||||
            this.form.planQuantity = res.data.planQuantity
 | 
			
		||||
            this.form.processFlowId = res.data.processFlowId
 | 
			
		||||
            this.form.materialMethod = res.data.materialMethod
 | 
			
		||||
            this.form.priority = res.data.priority ? res.data.priority + '' : ''
 | 
			
		||||
            this.form.productLineId = res.data.productLineIds
 | 
			
		||||
            this.form.type = res.data.type
 | 
			
		||||
            this.form.workers = res.data.workers
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,293 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form ref="orderAddForm" :rules="rules" label-width="130px" :model="form" label-position='top'>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="订单名称" prop="name">
 | 
			
		||||
          <el-input v-model="form.name"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="订单号" prop="code">
 | 
			
		||||
          <el-input v-model="form.code"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="计划加工数量" prop="planQuantity">
 | 
			
		||||
          <el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="产品名称" prop="planProductId">
 | 
			
		||||
          <el-select v-model="form.planProductId" placeholder="请选择" style="width: 100%;" filterable>
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in productList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
              :label="item.name+' | '+(item.specifications || '')"
 | 
			
		||||
              :value="item.id">
 | 
			
		||||
              <span style="float: left">{{ item.name }}</span>
 | 
			
		||||
              <span style="float: right; color: #8492a6; font-size: 13px">{{ item.specifications }}</span>
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="单价" prop="price">
 | 
			
		||||
          <el-input-number v-model="form.price" :min="0" :max="9999999999999" :precision='2' style="width: 100%;"></el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="客户" prop="customerId">
 | 
			
		||||
          <el-select v-model="form.customerId" placeholder="请选择" style="width: 100%;" clearable filterable>
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in customerList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
              :label="item.name"
 | 
			
		||||
              :value="item.id">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="优先级" prop="priority">
 | 
			
		||||
          <el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" clearable>
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
 | 
			
		||||
              :key="item.value"
 | 
			
		||||
              :label="item.label"
 | 
			
		||||
              :value="item.value">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="包装规格" prop="packSpec">
 | 
			
		||||
          <el-select v-model="form.packSpec" placeholder="请选择" style="width: 100%;" clearable>
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in getDictDatas(DICT_TYPE.PACK_SPEC)"
 | 
			
		||||
              :key="item.value"
 | 
			
		||||
              :label="item.label"
 | 
			
		||||
              :value="item.value">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="负责人" prop="workers">
 | 
			
		||||
          <el-input v-model="form.workers"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="关联工艺" prop="processFlowId">
 | 
			
		||||
          <el-select v-model="form.processFlowId" placeholder="请选择" style="width: 100%;" clearable filterable @change="processFlowIdChange">
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="item in processFlowList"
 | 
			
		||||
              :key="item.id"
 | 
			
		||||
              :label="item.name"
 | 
			
		||||
              :value="item.id">
 | 
			
		||||
            </el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="物料计算方式" prop="materialMethod">
 | 
			
		||||
          <el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" @change='materialMethodChange'>
 | 
			
		||||
            <el-option label="产品基础BOM" :value="1"></el-option>
 | 
			
		||||
            <el-option label="工艺扩展BOM" :value="2"></el-option>
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="订单计划开始时间" prop="planStartTime">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="form.planStartTime"
 | 
			
		||||
            type="datetime"
 | 
			
		||||
            style="width: 100%;"
 | 
			
		||||
            value-format="timestamp"
 | 
			
		||||
            @change="timeChange"
 | 
			
		||||
            placeholder="选择日期">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="订单计划完成时间" prop="planFinishTime">
 | 
			
		||||
          <el-date-picker
 | 
			
		||||
            v-model="form.planFinishTime"
 | 
			
		||||
            type="datetime"
 | 
			
		||||
            style="width: 100%;"
 | 
			
		||||
            value-format="timestamp"
 | 
			
		||||
            @change="timeChange"
 | 
			
		||||
            placeholder="选择日期">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
        <el-form-item label="备注" prop="remark">
 | 
			
		||||
          <el-input v-model="form.remark"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <!-- <el-row>
 | 
			
		||||
      <el-col :span='24'>
 | 
			
		||||
        <el-form-item label="描述信息" prop="description">
 | 
			
		||||
          <el-input v-model="form.description"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row> -->
 | 
			
		||||
  </el-form>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getOrderCode, getOrderById, getProcessFlowList, orderUpdate, orderCreate } from '@/api/base/orderManage'
 | 
			
		||||
import { getProductAll } from '@/api/base/product'
 | 
			
		||||
import { getCustomerList } from '@/api/base/customer'
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'OrderAdd',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      form: {
 | 
			
		||||
        id: '',
 | 
			
		||||
        name: '',
 | 
			
		||||
        code: '',
 | 
			
		||||
        planQuantity: '',
 | 
			
		||||
        planProductId: '',
 | 
			
		||||
        price: '',
 | 
			
		||||
        customerId: '',
 | 
			
		||||
        priority: '',
 | 
			
		||||
        packSpec: '',
 | 
			
		||||
        workers: '',
 | 
			
		||||
        processFlowId: '',
 | 
			
		||||
        materialMethod: 1,
 | 
			
		||||
        remark: '',
 | 
			
		||||
        // description: '',
 | 
			
		||||
        planStartTime: '',
 | 
			
		||||
        planFinishTime: ''
 | 
			
		||||
      },
 | 
			
		||||
      rules: {
 | 
			
		||||
        name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }],
 | 
			
		||||
        code: [{ required: true, message: "订单号不能为空", trigger: "blur" }],
 | 
			
		||||
        planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
 | 
			
		||||
        planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
 | 
			
		||||
      },
 | 
			
		||||
      productList: [],
 | 
			
		||||
      customerList: [],
 | 
			
		||||
      processFlowList: [],
 | 
			
		||||
      isEdit: false //是否是编辑
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(id) {
 | 
			
		||||
      this.getList()
 | 
			
		||||
      if (id) {
 | 
			
		||||
        this.isEdit = true
 | 
			
		||||
        this.form.id = id
 | 
			
		||||
        getOrderById({id: this.form.id}).then(res => {
 | 
			
		||||
          if (res.code === 0) {
 | 
			
		||||
            this.form.name = res.data.name
 | 
			
		||||
            this.form.code = res.data.code
 | 
			
		||||
            this.form.planQuantity = res.data.planQuantity
 | 
			
		||||
            this.form.planProductId = res.data.planProductId
 | 
			
		||||
            this.form.price = res.data.price
 | 
			
		||||
            this.form.customerId = res.data.customerId
 | 
			
		||||
            this.form.priority = res.data.priority ? res.data.priority + '' : ''
 | 
			
		||||
            this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null
 | 
			
		||||
            this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : ''
 | 
			
		||||
            this.form.workers = res.data.workers
 | 
			
		||||
            this.form.processFlowId = res.data.processFlowId
 | 
			
		||||
            this.form.materialMethod = res.data.materialMethod
 | 
			
		||||
            this.form.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null
 | 
			
		||||
            this.form.remark = res.data.remark
 | 
			
		||||
            // this.form.description = res.data.description
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      } else {
 | 
			
		||||
        this.isEdit = false
 | 
			
		||||
        this.form.id = ''
 | 
			
		||||
        // 订单号
 | 
			
		||||
        getOrderCode().then(res => {
 | 
			
		||||
          this.form.code = res.data || ''
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      // 产品
 | 
			
		||||
      getProductAll().then(res => {
 | 
			
		||||
        this.productList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
      // 客户
 | 
			
		||||
      getCustomerList().then(res => {
 | 
			
		||||
        this.customerList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
      // 工艺
 | 
			
		||||
      getProcessFlowList().then(res => {
 | 
			
		||||
        this.processFlowList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    timeChange() {
 | 
			
		||||
      if (this.form.planStartTime && this.form.planFinishTime) {
 | 
			
		||||
        if (this.form.planStartTime > this.form.planFinishTime) {
 | 
			
		||||
          this.$modal.msgError('计划开始时间不能大于结束时间')
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 工艺变更
 | 
			
		||||
    materialMethodChange(val) {
 | 
			
		||||
      if (val === 2 && !this.form.processFlowId) {
 | 
			
		||||
        this.form.materialMethod = 1
 | 
			
		||||
        this.$modal.msgError("请先选择关联工艺");
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 工艺变更
 | 
			
		||||
    processFlowIdChange(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      if (!val) {
 | 
			
		||||
        this.form.materialMethod = 1
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    submitForm() {
 | 
			
		||||
      this.$refs['orderAddForm'].validate((valid) => {
 | 
			
		||||
        if (valid) {
 | 
			
		||||
          if (this.form.planStartTime && this.form.planFinishTime) {
 | 
			
		||||
            if (this.form.planStartTime > this.form.planFinishTime) {
 | 
			
		||||
              this.$modal.msgError('计划开始时间不能大于结束时间')
 | 
			
		||||
              return false
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
          // console.log(this.form)
 | 
			
		||||
          if (this.isEdit) {
 | 
			
		||||
            //编辑
 | 
			
		||||
            orderUpdate({ ...this.form }).then((res) => {
 | 
			
		||||
              if (res.code === 0) {
 | 
			
		||||
                this.$modal.msgSuccess("操作成功");
 | 
			
		||||
                this.$emit('successSubmit')
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          } else {
 | 
			
		||||
            this.form.status = 1
 | 
			
		||||
            this.form.triggerOrigin = 1
 | 
			
		||||
            orderCreate({ ...this.form }).then((res) => {
 | 
			
		||||
              if (res.code === 0) {
 | 
			
		||||
                this.$modal.msgSuccess("操作成功");
 | 
			
		||||
                this.$emit('successSubmit')
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        } else {
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    formClear() {
 | 
			
		||||
      this.$refs.orderAddForm.resetFields()
 | 
			
		||||
      this.form.materialMethod = 1
 | 
			
		||||
      this.form.price = 0.00
 | 
			
		||||
      this.form.planQuantity = 0
 | 
			
		||||
      this.isEdit = false
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,470 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="240"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 新增&编辑 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
      :dialogTitle="addOrEditTitle"
 | 
			
		||||
      :dialogVisible="centervisible"
 | 
			
		||||
      @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm"
 | 
			
		||||
      :before-close="handleCancel"
 | 
			
		||||
      width='60%'
 | 
			
		||||
    >
 | 
			
		||||
      <order-add ref="orderAdd" @successSubmit="successSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
    <!-- 查看详情 -->
 | 
			
		||||
    <!-- 新增工单 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
      :dialogTitle="workIssueTitle"
 | 
			
		||||
      :dialogVisible="addWorkOrdervisible"
 | 
			
		||||
      @cancel="addWorkOrderCancel"
 | 
			
		||||
      @confirm="addWorkOrderConfirm"
 | 
			
		||||
      :before-close="addWorkOrderCancel"
 | 
			
		||||
      width='70%'
 | 
			
		||||
    >
 | 
			
		||||
      <add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { getOrderPage, orderDelete, customerList, orderFinish } from '@/api/base/orderManage'
 | 
			
		||||
import OrderAdd from './components/orderAdd'
 | 
			
		||||
import AddWorkOrder from './components/addWorkOrder'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '添加时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '订单名称',
 | 
			
		||||
    minWidth: 120,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '订单编码',
 | 
			
		||||
    minWidth: 180
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'customerId',
 | 
			
		||||
    label: '客户',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'triggerOrigin',
 | 
			
		||||
    label: '来源',
 | 
			
		||||
    filter: publicFormatter('order_Origin')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'priority',
 | 
			
		||||
    label: '优先级',
 | 
			
		||||
    filter: publicFormatter('order_priority')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'status',
 | 
			
		||||
    label: '订单状态',
 | 
			
		||||
    filter: publicFormatter('order_status')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planQuantity',
 | 
			
		||||
    label: '计划加工量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'actualQuantity',
 | 
			
		||||
    label: '实际加工量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productName',
 | 
			
		||||
    label: '产品',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位',
 | 
			
		||||
    filter: publicFormatter('unit_dict')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'price',
 | 
			
		||||
    label: '单价(元)',
 | 
			
		||||
    align: 'right'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workOrderNum',
 | 
			
		||||
    label: '工单数量'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'OrderManage',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '订单名称',
 | 
			
		||||
          placeholder: '订单名称',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '状态',
 | 
			
		||||
          selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
 | 
			
		||||
          labelField: 'label',
 | 
			
		||||
          valueField: 'value',
 | 
			
		||||
          param: 'status'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          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: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
 | 
			
		||||
          btnName: '新增',
 | 
			
		||||
          name: 'add',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        name: null,
 | 
			
		||||
        status: null,
 | 
			
		||||
        lastIssuedTime: []
 | 
			
		||||
      },
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
      this.$auth.hasPermi('base:order-manage:addWorkOrder')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'add',
 | 
			
		||||
              btnName: '新增',
 | 
			
		||||
              showTip: '新增工单',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '|',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 1
 | 
			
		||||
                  },
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 2
 | 
			
		||||
                  },
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 3
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:order-manage:bindWorkOrder')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'bind',
 | 
			
		||||
              btnName: '绑定',
 | 
			
		||||
              showTip: '绑定工单',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '|',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 1
 | 
			
		||||
                  },
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 2
 | 
			
		||||
                  },
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 3
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:order-manage:bindWorkOrder')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'complete',
 | 
			
		||||
              btnName: '完成',
 | 
			
		||||
              showTip: '完成订单',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '|',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 2
 | 
			
		||||
                  },
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 3
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:order-manage:detail')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'detail',
 | 
			
		||||
              btnName: '详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:order-manage:edit')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'edit',
 | 
			
		||||
              btnName: '编辑',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'triggerOrigin',
 | 
			
		||||
                    value: 1
 | 
			
		||||
                  },
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 1
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:order-manage:delete')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'delete',
 | 
			
		||||
              btnName: '删除',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'triggerOrigin',
 | 
			
		||||
                    value: 1
 | 
			
		||||
                  },
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 1
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      addOrEditTitle: '',
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
 | 
			
		||||
      workIssueTitle: '',
 | 
			
		||||
      addWorkOrdervisible: false,
 | 
			
		||||
      orderDetailVisible: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { OrderAdd, AddWorkOrder },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList() {
 | 
			
		||||
      getOrderPage({...this.queryParams}).then(res => {
 | 
			
		||||
        let arr = res.data.records || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
        if (arr.length > 0) {
 | 
			
		||||
          customerList().then(result => {
 | 
			
		||||
            let tempData = result.data || []
 | 
			
		||||
            if (tempData.length > 0) {
 | 
			
		||||
              arr.map(item => {
 | 
			
		||||
                for (let i of tempData) {
 | 
			
		||||
                  if (item.customerId === i.id) {
 | 
			
		||||
                    item.customerId = i.name
 | 
			
		||||
                  }
 | 
			
		||||
                }
 | 
			
		||||
                item.price = item.price.toFixed(2)
 | 
			
		||||
              })
 | 
			
		||||
              this.list = arr
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        }else {
 | 
			
		||||
          this.list = arr
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.queryParams.name = val.name
 | 
			
		||||
        this.queryParams.status = val.status
 | 
			
		||||
        if (val.timeVal && val.timeVal.length > 0) {
 | 
			
		||||
          this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00'
 | 
			
		||||
          this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59'
 | 
			
		||||
        } else {
 | 
			
		||||
          this.queryParams.lastIssuedTime = []
 | 
			
		||||
        }
 | 
			
		||||
        this.getList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.addOrEditTitle = '新增'
 | 
			
		||||
        this.centervisible = true
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.orderAdd.init()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.orderAdd.init(val.data.id)
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        case 'delete':
 | 
			
		||||
          this.handleDelete(val.data)
 | 
			
		||||
          break
 | 
			
		||||
        case 'detail':
 | 
			
		||||
          this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id})
 | 
			
		||||
          break
 | 
			
		||||
        case 'add':
 | 
			
		||||
          this.workIssueTitle = '新增工单'
 | 
			
		||||
          this.addWorkOrdervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.addWorkOrder.init(val.data, 'add')
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        case 'bind':
 | 
			
		||||
          this.workIssueTitle = '绑定工单'
 | 
			
		||||
          this.addWorkOrdervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.addWorkOrder.init(val.data, 'bind')
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        case 'complete':
 | 
			
		||||
          this.handleComplete(val.data)
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 删除
 | 
			
		||||
    handleDelete(val) {
 | 
			
		||||
      this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
 | 
			
		||||
          return orderDelete({ id: val.id })
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          this.getList();
 | 
			
		||||
          this.$modal.msgSuccess("操作成功");
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    // 完成
 | 
			
		||||
    handleComplete(val) {
 | 
			
		||||
      this.$modal.confirm('是否确认完成订单"' + val.name + '"?').then(function() {
 | 
			
		||||
          return orderFinish({ id: val.id })
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          this.getList();
 | 
			
		||||
          this.$modal.msgSuccess("操作成功");
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    // 新增
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.orderAdd.formClear()
 | 
			
		||||
      this.centervisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.orderAdd.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    // 下发新增
 | 
			
		||||
    addWorkOrderCancel() {
 | 
			
		||||
      this.$refs.addWorkOrder.formClear()
 | 
			
		||||
      this.addWorkOrdervisible = false
 | 
			
		||||
    },
 | 
			
		||||
    addWorkOrderConfirm() {
 | 
			
		||||
      this.$refs.addWorkOrder.addWorkOrderSubmit()
 | 
			
		||||
    },
 | 
			
		||||
    addWorkOrderSubmit() {
 | 
			
		||||
      this.addWorkOrderCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    }
 | 
			
		||||
    // bindWorkOrderCancel() {
 | 
			
		||||
    //   this.$refs.bindWorkOrder.formClear()
 | 
			
		||||
    //   this.bindWorkOrdervisible = false
 | 
			
		||||
    // },
 | 
			
		||||
    // bindWorkOrderConfirm() {
 | 
			
		||||
    //   this.$refs.bindWorkOrder.bindWorkOrderSubmit()
 | 
			
		||||
    // },
 | 
			
		||||
    // bindWorkOrderSubmit() {
 | 
			
		||||
    //   this.bindWorkOrderCancel()
 | 
			
		||||
    //   this.getList()
 | 
			
		||||
    // }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,343 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="orderDetailData">
 | 
			
		||||
    <div class="box1">
 | 
			
		||||
      <div class="boxTitle">
 | 
			
		||||
        <span class="blueTitle"></span>
 | 
			
		||||
        <span>订单编码: {{orderMsg.code}}</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
 | 
			
		||||
      <div style="padding-left: 14px;">
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">订单名</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.name}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">产品信息</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.productName}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">产品规格</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.specifications}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">客户</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.customerName}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">包装规格</div>
 | 
			
		||||
            <div class="lightTip">{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderMsg.packSpec)}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">物料计算方式</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.materialMethod ? (orderMsg.materialMethod === 1 ? '产品基础' : '工艺扩展') : ''}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">创建时间</div>
 | 
			
		||||
            <div class="lightTip">{{ parseTime(orderMsg.createTime) }}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">计划开始时间</div>
 | 
			
		||||
            <div class="lightTip">{{ parseTime(orderMsg.planStartTime) }}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">计划完成时间</div>
 | 
			
		||||
            <div class="lightTip">{{ parseTime(orderMsg.planFinishTime) }}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">计划加工数量</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.planQuantity}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">加工平方数(平方米)</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.planArea}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">预计用时(时)</div>
 | 
			
		||||
            <div class="lightTip">{{ orderMsg.expectTime }}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">状态</div>
 | 
			
		||||
            <div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status)}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">实际开始时间</div>
 | 
			
		||||
            <div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">实际完成时间</div>
 | 
			
		||||
            <div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">实际生产数量</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.actualQuantity	}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">完成比%</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.completeProp}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">废片数量</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.nokQuantity}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">负责人</div>
 | 
			
		||||
            <div class="lightTip">{{orderMsg.workers}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">关联工艺</div>
 | 
			
		||||
            <div class="lightTip">{{processFlowName}}</div>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="box2">
 | 
			
		||||
      <div class="boxTitle">
 | 
			
		||||
        <span class="blueTitle"></span>
 | 
			
		||||
        <span>工单信息</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <!-- 列表 -->
 | 
			
		||||
      <base-table
 | 
			
		||||
        :page="queryParams.pageNo"
 | 
			
		||||
        :limit="queryParams.pageSize"
 | 
			
		||||
        :table-props="tableProps1"
 | 
			
		||||
        :table-data="list1"
 | 
			
		||||
        :max-height="tableH"
 | 
			
		||||
      />
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="box3">
 | 
			
		||||
      <div class="boxTitle">
 | 
			
		||||
        <span class="blueTitle"></span>
 | 
			
		||||
        <span>预计用料信息</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <!-- 列表 -->
 | 
			
		||||
      <base-table
 | 
			
		||||
        :page="queryParams.pageNo"
 | 
			
		||||
        :limit="queryParams.pageSize"
 | 
			
		||||
        :table-props="tableProps2"
 | 
			
		||||
        :table-data="list2"
 | 
			
		||||
        :max-height="tableH"
 | 
			
		||||
      />
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import { getProcessFlowList } from '@/api/base/orderManage'
 | 
			
		||||
const tableProps1 = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'issueTime',
 | 
			
		||||
    label: '下发时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '工单名',
 | 
			
		||||
    minWidth: 100,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '工单编码',
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planAssignmentQuantity',
 | 
			
		||||
    label: '计划加工量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'actualQuantity',
 | 
			
		||||
    label: '实际加工量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'actualArea',
 | 
			
		||||
    label: '加工平方数',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'status',
 | 
			
		||||
    label: '状态',
 | 
			
		||||
    filter: publicFormatter('order_status')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'startProduceTime',
 | 
			
		||||
    label: '开始时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'finishProduceTime',
 | 
			
		||||
    label: '结束时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productLineNames',
 | 
			
		||||
    label: '关联产线',
 | 
			
		||||
    filter: (val) => val ? val.join(',') : '',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workers',
 | 
			
		||||
    label: '负责人'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'remark',
 | 
			
		||||
    label: '备注'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
const tableProps2 = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'materialName',
 | 
			
		||||
    label: '物料名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位',
 | 
			
		||||
    filter: publicFormatter('unit_dict')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '剩余生产预计消耗'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
import { orderDetail, bomUseNum } from '@/api/base/orderManage'
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'OrderDetailData',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      orderId: '',
 | 
			
		||||
      tableProps1,
 | 
			
		||||
      tableProps2,
 | 
			
		||||
      list1: [],
 | 
			
		||||
      list2: [],
 | 
			
		||||
      tableH: this.tableHeight(510) / 2,
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 500
 | 
			
		||||
      },
 | 
			
		||||
      orderMsg: {},
 | 
			
		||||
      processFlowName: ''
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(510) / 2
 | 
			
		||||
    })
 | 
			
		||||
    this.orderId = location.href.split('?')[1].split('=')[1]
 | 
			
		||||
    this.getMsg()
 | 
			
		||||
  },
 | 
			
		||||
  watch: {
 | 
			
		||||
    $route: 'initData'
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    initData(to) {
 | 
			
		||||
      if (to.name === 'OrderDetailData') {
 | 
			
		||||
        this.orderId = location.href.split('?')[1].split('=')[1]
 | 
			
		||||
        this.getMsg()
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getMsg() {
 | 
			
		||||
      orderDetail({
 | 
			
		||||
        id: this.orderId
 | 
			
		||||
      }).then(res => {
 | 
			
		||||
        this.orderMsg = res.data
 | 
			
		||||
        this.list1 = res.data.coreWorkOrderRespVOS
 | 
			
		||||
        bomUseNum({
 | 
			
		||||
          productId: this.orderMsg.planProductId
 | 
			
		||||
        }).then(res2 => {
 | 
			
		||||
          if (res2.data && res2.data.length > 0) {
 | 
			
		||||
            let arr = res2.data
 | 
			
		||||
            arr.map(item => {
 | 
			
		||||
              if (item) {
 | 
			
		||||
                let a = item.num * this.orderMsg.remainingQuantity
 | 
			
		||||
                item.num = !isNaN(parseFloat(a)) && isFinite(a) ? a : ''
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
            this.list2 = arr
 | 
			
		||||
          }else {
 | 
			
		||||
            this.list2 = []
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        // 工艺
 | 
			
		||||
        getProcessFlowList().then(res => {
 | 
			
		||||
          let arr = res.data || []
 | 
			
		||||
          if (arr.length > 0) {
 | 
			
		||||
            arr.map(item => {
 | 
			
		||||
              if (item.id === this.orderMsg.processFlowId) {
 | 
			
		||||
                this.processFlowName = item.name
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // 返回
 | 
			
		||||
    returnOrderManage() {
 | 
			
		||||
			this.$router.go(-1);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss' scoped>
 | 
			
		||||
.orderDetailData {
 | 
			
		||||
  background-color: rgb(242, 244, 249);
 | 
			
		||||
  .box1, .box2, .box3 {
 | 
			
		||||
    background-color: #fff;
 | 
			
		||||
    border-radius: 9px;
 | 
			
		||||
  }
 | 
			
		||||
  .box2 {
 | 
			
		||||
    height: calc((100vh - 360px) / 2);
 | 
			
		||||
    padding: 12px 16px 0;
 | 
			
		||||
    margin: 8px 0;
 | 
			
		||||
  }
 | 
			
		||||
  .box1 {
 | 
			
		||||
    height: 215px;
 | 
			
		||||
    padding: 16px 16px 0 16px;
 | 
			
		||||
    .blodTip {
 | 
			
		||||
      height: 16px;
 | 
			
		||||
      font-size: 14px;
 | 
			
		||||
      font-weight: 600;
 | 
			
		||||
      color: rgba(0,0,0,0.85);
 | 
			
		||||
      margin-bottom: 8px;
 | 
			
		||||
    }
 | 
			
		||||
    .lightTip {
 | 
			
		||||
      height: 16px;
 | 
			
		||||
      font-size: 14px;
 | 
			
		||||
      font-weight: 400;
 | 
			
		||||
      color: rgba(102,102,102,0.75);
 | 
			
		||||
      margin-bottom: 12px;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  .box3 {
 | 
			
		||||
    padding: 16px;
 | 
			
		||||
    height: calc((100vh - 360px) / 2);
 | 
			
		||||
    }
 | 
			
		||||
  .boxTitle {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    font-size: 16px;
 | 
			
		||||
    font-weight: 400;
 | 
			
		||||
    color: #000000;
 | 
			
		||||
    margin:0 10px 20px 0;
 | 
			
		||||
  }
 | 
			
		||||
  .blueTitle {
 | 
			
		||||
    content: '';
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    width: 4px;
 | 
			
		||||
    height: 18px;
 | 
			
		||||
    background-color: #0B58FF;
 | 
			
		||||
    border-radius: 1px;
 | 
			
		||||
    margin-right: 8px;
 | 
			
		||||
    vertical-align: bottom;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -1,168 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <div class="boxTitle">
 | 
			
		||||
      <span class="blueTitle"></span>
 | 
			
		||||
      <span>各订单环形图</span>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="chartBox" id='orderChartBox' v-show='chartList.length'>
 | 
			
		||||
      <div class="chartItem" v-for="(item, index) in chartList" :key='index' :style="{width: 388*beilv+'px',height: 286*beilv+'px',padding:14*beilv+'px',marginRight:9*beilv+'px',marginBottom:9*beilv+'px'}">
 | 
			
		||||
        <div class="topTitle" :style="{fontSize: 14 * beilv + 'px'}">
 | 
			
		||||
          <svg-icon icon-class="order-monitoring" :style="{fontSize: 16*beilv+'px'}"/>
 | 
			
		||||
          <span class="orderName" :style="{paddingRight:8*beilv+'px',marginRight:8*beilv+'px'}">{{item.orderName}}</span>
 | 
			
		||||
          <span>订单计划数量{{item.num}}</span>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div
 | 
			
		||||
          :id="item.id"
 | 
			
		||||
          :style="{width: 166*beilv+'px',height: 166*beilv+'px',margin: 'auto'}"
 | 
			
		||||
        ></div>
 | 
			
		||||
        <div class="legend" :style="{height: 54 * beilv + 'px', marginTop: 10*beilv+'px'}">
 | 
			
		||||
          <div class="legendItem" v-for="(subItem, i) in item.workOrder" :key='i' :style="{paddingRight:9*beilv+'px',marginRight:9*beilv+'px'}">
 | 
			
		||||
            <span class="itemNum" :style="{fontSize: 18 * beilv + 'px'}">{{subItem.value}}</span>
 | 
			
		||||
            <div>
 | 
			
		||||
              <span class="itemName" :style="{fontSize: 14 * beilv + 'px'}">
 | 
			
		||||
                <span class="smallBlock" :style="{backgroundColor:subItem.color,width:8*beilv+'px',height:8*beilv+'px'}"></span>
 | 
			
		||||
                {{subItem.name}}
 | 
			
		||||
              </span>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- 空图 -->
 | 
			
		||||
    <div class="no-data-bg" v-show='!chartList.length'></div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import * as echarts from 'echarts'
 | 
			
		||||
import { debounce } from '@/utils/debounce'
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'MonitoringRingCharts',
 | 
			
		||||
  props: {
 | 
			
		||||
    chartList: {
 | 
			
		||||
      type: Array,
 | 
			
		||||
      default: () => {
 | 
			
		||||
        return []
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      myChart: [],
 | 
			
		||||
      beilv: 1,
 | 
			
		||||
      canvasReset: ''
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.beilv = document.getElementById('orderChartBox').offsetWidth / 1610
 | 
			
		||||
    this.canvasReset = debounce(() => {
 | 
			
		||||
      this.initChart()
 | 
			
		||||
    }, 500)
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.beilv = document.getElementById('orderChartBox').offsetWidth / 1610
 | 
			
		||||
      this.canvasReset()
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // 饼图
 | 
			
		||||
    initChart() {
 | 
			
		||||
      if (this.chartList.length <= 0) {
 | 
			
		||||
        return false
 | 
			
		||||
      }
 | 
			
		||||
      // 销毁实例
 | 
			
		||||
      for (let j = 0;j < this.chartList.length; j++) {
 | 
			
		||||
        if (this.myChart[j]) {
 | 
			
		||||
          this.myChart[j].dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      for (let i = 0; i < this.chartList.length; i++) {
 | 
			
		||||
        var chartDom = document.getElementById(this.chartList[i].id);
 | 
			
		||||
        this.myChart[i] = echarts.init(chartDom);
 | 
			
		||||
        let colorList = []
 | 
			
		||||
        this.chartList[i].workOrder.map(item => {
 | 
			
		||||
          colorList.push(item.color)
 | 
			
		||||
        })
 | 
			
		||||
        let percentage = (this.chartList[i].sunNum/this.chartList[i].num*100).toFixed(0)
 | 
			
		||||
        var option = {
 | 
			
		||||
          color: colorList,
 | 
			
		||||
          series: [
 | 
			
		||||
            {
 | 
			
		||||
              name: 'Access From',
 | 
			
		||||
              type: 'pie',
 | 
			
		||||
              radius: ['75%', '95%'],
 | 
			
		||||
              avoidLabelOverlap: false,
 | 
			
		||||
              itemStyle: {
 | 
			
		||||
                borderRadius: 5,
 | 
			
		||||
                borderColor: '#fff',
 | 
			
		||||
                borderWidth: 2
 | 
			
		||||
              },
 | 
			
		||||
              label: {
 | 
			
		||||
                show: true,
 | 
			
		||||
                position: 'center',
 | 
			
		||||
                color: '#000',
 | 
			
		||||
                formatter: [
 | 
			
		||||
                    '{a|'+percentage+'%}',
 | 
			
		||||
                    '{b|生产'+this.chartList[i].sunNum+'}'
 | 
			
		||||
                ].join('\n\n'),
 | 
			
		||||
                rich: {
 | 
			
		||||
                  a: {
 | 
			
		||||
                      fontSize: this.beilv*24 +'px'
 | 
			
		||||
                  },
 | 
			
		||||
                  b: {
 | 
			
		||||
                      fontSize: this.beilv*12 +'px'
 | 
			
		||||
                  }
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              emphasis: {
 | 
			
		||||
                disabled: true
 | 
			
		||||
              },
 | 
			
		||||
              labelLine: {
 | 
			
		||||
                show: false
 | 
			
		||||
              },
 | 
			
		||||
              data: this.chartList[i].workOrder
 | 
			
		||||
            }
 | 
			
		||||
          ]
 | 
			
		||||
        };
 | 
			
		||||
        option && this.myChart[i].setOption(option)
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss' scoped>
 | 
			
		||||
.chartBox {
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  padding-right: 6px;
 | 
			
		||||
  height: calc(100vh - 310px);
 | 
			
		||||
  display: flex;
 | 
			
		||||
  flex-flow: row wrap;
 | 
			
		||||
  overflow: auto;
 | 
			
		||||
  align-content: flex-start;
 | 
			
		||||
  .chartItem {
 | 
			
		||||
    border-radius: 8px;
 | 
			
		||||
    border: 1px solid #CACACA;
 | 
			
		||||
    .topTitle {
 | 
			
		||||
      margin-bottom: 10px;
 | 
			
		||||
      .orderName {
 | 
			
		||||
        border-right: 1px solid #CACACA;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    .legend {
 | 
			
		||||
      text-align: center;
 | 
			
		||||
      white-space: nowrap;
 | 
			
		||||
      overflow: auto;
 | 
			
		||||
      .legendItem {
 | 
			
		||||
        display: inline-block;
 | 
			
		||||
        border-right: 1px solid #E8E8E8;
 | 
			
		||||
        .itemName {
 | 
			
		||||
          .smallBlock {
 | 
			
		||||
            display: inline-block;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      .legendItem:last-child {
 | 
			
		||||
        border: none;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -1,371 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container orderMonitoring">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <el-tabs v-model="activeName" @tab-click="toggleTab">
 | 
			
		||||
      <el-tab-pane label="数据列表" name="dataList"></el-tab-pane>
 | 
			
		||||
      <el-tab-pane label="环形图" name="barChart"></el-tab-pane>
 | 
			
		||||
    </el-tabs>
 | 
			
		||||
    <!-- 表 -->
 | 
			
		||||
    <div v-if="activeName === 'dataList'">
 | 
			
		||||
      <base-table
 | 
			
		||||
        :page="queryParams.pageNo"
 | 
			
		||||
        :limit="queryParams.pageSize"
 | 
			
		||||
        :table-props="tableProps"
 | 
			
		||||
        :table-data="list"
 | 
			
		||||
        :max-height="tableH"
 | 
			
		||||
      >
 | 
			
		||||
        <method-btn
 | 
			
		||||
          v-if="tableBtn.length"
 | 
			
		||||
          slot="handleBtn"
 | 
			
		||||
          :width="140"
 | 
			
		||||
          label="操作"
 | 
			
		||||
          :method-list="tableBtn"
 | 
			
		||||
          @clickBtn="handleClick"
 | 
			
		||||
        />
 | 
			
		||||
      </base-table>
 | 
			
		||||
      <pagination
 | 
			
		||||
        :page.sync="queryParams.pageNo"
 | 
			
		||||
        :limit.sync="queryParams.pageSize"
 | 
			
		||||
        :total="total"
 | 
			
		||||
        @pagination="getPage"
 | 
			
		||||
      />
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- 图 -->
 | 
			
		||||
    <monitoring-ring-charts ref='monitoringRingCharts' v-else :chart-list='chartList'/>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import { orderMonitor, orderAssignmentList } from '@/api/base/orderManage'
 | 
			
		||||
import MonitoringRingCharts from './../components/monitoringRingCharts'
 | 
			
		||||
import moment from "moment"
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '订单名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'customerName',
 | 
			
		||||
    label: '客户'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productname',
 | 
			
		||||
    label: '产品'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planStartTime',
 | 
			
		||||
    label: '计划开始时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planFinishTime',
 | 
			
		||||
    label: '计划完成时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'status',
 | 
			
		||||
    label: '订单状态',
 | 
			
		||||
    filter: publicFormatter('order_status')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'startProduceTime',
 | 
			
		||||
    label: '实际开始时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'finishProduceTime',
 | 
			
		||||
    label: '实际完成时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'lineNames',
 | 
			
		||||
    label: '加工线',
 | 
			
		||||
    filter: (val) => val ? val.join(',') : '',
 | 
			
		||||
    minWidth: 180
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planQuantity',
 | 
			
		||||
    label: '计划生产量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'actualquantity',
 | 
			
		||||
    label: '实际产出量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'completeRate',
 | 
			
		||||
    label: '订单完成率',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workOrderNum',
 | 
			
		||||
    label: '关联工单数量',
 | 
			
		||||
    width: 110
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'OrderCompletionMonitoring',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '订单名称',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          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'
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      activeName: 'dataList',
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        name: null,
 | 
			
		||||
        startProduceTime: []
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(305),
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
      this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'orderDetail',
 | 
			
		||||
              btnName: '工单',
 | 
			
		||||
              showTip: '工单详情',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'more',
 | 
			
		||||
                    name: 'workOrderNum',
 | 
			
		||||
                    value: 1
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:order-completion-monitoring:qualityDet')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'qualityDetail',
 | 
			
		||||
              btnName: '质量',
 | 
			
		||||
              showTip: '质量详情',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'more',
 | 
			
		||||
                    name: 'workOrderNum',
 | 
			
		||||
                    value: 1
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:order-completion-monitoring:sendOut')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'sendOutDetail',
 | 
			
		||||
              btnName: '发货',
 | 
			
		||||
              showTip: '发货详情',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'more',
 | 
			
		||||
                    name: 'workOrderNum',
 | 
			
		||||
                    value: 1
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      chartList: []
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { MonitoringRingCharts },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(305)
 | 
			
		||||
    })
 | 
			
		||||
    let start = moment().subtract(30, 'days').format('yyyy-MM-DD')
 | 
			
		||||
    let end = moment().format('yyyy-MM-DD')
 | 
			
		||||
    this.formConfig[1].defaultSelect = [start, end]
 | 
			
		||||
    this.queryParams.startProduceTime[0] = start + ' 00:00:00'
 | 
			
		||||
    this.queryParams.startProduceTime[1] = end + ' 23:59:59'
 | 
			
		||||
    this.getPage()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getPage() {
 | 
			
		||||
      // 表数据
 | 
			
		||||
      orderMonitor({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.records || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
        if (this.list.length > 0) {
 | 
			
		||||
          let orderIdList = []
 | 
			
		||||
          this.list.map(item => {
 | 
			
		||||
            orderIdList.push(item.orderid)
 | 
			
		||||
          })
 | 
			
		||||
          // 图的数据
 | 
			
		||||
          orderAssignmentList({orderIdList:orderIdList}).then(res => {
 | 
			
		||||
            let color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A']
 | 
			
		||||
            let tempArr = res.data || {}
 | 
			
		||||
            let tempArr2 = []
 | 
			
		||||
            for (let key in tempArr) {
 | 
			
		||||
              let tempArr3 = []
 | 
			
		||||
              let obj = {}
 | 
			
		||||
              obj.orderName = tempArr[key][0].orderName
 | 
			
		||||
              obj.id = key
 | 
			
		||||
              obj.num = tempArr[key][0].planQuantity
 | 
			
		||||
              let sunNum = 0
 | 
			
		||||
              for (let i = 0; i < tempArr[key].length; i++) {
 | 
			
		||||
                let subObj = {}
 | 
			
		||||
                subObj.value = tempArr[key][i].actualAssignmentQuantity
 | 
			
		||||
                subObj.name = tempArr[key][i].woName
 | 
			
		||||
                if (i < 5) {
 | 
			
		||||
                  subObj.color = color[i]
 | 
			
		||||
                } else {
 | 
			
		||||
                  subObj.color = color[i%5]
 | 
			
		||||
                }
 | 
			
		||||
                sunNum+=tempArr[key][i].actualAssignmentQuantity
 | 
			
		||||
                tempArr3.push(subObj)
 | 
			
		||||
              }
 | 
			
		||||
              tempArr3.push({
 | 
			
		||||
                value: tempArr[key][0].planQuantity - sunNum > 0 ? tempArr[key][0].planQuantity - sunNum : 0,
 | 
			
		||||
                name: '未下发',
 | 
			
		||||
                color: '#F5F5F5'
 | 
			
		||||
              })
 | 
			
		||||
              obj.sunNum = sunNum
 | 
			
		||||
              obj.workOrder = tempArr3
 | 
			
		||||
              tempArr2.push(obj)
 | 
			
		||||
            }
 | 
			
		||||
            this.chartList = tempArr2
 | 
			
		||||
            if (this.activeName === 'barChart' && this.chartList.length > 0) {
 | 
			
		||||
              this.$nextTick(() => {
 | 
			
		||||
                this.$refs.monitoringRingCharts.initChart()
 | 
			
		||||
              })
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        }else{
 | 
			
		||||
          // 显示无数据的图片
 | 
			
		||||
          this.chartList = []
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // 查询
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      this.queryParams.name = val.name
 | 
			
		||||
      if (val.timeVal && val.timeVal.length > 0) {
 | 
			
		||||
        this.queryParams.startProduceTime[0] = val.timeVal[0] + ' 00:00:00'
 | 
			
		||||
        this.queryParams.startProduceTime[1] = val.timeVal[1] + ' 23:59:59'
 | 
			
		||||
      } else {
 | 
			
		||||
        this.queryParams.startProduceTime = []
 | 
			
		||||
      }
 | 
			
		||||
      this.getPage()
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'orderDetail':
 | 
			
		||||
          this.$router.push({
 | 
			
		||||
            path: '/core/core-work-order-detail?woIdString='+val.data.woIdString
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        case 'qualityDetail':
 | 
			
		||||
          this.$router.push({
 | 
			
		||||
            path: '/quality/base/quality-inspection-data/detection-information/statistical-data?woIdString='+val.data.woIdString
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
          this.$router.push({
 | 
			
		||||
            path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name)
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    toggleTab() {
 | 
			
		||||
      if (this.activeName === 'barChart' && this.chartList.length > 0) {
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.monitoringRingCharts.initChart()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss'>
 | 
			
		||||
.orderMonitoring {
 | 
			
		||||
  .el-tabs__nav::after {
 | 
			
		||||
    content: "";
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    left: 0;
 | 
			
		||||
    bottom: 0;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    height: 2px;
 | 
			
		||||
    background-color: #e4e7ed;
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__nav-wrap::after {
 | 
			
		||||
    width: 0;
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item {
 | 
			
		||||
    padding: 0 10px;
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item:hover {
 | 
			
		||||
    color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item.is-active {
 | 
			
		||||
    color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
  }
 | 
			
		||||
  .el-tabs__item {
 | 
			
		||||
    color: rgba(0, 0, 0, 0.45);
 | 
			
		||||
  }
 | 
			
		||||
  .searchBarBox {
 | 
			
		||||
    margin-bottom: 0;
 | 
			
		||||
  }
 | 
			
		||||
  .boxTitle {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    font-size: 16px;
 | 
			
		||||
    font-weight: 400;
 | 
			
		||||
    color: #000000;
 | 
			
		||||
    margin:0 10px 16px 0;
 | 
			
		||||
  }
 | 
			
		||||
  .blueTitle {
 | 
			
		||||
    content: '';
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    width: 4px;
 | 
			
		||||
    height: 18px;
 | 
			
		||||
    background-color: #0B58FF;
 | 
			
		||||
    border-radius: 1px;
 | 
			
		||||
    margin-right: 8px;
 | 
			
		||||
    vertical-align: bottom;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -103,21 +103,6 @@
 | 
			
		||||
						style="width: 100%"></el-input-number>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="6">
 | 
			
		||||
				<el-form-item label="优先级" prop="priority">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="form.priority"
 | 
			
		||||
						placeholder="请选择"
 | 
			
		||||
						style="width: 100%"
 | 
			
		||||
						:disabled="isBind">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
 | 
			
		||||
							:key="item.value"
 | 
			
		||||
							:label="item.label"
 | 
			
		||||
							:value="item.value"></el-option>
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="6">
 | 
			
		||||
				<el-form-item label="工单类型" prop="type">
 | 
			
		||||
					<el-select
 | 
			
		||||
@@ -148,11 +133,6 @@
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="6">
 | 
			
		||||
				<el-form-item label="负责人" prop="workers">
 | 
			
		||||
					<el-input v-model="form.workers" :disabled="isBind"></el-input>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="24">
 | 
			
		||||
@@ -293,10 +273,8 @@ export default {
 | 
			
		||||
				deptId: undefined,
 | 
			
		||||
				planQuantity: 0,
 | 
			
		||||
				materialMethod: 1,
 | 
			
		||||
				priority: '',
 | 
			
		||||
				productLineIds: [{ lineId: null, processId: null, num: null }],
 | 
			
		||||
				type: '',
 | 
			
		||||
				workers: '',
 | 
			
		||||
				planAssignmentQuantity: '',
 | 
			
		||||
			},
 | 
			
		||||
			deptList: [],
 | 
			
		||||
@@ -304,6 +282,9 @@ export default {
 | 
			
		||||
				name: [
 | 
			
		||||
					{ required: true, message: '工单名称不能为空', trigger: 'blur' },
 | 
			
		||||
				],
 | 
			
		||||
				workOrderId:[
 | 
			
		||||
				{ required: true, message: '工单名称不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
				planProductId: [
 | 
			
		||||
					{ required: true, message: '产品名称不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
@@ -476,9 +457,6 @@ export default {
 | 
			
		||||
							? moment(res.data.planFinishTime)
 | 
			
		||||
									.format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
							: null;
 | 
			
		||||
						this.form.priority = res.data.priority
 | 
			
		||||
							? res.data.priority + ''
 | 
			
		||||
							: '';
 | 
			
		||||
						// 根据产线获取工艺
 | 
			
		||||
						if (this.form.materialMethod === 2) {
 | 
			
		||||
							this.form.productLineIds.forEach((item) => {
 | 
			
		||||
 
 | 
			
		||||
@@ -56,16 +56,6 @@
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="单价" prop="price">
 | 
			
		||||
          <el-input-number v-model="form.price" :min="0" :max="9999999999999" :precision='2' style="width: 100%;">
 | 
			
		||||
          </el-input-number>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='6'>
 | 
			
		||||
        <el-form-item label="包装规格" prop="packSpec">
 | 
			
		||||
          <el-select v-model="form.packSpec" placeholder="请选择" style="width: 100%;" clearable>
 | 
			
		||||
@@ -75,7 +65,9 @@
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span='12'>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span='24'>
 | 
			
		||||
        <el-form-item label="备注" prop="remark">
 | 
			
		||||
          <el-input v-model="form.remark"></el-input>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
@@ -99,9 +91,7 @@ export default {
 | 
			
		||||
        planQuantity: '',
 | 
			
		||||
        planProductId: '',
 | 
			
		||||
        specifications:undefined,
 | 
			
		||||
        price: '',
 | 
			
		||||
        customerId: '',
 | 
			
		||||
        priority: '',
 | 
			
		||||
        packSpec: '',
 | 
			
		||||
        workers: '',
 | 
			
		||||
        materialMethod: 1,
 | 
			
		||||
@@ -114,7 +104,8 @@ export default {
 | 
			
		||||
        name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }],
 | 
			
		||||
        code: [{ required: true, message: "订单号不能为空", trigger: "blur" }],
 | 
			
		||||
        planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
 | 
			
		||||
        planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
 | 
			
		||||
        planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
 | 
			
		||||
        deliveTime: [{ required: true, message: "交货日期不能为空", trigger: "change" }]
 | 
			
		||||
      },
 | 
			
		||||
      productList: [],
 | 
			
		||||
      customerList: [],
 | 
			
		||||
@@ -142,9 +133,7 @@ export default {
 | 
			
		||||
            this.form.code = res.data.code
 | 
			
		||||
            this.form.planQuantity = res.data.planQuantity
 | 
			
		||||
            this.form.planProductId = res.data.planProductId
 | 
			
		||||
            this.form.price = res.data.price
 | 
			
		||||
            this.form.customerId = res.data.customerId
 | 
			
		||||
            this.form.priority = res.data.priority ? res.data.priority + '' : ''
 | 
			
		||||
            this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null
 | 
			
		||||
            this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : ''
 | 
			
		||||
            this.form.workers = res.data.workers
 | 
			
		||||
@@ -235,7 +224,6 @@ export default {
 | 
			
		||||
    formClear() {
 | 
			
		||||
      this.$refs.orderAddForm.resetFields()
 | 
			
		||||
      this.form.materialMethod = 1
 | 
			
		||||
      this.form.price = 0.00
 | 
			
		||||
      this.form.planQuantity = 0
 | 
			
		||||
      this.isEdit = false
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -73,11 +73,6 @@ const tableProps = [
 | 
			
		||||
		label: '产品规格',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	// {
 | 
			
		||||
	//   prop: 'priority',
 | 
			
		||||
	//   label: '优先级',
 | 
			
		||||
	//   filter: publicFormatter('order_priority')
 | 
			
		||||
	// },
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'planQuantity',
 | 
			
		||||
		label: '计划加工量',
 | 
			
		||||
@@ -97,12 +92,6 @@ const tableProps = [
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
		// subcomponent: selectMember,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'price',
 | 
			
		||||
		label: '单价',
 | 
			
		||||
		width: 100,
 | 
			
		||||
		// subcomponent: inputArea,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'packSpec',
 | 
			
		||||
		label: '包装规格',
 | 
			
		||||
@@ -130,10 +119,8 @@ export default {
 | 
			
		||||
				code: '',
 | 
			
		||||
				planQuantity: '',
 | 
			
		||||
				planProductId: '',
 | 
			
		||||
				price: '',
 | 
			
		||||
				customerId: '',
 | 
			
		||||
				attr3: undefined,
 | 
			
		||||
				priority: '',
 | 
			
		||||
				packSpec: '',
 | 
			
		||||
				workers: '',
 | 
			
		||||
				materialMethod: 1,
 | 
			
		||||
@@ -190,9 +177,7 @@ export default {
 | 
			
		||||
			//       this.form.code = res.data.code
 | 
			
		||||
			//       this.form.planQuantity = res.data.planQuantity
 | 
			
		||||
			//       this.form.planProductId = res.data.planProductId
 | 
			
		||||
			//       this.form.price = res.data.price
 | 
			
		||||
			//       this.form.customerId = res.data.customerId
 | 
			
		||||
			//       this.form.priority = res.data.priority ? res.data.priority + '' : ''
 | 
			
		||||
			//       this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null
 | 
			
		||||
			//       this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : ''
 | 
			
		||||
			//       this.form.workers = res.data.workers
 | 
			
		||||
 
 | 
			
		||||
@@ -62,14 +62,14 @@
 | 
			
		||||
				label="产品"
 | 
			
		||||
				show-overflow-tooltip
 | 
			
		||||
				min-width="120" />
 | 
			
		||||
			<el-table-column prop="deliveTime" label="交货时间" width="160">
 | 
			
		||||
			<el-table-column prop="deliveTime" label="交货日期" width="160">
 | 
			
		||||
				<template v-slot="scope">
 | 
			
		||||
					<span>{{ parseTime(scope.row.deliveTime) }}</span>
 | 
			
		||||
				</template>
 | 
			
		||||
			</el-table-column>
 | 
			
		||||
			<el-table-column prop="workOrderNum" label="工单数量" width="140">
 | 
			
		||||
				<template v-slot="scope">
 | 
			
		||||
					<el-button @click="handleRoute(scope.row)" type="text">
 | 
			
		||||
					<el-button @click="handleRoute(scope.row)" type="text" style='padding: 0px;'>
 | 
			
		||||
						{{ scope.row.workOrderNum }}
 | 
			
		||||
					</el-button>
 | 
			
		||||
				</template>
 | 
			
		||||
@@ -78,6 +78,7 @@
 | 
			
		||||
				<template v-slot="scope">
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						style='padding: 0px;'
 | 
			
		||||
						:disabled="!(scope.row.status != 5 && scope.row.workOrderNum === 0)"
 | 
			
		||||
						@click="handleClick({ data: scope.row, type: 'split' })"
 | 
			
		||||
						v-hasPermi="['base:order-manage:split']">
 | 
			
		||||
@@ -86,6 +87,7 @@
 | 
			
		||||
					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						style='padding: 0px;'
 | 
			
		||||
						:disabled="
 | 
			
		||||
							!(
 | 
			
		||||
								scope.row.status === 1 ||
 | 
			
		||||
@@ -95,12 +97,22 @@
 | 
			
		||||
						"
 | 
			
		||||
						@click="handleClick({ data: scope.row, type: 'bind' })"
 | 
			
		||||
						v-hasPermi="['base:order-manage:bindWorkOrder']">
 | 
			
		||||
						绑定工单
 | 
			
		||||
						下发工单
 | 
			
		||||
					</el-button>
 | 
			
		||||
					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						style='padding: 0px;'
 | 
			
		||||
						:disabled="!(scope.row.status === 2 || scope.row.status === 3)"
 | 
			
		||||
						@click="handleClick({ data: scope.row, type: 'stop' })"
 | 
			
		||||
						v-hasPermi="['base:order-manage:stop']">
 | 
			
		||||
						终止
 | 
			
		||||
					</el-button>
 | 
			
		||||
          <!-- addWorkOrder -->
 | 
			
		||||
					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						style='padding: 0px;'
 | 
			
		||||
						:disabled="!(scope.row.status === 2 || scope.row.status === 3)"
 | 
			
		||||
						@click="handleClick({ data: scope.row, type: 'complete' })"
 | 
			
		||||
						v-hasPermi="['base:order-manage:bindWorkOrder']">
 | 
			
		||||
@@ -109,6 +121,7 @@
 | 
			
		||||
					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						style='padding: 0px;'
 | 
			
		||||
						@click="handleClick({ data: scope.row, type: 'detail' })"
 | 
			
		||||
						v-hasPermi="['base:order-manage:detail']">
 | 
			
		||||
						<span class="iconfont icon-detail primary-color" />
 | 
			
		||||
@@ -116,6 +129,7 @@
 | 
			
		||||
					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						style='padding: 0px;'
 | 
			
		||||
						:disabled="
 | 
			
		||||
							!(scope.row.status === 1)
 | 
			
		||||
						"
 | 
			
		||||
@@ -132,18 +146,12 @@
 | 
			
		||||
					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						style='padding: 0px;'
 | 
			
		||||
						:disabled="scope.row.status != 1"
 | 
			
		||||
						@click="handleClick({ data: scope.row, type: 'void' })"
 | 
			
		||||
						v-hasPermi="['base:order-manage:delete']">
 | 
			
		||||
						作废
 | 
			
		||||
					</el-button>
 | 
			
		||||
					<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						@click="handleClick({ data: scope.row, type: 'stop' })"
 | 
			
		||||
						v-hasPermi="['base:order-manage:stop']">
 | 
			
		||||
						终止
 | 
			
		||||
					</el-button>
 | 
			
		||||
				</template>
 | 
			
		||||
			</el-table-column>
 | 
			
		||||
		</el-table>
 | 
			
		||||
@@ -546,3 +554,9 @@ export default {
 | 
			
		||||
	background-color: unset !important;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
<style>
 | 
			
		||||
.orderTable .el-table__cell {
 | 
			
		||||
	padding: 0 !important;
 | 
			
		||||
	height: 35px !important;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -116,10 +116,6 @@
 | 
			
		||||
						<div class="blodTip">备注</div>
 | 
			
		||||
						<div class="lightTip">{{ orderMsg.remark }}</div>
 | 
			
		||||
					</el-col>
 | 
			
		||||
					<!-- <el-col :span="3">
 | 
			
		||||
						<div class="blodTip">负责人</div>
 | 
			
		||||
						<div class="lightTip">{{ orderMsg.workers }}</div>
 | 
			
		||||
					</el-col> -->
 | 
			
		||||
					<!-- <el-col :span='3'>
 | 
			
		||||
            <div class="blodTip">关联工艺</div>
 | 
			
		||||
            <div class="lightTip">{{processFlowName}}</div>
 | 
			
		||||
@@ -249,10 +245,6 @@ const tableProps1 = [
 | 
			
		||||
		filter: (val) => (val ? val.join(',') : ''),
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'workers',
 | 
			
		||||
		label: '负责人',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注',
 | 
			
		||||
 
 | 
			
		||||
@@ -133,13 +133,6 @@
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="8">
 | 
			
		||||
				<el-form-item label="负责人" prop="workers">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.workers"
 | 
			
		||||
						placeholder="请输入负责人"></el-input>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
@@ -288,7 +281,6 @@ export default {
 | 
			
		||||
				priority: '',
 | 
			
		||||
				productLineIds: [{ lineId: null, processId: null, num: null }],
 | 
			
		||||
				type: '',
 | 
			
		||||
				workers: '',
 | 
			
		||||
				status: 1,
 | 
			
		||||
			},
 | 
			
		||||
			rules: {
 | 
			
		||||
 
 | 
			
		||||
@@ -9,11 +9,12 @@
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:max-height="tableH"
 | 
			
		||||
			:table-data="tableData">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="350"
 | 
			
		||||
				:width="300"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
@@ -61,10 +62,11 @@ import {
 | 
			
		||||
	getCoreWOList
 | 
			
		||||
} from '@/api/base/coreWorkOrder';
 | 
			
		||||
import { listDept } from '@/api/system/dept';
 | 
			
		||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	mixins: [basicPage],
 | 
			
		||||
	mixins: [basicPage,tableHeightMixin],
 | 
			
		||||
	components: {
 | 
			
		||||
		AddWorkOrder,
 | 
			
		||||
		AddOrUpdate,
 | 
			
		||||
@@ -88,25 +90,25 @@ export default {
 | 
			
		||||
				// 			btnName: '原料信息',
 | 
			
		||||
				// 	  }
 | 
			
		||||
				// 	: undefined,
 | 
			
		||||
				// 	{
 | 
			
		||||
				// 		type: 'active',
 | 
			
		||||
				// 		btnName: '激活',
 | 
			
		||||
				// 		showParam: {
 | 
			
		||||
				// 			type: '|',
 | 
			
		||||
				// 			data: [
 | 
			
		||||
				// 				{
 | 
			
		||||
				// 					name: 'status',
 | 
			
		||||
				// 					type: 'equal',
 | 
			
		||||
				// 					value: 1
 | 
			
		||||
				// 				},
 | 
			
		||||
				// 				{
 | 
			
		||||
				// 					name: 'status',
 | 
			
		||||
				// 					type: 'equal',
 | 
			
		||||
				// 					value: 3
 | 
			
		||||
				// 				}
 | 
			
		||||
				// 			]
 | 
			
		||||
				// 		}
 | 
			
		||||
				// 	},
 | 
			
		||||
					{
 | 
			
		||||
						type: 'active',
 | 
			
		||||
						btnName: '开始',
 | 
			
		||||
						showParam: {
 | 
			
		||||
							type: '|',
 | 
			
		||||
							data: [
 | 
			
		||||
								{
 | 
			
		||||
									name: 'status',
 | 
			
		||||
									type: 'equal',
 | 
			
		||||
									value: 1
 | 
			
		||||
								},
 | 
			
		||||
								{
 | 
			
		||||
									name: 'status',
 | 
			
		||||
									type: 'equal',
 | 
			
		||||
									value: 3
 | 
			
		||||
								}
 | 
			
		||||
							]
 | 
			
		||||
						}
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						type: 'pause',
 | 
			
		||||
						btnName: '暂停',
 | 
			
		||||
@@ -122,15 +124,20 @@ export default {
 | 
			
		||||
						}
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						type: 'nullify',
 | 
			
		||||
						btnName: '作废',
 | 
			
		||||
						type: 'terminate',
 | 
			
		||||
						btnName: '终止',
 | 
			
		||||
						showParam: {
 | 
			
		||||
							type: '|',
 | 
			
		||||
							data: [
 | 
			
		||||
								{
 | 
			
		||||
									name: 'status',
 | 
			
		||||
									type: 'equal',
 | 
			
		||||
									value: 1
 | 
			
		||||
									value: 2
 | 
			
		||||
								},
 | 
			
		||||
								{
 | 
			
		||||
									name: 'status',
 | 
			
		||||
									type: 'equal',
 | 
			
		||||
									value: 3
 | 
			
		||||
								}
 | 
			
		||||
							]
 | 
			
		||||
						}
 | 
			
		||||
@@ -176,10 +183,9 @@ export default {
 | 
			
		||||
							}
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
          this.$auth.hasPermi(`base:core-work-order:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					{
 | 
			
		||||
						type: 'nullify',
 | 
			
		||||
						btnName: '作废',
 | 
			
		||||
						showParam: {
 | 
			
		||||
							type: '|',
 | 
			
		||||
							data: [
 | 
			
		||||
@@ -190,8 +196,23 @@ export default {
 | 
			
		||||
								}
 | 
			
		||||
							]
 | 
			
		||||
						}
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined
 | 
			
		||||
					},
 | 
			
		||||
          // this.$auth.hasPermi(`base:core-work-order:delete`)
 | 
			
		||||
					// ? {
 | 
			
		||||
					// 		type: 'delete',
 | 
			
		||||
					// 		btnName: '删除',
 | 
			
		||||
					// 		showParam: {
 | 
			
		||||
					// 			type: '|',
 | 
			
		||||
					// 			data: [
 | 
			
		||||
					// 				{
 | 
			
		||||
					// 					name: 'status',
 | 
			
		||||
					// 					type: 'equal',
 | 
			
		||||
					// 					value: 1
 | 
			
		||||
					// 				}
 | 
			
		||||
					// 			]
 | 
			
		||||
					// 		}
 | 
			
		||||
					//   }
 | 
			
		||||
					// : undefined
 | 
			
		||||
			].filter((v)=>v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			formConfig: [
 | 
			
		||||
@@ -220,7 +241,8 @@ export default {
 | 
			
		||||
						{ id: 2, name: '激活' },
 | 
			
		||||
						{ id: 3, name: '暂停' },
 | 
			
		||||
						{ id: 4, name: '完成' },
 | 
			
		||||
						{ id: 9, name: '作废' }
 | 
			
		||||
						{ id: 5, name: '作废' },
 | 
			
		||||
						{ id: 6, name: '终止' }
 | 
			
		||||
					],
 | 
			
		||||
          param: 'status',
 | 
			
		||||
          clearable: true
 | 
			
		||||
@@ -269,7 +291,7 @@ export default {
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'name',
 | 
			
		||||
          label: '工单名称',
 | 
			
		||||
          minWidth: 120,
 | 
			
		||||
          minWidth: 150,
 | 
			
		||||
          showOverflowtooltip: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
@@ -300,6 +322,7 @@ export default {
 | 
			
		||||
        {
 | 
			
		||||
          prop: 'triggerOrigin',
 | 
			
		||||
          label: '来源',
 | 
			
		||||
					width: 120,
 | 
			
		||||
          filter: (val) => ['', 'MES-手动', 'MES-订单下发', 'ERP'][val]
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
@@ -413,15 +436,18 @@ export default {
 | 
			
		||||
					param.status = 3
 | 
			
		||||
					opration = '暂停'
 | 
			
		||||
				}
 | 
			
		||||
				if (val.type === 'terminate') {
 | 
			
		||||
					param.status = 6
 | 
			
		||||
					opration = '终止'
 | 
			
		||||
				}
 | 
			
		||||
				if (val.type === 'nullify') {
 | 
			
		||||
					param.status = 5
 | 
			
		||||
					opration = '报废'
 | 
			
		||||
					opration = '作废'
 | 
			
		||||
				}
 | 
			
		||||
				if (val.type === 'finish') {
 | 
			
		||||
					param.status = 4
 | 
			
		||||
					opration = '完成'
 | 
			
		||||
				}
 | 
			
		||||
				console.log('22',val)
 | 
			
		||||
				this.$confirm(`确定${opration}${'"工单' + val.data.name + '"'}?`, "提示", {
 | 
			
		||||
					confirmButtonText: "确定",
 | 
			
		||||
					cancelButtonText: "取消",
 | 
			
		||||
@@ -434,7 +460,9 @@ export default {
 | 
			
		||||
							type: 'success',
 | 
			
		||||
							duration: 1500,
 | 
			
		||||
							onClose: () => {
 | 
			
		||||
								setTimeout(() => {
 | 
			
		||||
									this.getDataList();
 | 
			
		||||
								}, 1000);
 | 
			
		||||
								// 分配产量
 | 
			
		||||
								if (param.status === 4) {
 | 
			
		||||
									this.allocationOrder(param);
 | 
			
		||||
 
 | 
			
		||||
@@ -50,6 +50,11 @@ export default {
 | 
			
		||||
					label: '工单名称',
 | 
			
		||||
					showOverflowtooltip: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'productionName',
 | 
			
		||||
					label: '产品名称',
 | 
			
		||||
					showOverflowtooltip: true,
 | 
			
		||||
				},
 | 
			
		||||
				...this.dynamicProps,
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'sumInput',
 | 
			
		||||
@@ -70,7 +75,7 @@ export default {
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		// this.getList();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
@@ -105,7 +110,7 @@ export default {
 | 
			
		||||
						},
 | 
			
		||||
						{
 | 
			
		||||
							prop: 'scrapRatio',
 | 
			
		||||
							label: '报废比例',
 | 
			
		||||
							label: '报废比例(%)',
 | 
			
		||||
						},
 | 
			
		||||
					];
 | 
			
		||||
					this.downList.push(obj);
 | 
			
		||||
@@ -142,6 +147,7 @@ export default {
 | 
			
		||||
				return {
 | 
			
		||||
					inspectionContent: item.inspectionContent,
 | 
			
		||||
					workOrderName: item.workOrderName,
 | 
			
		||||
					productionName: item.productionName,
 | 
			
		||||
					...keyValuePairs,
 | 
			
		||||
					sumInput: item.sumInput,
 | 
			
		||||
					sumOutput: item.sumOutput,
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,3 @@
 | 
			
		||||
<!--
 | 
			
		||||
    filename: index.vue
 | 
			
		||||
    author: liubin
 | 
			
		||||
    date: 2023-08-30 14:02:49
 | 
			
		||||
    description: 设备加工数量
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
	<div style="flex: 1; display: flex; background: #f2f4f9">
 | 
			
		||||
		<div
 | 
			
		||||
@@ -21,7 +14,7 @@
 | 
			
		||||
				title="点击切换工厂"
 | 
			
		||||
				@mouseenter="factoryListOpen = true"
 | 
			
		||||
				@mouseleave="factoryListOpen = false">
 | 
			
		||||
				{{ currentFactory?.label || '点我选择设备' }}
 | 
			
		||||
				{{ currentFactory?.label || '点我选择工厂' }}
 | 
			
		||||
				<div class="factory-list__wrapper" :class="{ open: factoryListOpen }">
 | 
			
		||||
					<ul
 | 
			
		||||
						class="factory-list"
 | 
			
		||||
@@ -33,7 +26,7 @@
 | 
			
		||||
							:data-value="fc.id"
 | 
			
		||||
							class="factory-list__item"
 | 
			
		||||
							:class="{ 'is-current': fc.id == currentFactory?.id }">
 | 
			
		||||
							<span>
 | 
			
		||||
							<span :data-value="fc.id">
 | 
			
		||||
								{{ fc.label }}
 | 
			
		||||
							</span>
 | 
			
		||||
							<svg-icon
 | 
			
		||||
@@ -56,10 +49,6 @@
 | 
			
		||||
					:empty-text="''"
 | 
			
		||||
					icon-class="custom-icon-class"
 | 
			
		||||
					@node-click="handleSidebarItemClick">
 | 
			
		||||
					<!-- <div class="custom-tree-node" slot-scope="{ node, data }">
 | 
			
		||||
						<span class="icon"></span>
 | 
			
		||||
						<span>{{ node.label }}</span>
 | 
			
		||||
					</div> -->
 | 
			
		||||
				</el-tree>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
@@ -106,20 +95,16 @@
 | 
			
		||||
						<div v-else class="no-data-bg"></div>
 | 
			
		||||
					</el-col>
 | 
			
		||||
				</el-row>
 | 
			
		||||
 | 
			
		||||
				<!-- <transition appear name="vvv" mode="out-in"></transition> -->
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
// import Graph from './graph.vue';
 | 
			
		||||
import { getWorkOrderList, getTreeData } from '@/api/quality/deviceParameters';
 | 
			
		||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'EquipmentProcessAmount',
 | 
			
		||||
	// components: { Graph },
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	props: {},
 | 
			
		||||
	data() {
 | 
			
		||||
@@ -139,92 +124,7 @@ export default {
 | 
			
		||||
				{ name: '5', value: 5 },
 | 
			
		||||
				{ name: '6', value: 6 },
 | 
			
		||||
			],
 | 
			
		||||
			sidebarContent: [
 | 
			
		||||
				// {
 | 
			
		||||
				// 	id: 'fc1',
 | 
			
		||||
				// 	name: '工厂',
 | 
			
		||||
				// 	lines: [
 | 
			
		||||
				// 		{
 | 
			
		||||
				// 			name: '产线1',
 | 
			
		||||
				// 			id: 'pl1',
 | 
			
		||||
				// 			sections: [
 | 
			
		||||
				// 				{
 | 
			
		||||
				// 					name: '工段1',
 | 
			
		||||
				// 					id: 'pl1ws1',
 | 
			
		||||
				// 					equipments: [
 | 
			
		||||
				// 						{
 | 
			
		||||
				// 							name: '设备1',
 | 
			
		||||
				// 							id: 'pl1ws1--eq1',
 | 
			
		||||
				// 						},
 | 
			
		||||
				// 						{
 | 
			
		||||
				// 							name: '设备2',
 | 
			
		||||
				// 							id: 'pl1ws1--eq2',
 | 
			
		||||
				// 						},
 | 
			
		||||
				// 						{
 | 
			
		||||
				// 							name: '设备3',
 | 
			
		||||
				// 							id: 'pl1ws1--eq3',
 | 
			
		||||
				// 						},
 | 
			
		||||
				// 					],
 | 
			
		||||
				// 				},
 | 
			
		||||
				// 				{
 | 
			
		||||
				// 					name: '工段2',
 | 
			
		||||
				// 					id: 'pl1ws2',
 | 
			
		||||
				// 					equipments: [
 | 
			
		||||
				// 						{
 | 
			
		||||
				// 							name: '设备1',
 | 
			
		||||
				// 							id: 'pl2ws1--eq1',
 | 
			
		||||
				// 						},
 | 
			
		||||
				// 						{
 | 
			
		||||
				// 							name: '设备2',
 | 
			
		||||
				// 							id: 'pl2ws1--eq2',
 | 
			
		||||
				// 						},
 | 
			
		||||
				// 						{
 | 
			
		||||
				// 							name: '设备3',
 | 
			
		||||
				// 							id: 'pl2ws1--eq3',
 | 
			
		||||
				// 						},
 | 
			
		||||
				// 					],
 | 
			
		||||
				// 				},
 | 
			
		||||
				// 				{
 | 
			
		||||
				// 					name: '工段3',
 | 
			
		||||
				// 					id: 'pl1ws3',
 | 
			
		||||
				// 					equipments: [
 | 
			
		||||
				// 						{
 | 
			
		||||
				// 							name: '设备1',
 | 
			
		||||
				// 							id: 'pl3ws1--eq1',
 | 
			
		||||
				// 						},
 | 
			
		||||
				// 						{
 | 
			
		||||
				// 							name: '设备2',
 | 
			
		||||
				// 							id: 'pl3ws1--eq2',
 | 
			
		||||
				// 						},
 | 
			
		||||
				// 						{
 | 
			
		||||
				// 							name: '设备3',
 | 
			
		||||
				// 							id: 'pl3ws1--eq3',
 | 
			
		||||
				// 						},
 | 
			
		||||
				// 					],
 | 
			
		||||
				// 				},
 | 
			
		||||
				// 			],
 | 
			
		||||
				// 		},
 | 
			
		||||
				// 		{
 | 
			
		||||
				// 			name: '产线2',
 | 
			
		||||
				// 			id: 'pl2',
 | 
			
		||||
				// 			sections: [
 | 
			
		||||
				// 				{
 | 
			
		||||
				// 					name: '工段1',
 | 
			
		||||
				// 					id: 'pl2ws1',
 | 
			
		||||
				// 				},
 | 
			
		||||
				// 				{
 | 
			
		||||
				// 					name: '工段2',
 | 
			
		||||
				// 					id: 'pl2ws2',
 | 
			
		||||
				// 				},
 | 
			
		||||
				// 				{
 | 
			
		||||
				// 					name: '工段3',
 | 
			
		||||
				// 					id: 'pl2ws3',
 | 
			
		||||
				// 				},
 | 
			
		||||
				// 			],
 | 
			
		||||
				// 		},
 | 
			
		||||
				// 	],
 | 
			
		||||
				// },
 | 
			
		||||
			],
 | 
			
		||||
			sidebarContent: [],
 | 
			
		||||
			tableList: [],
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				id: null,
 | 
			
		||||
@@ -241,6 +141,7 @@ export default {
 | 
			
		||||
					param: 'workOrderId',
 | 
			
		||||
					onchange: true,
 | 
			
		||||
					filterable: true,
 | 
			
		||||
					clearable: false
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
@@ -264,20 +165,6 @@ export default {
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'button',
 | 
			
		||||
				// 	btnName: '表格',
 | 
			
		||||
				// 	name: 'table',
 | 
			
		||||
				// 	plain: true,
 | 
			
		||||
				// 	color: 'success',
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'button',
 | 
			
		||||
				// 	btnName: '图表',
 | 
			
		||||
				// 	name: 'graph',
 | 
			
		||||
				// 	plain: true,
 | 
			
		||||
				// 	color: 'warning',
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:equipment-group:export')
 | 
			
		||||
						? 'button'
 | 
			
		||||
@@ -291,15 +178,12 @@ export default {
 | 
			
		||||
			tableProps: [
 | 
			
		||||
				{ prop: 'lineName', label: '产线' },
 | 
			
		||||
				{ prop: 'sectionName', label: '工段' },
 | 
			
		||||
				// { prop: 'externalCode', label: '设备编码' },
 | 
			
		||||
				{ prop: 'equipmentId', label: '设备编码' },
 | 
			
		||||
				{ prop: 'equipmentName', label: '设备名称' },
 | 
			
		||||
				{ prop: 'totalQuantity', label: '加工数量' },
 | 
			
		||||
			],
 | 
			
		||||
			mode: 'table', // table | graph
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				// pageNo: 1,
 | 
			
		||||
				// pageSize: 999,
 | 
			
		||||
				recordTime: [],
 | 
			
		||||
				equipmentId: null,
 | 
			
		||||
				lineId: null,
 | 
			
		||||
@@ -313,28 +197,10 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	// mounted() {
 | 
			
		||||
	// },
 | 
			
		||||
	computed: {
 | 
			
		||||
		// id() {
 | 
			
		||||
		//   return this.$route.params.equipmentId;
 | 
			
		||||
		// },
 | 
			
		||||
		// code() {
 | 
			
		||||
		//   return this.$route.params.equipmentCode;
 | 
			
		||||
		// },
 | 
			
		||||
		// name() {
 | 
			
		||||
		//   return this.$route.params.equipmentName;
 | 
			
		||||
		// },
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getDict();
 | 
			
		||||
		// if (this.id) this.$set(this.queryParams, 'id', this.id);
 | 
			
		||||
		// if (this.code)
 | 
			
		||||
		//   this.$set(this.searchBarFormConfig[0], 'defaultSelect', this.code);
 | 
			
		||||
		// if (this.name)
 | 
			
		||||
		//   this.$set(this.searchBarFormConfig[1], 'defaultSelect', this.name);
 | 
			
		||||
 | 
			
		||||
		// this.handleResponse();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		handleSearchBarChanged({ param, value }) {
 | 
			
		||||
@@ -349,28 +215,14 @@ export default {
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		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((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				// console.log(response);
 | 
			
		||||
				this.searchBarFormConfig[0].selectOptions = res.data.map((item) => {
 | 
			
		||||
					return {
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					};
 | 
			
		||||
				});
 | 
			
		||||
				// console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buildProps(table) {
 | 
			
		||||
@@ -532,12 +384,9 @@ export default {
 | 
			
		||||
				console.log(res.data);
 | 
			
		||||
				this.sidebarContent = res.data;
 | 
			
		||||
				this.buildTree(res.data);
 | 
			
		||||
				this.currentFactory = null
 | 
			
		||||
				console.log('tree', this.sidebarContent);
 | 
			
		||||
				// console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
			// const { data } = await this.$axios('/base/core-factory/getTreeByWorkOrder');
 | 
			
		||||
			// console.log(data)
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		handleTabClick(tab, event) {
 | 
			
		||||
@@ -549,6 +398,7 @@ export default {
 | 
			
		||||
			const fcId = event.target.dataset.value;
 | 
			
		||||
			this.handleSidebarItemClick({ id: fcId, type: '工厂' });
 | 
			
		||||
			this.currentFactory = this.sidebarContent.find((item) => item.id == fcId);
 | 
			
		||||
			console.log('factory change', this.currentFactory);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		handleSidebarItemClick({ label, id, type }) {
 | 
			
		||||
 
 | 
			
		||||
@@ -172,6 +172,7 @@ export default {
 | 
			
		||||
						query: {
 | 
			
		||||
							id: val.data.processFlowId,
 | 
			
		||||
							orderId: val.data.id,
 | 
			
		||||
							lineId: val.data.lineId,
 | 
			
		||||
							name: val.data.name,
 | 
			
		||||
							specifications: res.data.specifications,
 | 
			
		||||
							productName: val.data.planProductName,
 | 
			
		||||
 
 | 
			
		||||
@@ -8,9 +8,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <section class="process-bom">
 | 
			
		||||
    <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
    <!-- <small-title :no-padding="true">
 | 
			
		||||
      设备名称: {{ name }}
 | 
			
		||||
    </small-title> -->
 | 
			
		||||
    <div class="btns" style="
 | 
			
		||||
				text-align: right;
 | 
			
		||||
				position: absolute;
 | 
			
		||||
@@ -18,14 +15,7 @@
 | 
			
		||||
				right: 20px;
 | 
			
		||||
				display: flex;
 | 
			
		||||
			">
 | 
			
		||||
      <!-- <el-input icon="el-icon-search" placeholder="搜索" v-model="searchText" style="margin-left: 20px">
 | 
			
		||||
        <i slot="prefix" class="el-input__icon el-icon-search"></i>
 | 
			
		||||
      </el-input>
 | 
			
		||||
      <el-button type="primary" plain :disabled="currentDet == null" class="btn-create" icon="el-icon-plus">
 | 
			
		||||
        分配设备
 | 
			
		||||
      </el-button> -->
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <el-row>
 | 
			
		||||
      <div style="margin-bottom: 10px;font-size: 16px;">设备名称:{{ name }}</div>
 | 
			
		||||
@@ -51,7 +41,6 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
// import SmallTitle from './SmallTitle';
 | 
			
		||||
import {
 | 
			
		||||
  getDetMaterial,
 | 
			
		||||
  getDetValue
 | 
			
		||||
@@ -59,9 +48,6 @@ import {
 | 
			
		||||
import StatusBtn from './statusBtn.vue'
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'ProcessBom',
 | 
			
		||||
  components: {
 | 
			
		||||
    // SmallTitle
 | 
			
		||||
  },
 | 
			
		||||
	props: {
 | 
			
		||||
		currentDet: {
 | 
			
		||||
			type: Object,
 | 
			
		||||
@@ -77,7 +63,6 @@ export default {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '时间段',
 | 
			
		||||
          dateType: 'daterange', // datetimerange
 | 
			
		||||
          // format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          format: 'yyyy-MM-dd',
 | 
			
		||||
          valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
@@ -94,13 +79,6 @@ export default {
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
        },],
 | 
			
		||||
			materialTableProps: [
 | 
			
		||||
				// {
 | 
			
		||||
				// 	prop: 'createTime',
 | 
			
		||||
				// 	label: '添加时间',
 | 
			
		||||
				// 	fixed: true,
 | 
			
		||||
				// 	width: 180,
 | 
			
		||||
				// 	filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
				// },
 | 
			
		||||
        { prop: 'name', label: '物料名称' },
 | 
			
		||||
        { prop: 'planNum', label: '预计使用数量' },
 | 
			
		||||
        { prop: 'actualNum', label: '实际使用数量' },
 | 
			
		||||
@@ -181,22 +159,13 @@ export default {
 | 
			
		||||
  methods: {
 | 
			
		||||
    handleSearchBarBtnClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      getDetMaterial({
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        orderId: this.$route.query.orderId,
 | 
			
		||||
        flowDetId: [this.detId],
 | 
			
		||||
        // orderId: this.$route.query.orderId,
 | 
			
		||||
 | 
			
		||||
      },).then((res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
      })
 | 
			
		||||
      // if (timeVal && timeVal.length > 0) {
 | 
			
		||||
      //   this.queryParams.time = timeVal;
 | 
			
		||||
      // } else {
 | 
			
		||||
      //   this.queryParams.time = [];
 | 
			
		||||
      // }
 | 
			
		||||
      // await this.handleQuery();
 | 
			
		||||
      this.queryParams.startTime = val.timeVal.length > 0 ? val.timeVal[0] : ''
 | 
			
		||||
      this.queryParams.endTime = val.timeVal.length > 0 ? val.timeVal[1] : ''
 | 
			
		||||
      if (this.activeName === 'material') {
 | 
			
		||||
        this.getDetMaterialMes()
 | 
			
		||||
      }else {
 | 
			
		||||
        this.getDetValueMes()
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
		handleEmitFun() { },
 | 
			
		||||
		handleTableBtnClick() { },
 | 
			
		||||
@@ -220,35 +189,37 @@ export default {
 | 
			
		||||
				data: method !== 'get' ? payload : null,
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// getList({ detId, detName, detDesc, flowId, sectionName } = {}) {
 | 
			
		||||
		// 	console.log('get list')
 | 
			
		||||
 | 
			
		||||
    // },
 | 
			
		||||
    handleTabClick(val) {
 | 
			
		||||
      // console.log(this.activeName);
 | 
			
		||||
    handleTabClick() {
 | 
			
		||||
      if (this.activeName === 'material') {
 | 
			
		||||
        this.getDetMaterialMes()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.getDetValueMes()
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getList(val) {
 | 
			
		||||
      this.getDetMaterialMes()
 | 
			
		||||
		},
 | 
			
		||||
		clearList() {
 | 
			
		||||
			this.list = [];
 | 
			
		||||
    },
 | 
			
		||||
    getDetMaterialMes() {
 | 
			
		||||
      getDetMaterial({
 | 
			
		||||
          pageNo: 1,
 | 
			
		||||
          pageSize: 10,
 | 
			
		||||
        orderId: this.$route.query.orderId,
 | 
			
		||||
        lineId: this.$route.query.lineId,
 | 
			
		||||
        flowDetId: [this.detId],
 | 
			
		||||
          // orderId: this.$route.query.orderId,
 | 
			
		||||
 | 
			
		||||
        },).then((res) => {
 | 
			
		||||
        ...this.queryParams
 | 
			
		||||
      }).then((res) => {
 | 
			
		||||
        if (res.data.length != []) {
 | 
			
		||||
          this.materialList = res.data[0].data
 | 
			
		||||
          this.name = res.data[0].name
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
      } else {
 | 
			
		||||
    },
 | 
			
		||||
    getDetValueMes() {
 | 
			
		||||
      getDetValue({
 | 
			
		||||
          pageNo: 1,
 | 
			
		||||
          pageSize: 10,
 | 
			
		||||
          orderId: this.$route.query.orderId,
 | 
			
		||||
          flowDetId: [this.detId],
 | 
			
		||||
          // orderId: this.$route.query.orderId,
 | 
			
		||||
 | 
			
		||||
          ...this.queryParams
 | 
			
		||||
        }).then((res) => {
 | 
			
		||||
          if (res.data.length != []) {
 | 
			
		||||
            this.valueList = res.data[0].data
 | 
			
		||||
@@ -257,25 +228,6 @@ export default {
 | 
			
		||||
        })
 | 
			
		||||
    }
 | 
			
		||||
	},
 | 
			
		||||
    getList(val) {
 | 
			
		||||
      console.log(val);
 | 
			
		||||
      getDetMaterial({
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        orderId: this.$route.query.orderId,
 | 
			
		||||
        flowDetId: [this.detId],
 | 
			
		||||
      }).then((res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        if (res.data.length != []) {
 | 
			
		||||
          this.materialList = res.data[0].data
 | 
			
		||||
          this.name = res.data[0].name
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
		},
 | 
			
		||||
		clearList() {
 | 
			
		||||
			this.list = [];
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -71,7 +71,9 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
    this.getInfo()
 | 
			
		||||
    console.log(this.$route.query)
 | 
			
		||||
	},
 | 
			
		||||
	activated() {
 | 
			
		||||
		this.getInfo()
 | 
			
		||||
	},
 | 
			
		||||
	computed: {},
 | 
			
		||||
	methods: {
 | 
			
		||||
 
 | 
			
		||||
@@ -85,7 +85,7 @@ export default {
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					label: '检测时间',
 | 
			
		||||
					dateType: 'daterange', // datetimerange
 | 
			
		||||
					// format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
@@ -182,7 +182,7 @@ export default {
 | 
			
		||||
				checkPerson: undefined,
 | 
			
		||||
				workOrderId: undefined,
 | 
			
		||||
				checkTime: undefined,
 | 
			
		||||
				source: undefined,
 | 
			
		||||
				source: 1,
 | 
			
		||||
				workOrderId: undefined,
 | 
			
		||||
				remark: undefined,
 | 
			
		||||
			},
 | 
			
		||||
@@ -257,7 +257,7 @@ export default {
 | 
			
		||||
				sectionId: undefined,
 | 
			
		||||
				checkPerson: undefined,
 | 
			
		||||
				checkTime: undefined,
 | 
			
		||||
				source: undefined,
 | 
			
		||||
				source: 1,
 | 
			
		||||
				workOrderId: undefined,
 | 
			
		||||
				remark: undefined,
 | 
			
		||||
				productionLineId: undefined,
 | 
			
		||||
 
 | 
			
		||||
@@ -133,8 +133,6 @@ import {
 | 
			
		||||
	getDetList,
 | 
			
		||||
	getLineList,
 | 
			
		||||
} from '@/api/base/qualityScrapLog';
 | 
			
		||||
// import { getList } from '@/api/base/qualityScrapType';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
@@ -166,16 +164,14 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				workOrderId: [
 | 
			
		||||
					{ required: true, message: '工单号不能为空', trigger: 'change' },
 | 
			
		||||
					{ required: true, message: '工单名称不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
				num: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
 | 
			
		||||
				detId: [
 | 
			
		||||
					{ required: true, message: '报废原因不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
 | 
			
		||||
				logTime: [
 | 
			
		||||
					{ required: true, message: '报废时间不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
				logTime: [{ required: true, message: '报废时间不能为空', trigger: 'change' }],
 | 
			
		||||
			},
 | 
			
		||||
			showDetail: false,
 | 
			
		||||
		};
 | 
			
		||||
@@ -193,10 +189,9 @@ export default {
 | 
			
		||||
					console.log(res);
 | 
			
		||||
					this.dataForm = res.data;
 | 
			
		||||
					this.dataForm.logTime = res.data.logTime || null;
 | 
			
		||||
					console.log('==================');
 | 
			
		||||
				});
 | 
			
		||||
			} else {
 | 
			
		||||
				this.dataForm.logTime = moment().format('yyyy-MM-DD hh:mm:ss');
 | 
			
		||||
				this.dataForm.logTime = Date.now();
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 表单提交
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,7 @@
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
 | 
			
		||||
export default {
 | 
			
		||||
  name: "StatusBtn2",
 | 
			
		||||
  props: {
 | 
			
		||||
@@ -15,7 +16,14 @@ export default {
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    state() {
 | 
			
		||||
      return this.injectData.status === 1 ? "关闭" : "开启";
 | 
			
		||||
      let label = ''
 | 
			
		||||
      getDictDatas(DICT_TYPE.COMMON_STATUS).forEach((item) => {
 | 
			
		||||
        if (parseInt(item.value) === this.injectData.status) {
 | 
			
		||||
          label = item.label;
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
      return label
 | 
			
		||||
      // return this.injectData.status === 1 ? "关闭" : "开启";
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -21,12 +21,12 @@
 | 
			
		||||
			<el-table-column
 | 
			
		||||
				prop="name"
 | 
			
		||||
				label="部门名称"
 | 
			
		||||
				width="260"></el-table-column>
 | 
			
		||||
				min-width="260"></el-table-column>
 | 
			
		||||
			<el-table-column
 | 
			
		||||
				prop="leader"
 | 
			
		||||
				label="负责人"
 | 
			
		||||
				:formatter="userNicknameFormat"
 | 
			
		||||
				width="120" />
 | 
			
		||||
				min-width="120" />
 | 
			
		||||
			<el-table-column prop="sort" label="排序" width="200"></el-table-column>
 | 
			
		||||
			<el-table-column prop="status" label="状态" width="100">
 | 
			
		||||
				<template v-slot="scope">
 | 
			
		||||
@@ -37,7 +37,7 @@
 | 
			
		||||
				label="创建时间"
 | 
			
		||||
				align="center"
 | 
			
		||||
				prop="createTime"
 | 
			
		||||
				width="200">
 | 
			
		||||
				min-width="200">
 | 
			
		||||
				<template v-slot="scope">
 | 
			
		||||
					<span>{{ parseTime(scope.row.createTime) }}</span>
 | 
			
		||||
				</template>
 | 
			
		||||
@@ -45,45 +45,45 @@
 | 
			
		||||
			<el-table-column
 | 
			
		||||
				label="操作"
 | 
			
		||||
				align="center"
 | 
			
		||||
				width="160"
 | 
			
		||||
				class-name="small-padding fixed-width">
 | 
			
		||||
				<template v-slot="scope">
 | 
			
		||||
					<el-button
 | 
			
		||||
						size="mini"
 | 
			
		||||
						type="text"
 | 
			
		||||
						icon="el-icon-edit"
 | 
			
		||||
						@click="handleUpdate(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:dept:update']">
 | 
			
		||||
						修改
 | 
			
		||||
					</el-button>
 | 
			
		||||
					<el-button
 | 
			
		||||
						size="mini"
 | 
			
		||||
						type="text"
 | 
			
		||||
						icon="el-icon-plus"
 | 
			
		||||
						@click="handleAdd(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:dept:create']">
 | 
			
		||||
						新增
 | 
			
		||||
					</el-button>
 | 
			
		||||
					<span
 | 
			
		||||
							v-hasPermi="['system:dept:update']"
 | 
			
		||||
							style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
 | 
			
		||||
							>|</span
 | 
			
		||||
						>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						@click="handleUpdate(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:dept:update']">
 | 
			
		||||
						<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
 | 
			
		||||
					</el-button>
 | 
			
		||||
					<span
 | 
			
		||||
						 v-if="scope.row.parentId !== 0"
 | 
			
		||||
							v-hasPermi="['system:dept:delete']"
 | 
			
		||||
							style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
 | 
			
		||||
							>|</span
 | 
			
		||||
						>
 | 
			
		||||
					<el-button
 | 
			
		||||
						v-if="scope.row.parentId !== 0"
 | 
			
		||||
						size="mini"
 | 
			
		||||
						type="text"
 | 
			
		||||
						icon="el-icon-delete"
 | 
			
		||||
						@click="handleDelete(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:dept:delete']">
 | 
			
		||||
						删除
 | 
			
		||||
						<svg-icon icon-class="table_delete"></svg-icon>
 | 
			
		||||
					</el-button>
 | 
			
		||||
				</template>
 | 
			
		||||
			</el-table-column>
 | 
			
		||||
		</el-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 添加或修改菜单对话框 -->
 | 
			
		||||
		<el-dialog :visible.sync="open" width="800px" append-to-body class="dialog">
 | 
			
		||||
			<template #title>
 | 
			
		||||
				<slot name="title">
 | 
			
		||||
					<div class="titleStyle">{{ title }}</div>
 | 
			
		||||
				</slot>
 | 
			
		||||
			</template>
 | 
			
		||||
			<slot />
 | 
			
		||||
		<base-dialog :dialogVisible="open" :dialogTitle="title" width="800px" class="dialog" :before-close='cancel'>
 | 
			
		||||
			<el-form ref="form" :model="form" :rules="rules" label-width="80px">
 | 
			
		||||
				<el-row>
 | 
			
		||||
					<el-col :span="24">
 | 
			
		||||
@@ -117,9 +117,9 @@
 | 
			
		||||
								style="width: 100%">
 | 
			
		||||
								<el-option
 | 
			
		||||
									v-for="item in users"
 | 
			
		||||
									:key="parseInt(item.id)"
 | 
			
		||||
									:key="item.id"
 | 
			
		||||
									:label="item.nickname"
 | 
			
		||||
									:value="parseInt(item.id)" />
 | 
			
		||||
									:value="item.id" />
 | 
			
		||||
							</el-select>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-col>
 | 
			
		||||
@@ -157,7 +157,7 @@
 | 
			
		||||
        <el-button class="btnTextStyle"  @click="cancel">取 消</el-button>
 | 
			
		||||
				<el-button type="primary" class="btnTextStyle"  @click="submitForm">确 定</el-button>
 | 
			
		||||
			</div>
 | 
			
		||||
		</el-dialog>
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -316,7 +316,7 @@ export default {
 | 
			
		||||
				return '未设置';
 | 
			
		||||
			}
 | 
			
		||||
			for (const user of this.users) {
 | 
			
		||||
				if (row.leaderUserId === user.id) {
 | 
			
		||||
				if (row.leaderUserId == user.id) {
 | 
			
		||||
					return user.nickname;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -32,10 +32,23 @@
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 | 
			
		||||
        <template v-slot="scope">
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
 | 
			
		||||
                     v-hasPermi="['system:dict:update']">修改</el-button>
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
 | 
			
		||||
                     v-hasPermi="['system:dict:delete']">删除</el-button>
 | 
			
		||||
          <el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						@click="handleUpdate(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:dict:update']">
 | 
			
		||||
						<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
 | 
			
		||||
					</el-button>
 | 
			
		||||
					<span
 | 
			
		||||
							v-hasPermi="['system:dict:delete']"
 | 
			
		||||
							style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
 | 
			
		||||
							>|</span
 | 
			
		||||
						>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						@click="handleDelete(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:dict:delete']">
 | 
			
		||||
						<svg-icon icon-class="table_delete"></svg-icon>
 | 
			
		||||
					</el-button>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
@@ -44,13 +57,7 @@
 | 
			
		||||
                @pagination="getList"/>
 | 
			
		||||
 | 
			
		||||
    <!-- 添加或修改参数配置对话框 -->
 | 
			
		||||
		<el-dialog :visible.sync="open" width="800px" append-to-body class="dialog">
 | 
			
		||||
			<template #title>
 | 
			
		||||
				<slot name="title">
 | 
			
		||||
					<div class="titleStyle">{{ title }}</div>
 | 
			
		||||
				</slot>
 | 
			
		||||
			</template>
 | 
			
		||||
			<slot />
 | 
			
		||||
		<base-dialog :dialogTitle="title" :dialogVisible="open" :before-close="cancel" width="800px" class="dialog">
 | 
			
		||||
      <el-form ref="form" :model="form" :rules="rules" label-width="90px">
 | 
			
		||||
        <el-form-item label="字典类型">
 | 
			
		||||
          <el-input v-model="form.dictType" :disabled="true" />
 | 
			
		||||
@@ -85,7 +92,7 @@
 | 
			
		||||
        <el-button class="btnTextStyle"  @click="cancel">取 消</el-button>
 | 
			
		||||
				<el-button type="primary" class="btnTextStyle"  @click="submitForm">确 定</el-button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-dialog>
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -119,7 +126,7 @@ export default {
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        dictName: undefined,
 | 
			
		||||
        dictType: undefined,
 | 
			
		||||
        status: undefined
 | 
			
		||||
 
 | 
			
		||||
@@ -33,12 +33,25 @@
 | 
			
		||||
          <span>{{ parseTime(scope.row.createTime) }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 | 
			
		||||
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='100'>
 | 
			
		||||
        <template v-slot="scope">
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
 | 
			
		||||
                     v-hasPermi="['system:dict:update']">修改</el-button>
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
 | 
			
		||||
                     v-hasPermi="['system:dict:delete']">删除</el-button>
 | 
			
		||||
          <el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						@click="handleUpdate(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:dict:update']">
 | 
			
		||||
						<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
 | 
			
		||||
					</el-button>
 | 
			
		||||
					<span
 | 
			
		||||
							v-hasPermi="['system:dict:delete']"
 | 
			
		||||
							style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
 | 
			
		||||
							>|</span
 | 
			
		||||
						>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						@click="handleDelete(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:dict:delete']">
 | 
			
		||||
						<svg-icon icon-class="table_delete"></svg-icon>
 | 
			
		||||
					</el-button>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
@@ -47,13 +60,7 @@
 | 
			
		||||
                @pagination="getList"/>
 | 
			
		||||
 | 
			
		||||
    <!-- 添加或修改参数配置对话框 -->
 | 
			
		||||
		<el-dialog :visible.sync="open" width="800px" append-to-body class="dialog">
 | 
			
		||||
			<template #title>
 | 
			
		||||
				<slot name="title">
 | 
			
		||||
					<div class="titleStyle">{{ title }}</div>
 | 
			
		||||
				</slot>
 | 
			
		||||
			</template>
 | 
			
		||||
			<slot />
 | 
			
		||||
		<base-dialog :dialogTitle="title" :dialogVisible="open" :before-close="cancel" width="800px" class="dialog">
 | 
			
		||||
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
 | 
			
		||||
        <el-form-item label="字典名称" prop="name">
 | 
			
		||||
          <el-input v-model="form.name" placeholder="请输入字典名称" />
 | 
			
		||||
@@ -74,7 +81,7 @@
 | 
			
		||||
        <el-button class="btnTextStyle"  @click="cancel">取 消</el-button>
 | 
			
		||||
				<el-button type="primary" class="btnTextStyle"  @click="submitForm">确 定</el-button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-dialog>
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -105,7 +112,7 @@ export default {
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        name: undefined,
 | 
			
		||||
        type: undefined,
 | 
			
		||||
        status: undefined,
 | 
			
		||||
 
 | 
			
		||||
@@ -52,44 +52,43 @@
 | 
			
		||||
			<el-table-column
 | 
			
		||||
				label="操作"
 | 
			
		||||
				align="center"
 | 
			
		||||
				width="160"
 | 
			
		||||
				class-name="small-padding fixed-width">
 | 
			
		||||
				<template v-slot="scope">
 | 
			
		||||
					<el-button
 | 
			
		||||
						size="mini"
 | 
			
		||||
						type="text"
 | 
			
		||||
						icon="el-icon-edit"
 | 
			
		||||
						@click="handleUpdate(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:menu:update']">
 | 
			
		||||
						修改
 | 
			
		||||
					</el-button>
 | 
			
		||||
					<el-button
 | 
			
		||||
						size="mini"
 | 
			
		||||
						type="text"
 | 
			
		||||
						icon="el-icon-plus"
 | 
			
		||||
						@click="handleAdd(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:menu:create']">
 | 
			
		||||
						新增
 | 
			
		||||
					</el-button>
 | 
			
		||||
					<span
 | 
			
		||||
							v-hasPermi="['system:menu:update']"
 | 
			
		||||
							style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
 | 
			
		||||
							>|</span
 | 
			
		||||
						>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						@click="handleUpdate(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:menu:update']">
 | 
			
		||||
						<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
 | 
			
		||||
					</el-button>
 | 
			
		||||
					<span
 | 
			
		||||
							v-hasPermi="['system:menu:delete']"
 | 
			
		||||
							style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
 | 
			
		||||
							>|</span
 | 
			
		||||
						>
 | 
			
		||||
					<el-button
 | 
			
		||||
						size="mini"
 | 
			
		||||
						type="text"
 | 
			
		||||
						icon="el-icon-delete"
 | 
			
		||||
						@click="handleDelete(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:menu:delete']">
 | 
			
		||||
						删除
 | 
			
		||||
						<svg-icon icon-class="table_delete"></svg-icon>
 | 
			
		||||
					</el-button>
 | 
			
		||||
				</template>
 | 
			
		||||
			</el-table-column>
 | 
			
		||||
		</el-table>
 | 
			
		||||
 | 
			
		||||
		<!-- 添加或修改菜单对话框 -->
 | 
			
		||||
		<el-dialog :visible.sync="open" width="800px" append-to-body class="dialog">
 | 
			
		||||
			<template #title>
 | 
			
		||||
				<slot name="title">
 | 
			
		||||
					<div class="titleStyle">{{ title }}</div>
 | 
			
		||||
				</slot>
 | 
			
		||||
			</template>
 | 
			
		||||
			<slot />
 | 
			
		||||
		<base-dialog :dialogTitle="title" :dialogVisible="open" width="800px" class="dialog" :before-close="cancel">
 | 
			
		||||
			<el-form ref="form" :model="form" :rules="rules" label-width="100px">
 | 
			
		||||
				<el-row>
 | 
			
		||||
					<el-col :span="24">
 | 
			
		||||
@@ -271,7 +270,7 @@
 | 
			
		||||
        <el-button class="btnTextStyle"  @click="cancel">取 消</el-button>
 | 
			
		||||
				<el-button type="primary" class="btnTextStyle"  @click="submitForm">确 定</el-button>
 | 
			
		||||
			</div>
 | 
			
		||||
		</el-dialog>
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -27,12 +27,25 @@
 | 
			
		||||
          <span>{{ parseTime(scope.row.createTime) }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 | 
			
		||||
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='100'>
 | 
			
		||||
        <template v-slot="scope">
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
 | 
			
		||||
                     v-hasPermi="['system:post:update']">修改</el-button>
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
 | 
			
		||||
                     v-hasPermi="['system:post:delete']">删除</el-button>
 | 
			
		||||
          <el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						@click="handleUpdate(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:post:update']">
 | 
			
		||||
						<svg-icon icon-class="table_edit" style='font-size: 16px;'></svg-icon>
 | 
			
		||||
					</el-button>
 | 
			
		||||
					<span
 | 
			
		||||
							v-hasPermi="['system:post:delete']"
 | 
			
		||||
							style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
 | 
			
		||||
							>|</span
 | 
			
		||||
						>
 | 
			
		||||
					<el-button
 | 
			
		||||
						type="text"
 | 
			
		||||
						@click="handleDelete(scope.row)"
 | 
			
		||||
						v-hasPermi="['system:post:delete']">
 | 
			
		||||
						<svg-icon icon-class="table_delete"></svg-icon>
 | 
			
		||||
					</el-button>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
@@ -41,13 +54,7 @@
 | 
			
		||||
                @pagination="getList"/>
 | 
			
		||||
 | 
			
		||||
    <!-- 添加或修改岗位对话框 -->
 | 
			
		||||
		<el-dialog :visible.sync="open" width="800px" append-to-body class="dialog">
 | 
			
		||||
			<template #title>
 | 
			
		||||
				<slot name="title">
 | 
			
		||||
					<div class="titleStyle">{{ title }}</div>
 | 
			
		||||
				</slot>
 | 
			
		||||
			</template>
 | 
			
		||||
			<slot />
 | 
			
		||||
		<base-dialog  :dialogTitle="title" :dialogVisible="open" width="800px" class="dialog" :before-close="cancel">
 | 
			
		||||
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
 | 
			
		||||
        <el-form-item label="岗位名称" prop="name">
 | 
			
		||||
          <el-input v-model="form.name" placeholder="请输入岗位名称" />
 | 
			
		||||
@@ -72,7 +79,7 @@
 | 
			
		||||
        <el-button class="btnTextStyle"  @click="cancel">取 消</el-button>
 | 
			
		||||
				<el-button type="primary" class="btnTextStyle"  @click="submitForm">确 定</el-button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-dialog>
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -103,7 +110,7 @@ export default {
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        code: undefined,
 | 
			
		||||
        name: undefined,
 | 
			
		||||
        status: undefined
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="12">
 | 
			
		||||
        <el-form-item label="状态" prop="status" v-if="isEdit">
 | 
			
		||||
          <el-switch v-model="form.status"> </el-switch>
 | 
			
		||||
          <el-switch v-model="form.status" @change='changeStatus'> </el-switch>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="24">
 | 
			
		||||
@@ -38,7 +38,7 @@
 | 
			
		||||
  </el-form>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { addRole, getRole, updateRole } from "@/api/system/role";
 | 
			
		||||
import { addRole, getRole, updateRole,changeRoleStatus } from "@/api/system/role";
 | 
			
		||||
export default {
 | 
			
		||||
  name: "RoleAdd",
 | 
			
		||||
  data() {
 | 
			
		||||
@@ -124,6 +124,18 @@ export default {
 | 
			
		||||
      this.$refs.form.resetFields();
 | 
			
		||||
      this.isEdit = false;
 | 
			
		||||
    },
 | 
			
		||||
    // 修改状态
 | 
			
		||||
    changeStatus(val) {
 | 
			
		||||
      // 调用状态修改接口
 | 
			
		||||
      changeRoleStatus({
 | 
			
		||||
        id: this.form.id,
 | 
			
		||||
        status: val ? 0 : 1,
 | 
			
		||||
      }).then((res) => {
 | 
			
		||||
        if (res.code === 0) {
 | 
			
		||||
          this.$modal.msgSuccess("操作成功");
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -151,7 +151,6 @@ export default {
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'dataAuth',
 | 
			
		||||
							btnName: '数据权限',
 | 
			
		||||
							// showTip: "新增工单",
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('system:role:update')
 | 
			
		||||
@@ -246,6 +245,7 @@ export default {
 | 
			
		||||
			this.$refs.roleAdd.formClear();
 | 
			
		||||
			this.centervisible = false;
 | 
			
		||||
			this.addOrEditTitle = '';
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm() {
 | 
			
		||||
			this.$refs.roleAdd.submitForm();
 | 
			
		||||
 
 | 
			
		||||
@@ -68,7 +68,7 @@
 | 
			
		||||
		</el-row>
 | 
			
		||||
 | 
			
		||||
		<!-- 添加或修改参数配置对话框 -->
 | 
			
		||||
		<base-dialog :dialogTitle="title" :dialogVisible="open" width="50%">
 | 
			
		||||
		<base-dialog :dialogTitle="title" :dialogVisible="open" width="50%" :before-close="cancel">
 | 
			
		||||
			<el-form ref="form" :model="form" :rules="rules" label-width="100px">
 | 
			
		||||
				<el-row>
 | 
			
		||||
					<el-col :span="12">
 | 
			
		||||
@@ -180,6 +180,7 @@
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="upload.title"
 | 
			
		||||
			:dialogVisible="upload.open"
 | 
			
		||||
			:before-close="cancelImport"
 | 
			
		||||
			width="400px">
 | 
			
		||||
			<el-upload
 | 
			
		||||
				ref="upload"
 | 
			
		||||
@@ -219,7 +220,7 @@
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
 | 
			
		||||
		<!-- 分配角色 -->
 | 
			
		||||
		<base-dialog dialogTitle="分配角色" :dialogVisible="openRole" width="500px">
 | 
			
		||||
		<base-dialog dialogTitle="分配角色" :dialogVisible="openRole" width="500px" :before-close='cancelRole'>
 | 
			
		||||
			<el-form :model="form" label-width="80px">
 | 
			
		||||
				<el-form-item label="用户名称">
 | 
			
		||||
					<el-input v-model="form.username" :disabled="true" />
 | 
			
		||||
@@ -242,8 +243,8 @@
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-form>
 | 
			
		||||
			<div slot="footer" class="dialog-footer">
 | 
			
		||||
				<el-button type="primary" @click="submitRole">确 定</el-button>
 | 
			
		||||
				<el-button @click="cancelRole">取 消</el-button>
 | 
			
		||||
				<el-button type="primary" @click="submitRole">确 定</el-button>
 | 
			
		||||
			</div>
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
@@ -297,7 +298,7 @@ const tableProps = [
 | 
			
		||||
		prop: 'dept',
 | 
			
		||||
		label: '部门',
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
		filter: (item) => item.name || '',
 | 
			
		||||
		filter: (item) => item?.name || '',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
@@ -496,6 +497,9 @@ export default {
 | 
			
		||||
				username: [
 | 
			
		||||
					{ required: true, message: '用户名称不能为空', trigger: 'blur' },
 | 
			
		||||
				],
 | 
			
		||||
				deptId: [
 | 
			
		||||
					{ required: true, message: '归属部门不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
				nickname: [
 | 
			
		||||
					{ required: true, message: '用户昵称不能为空', trigger: 'blur' },
 | 
			
		||||
				],
 | 
			
		||||
@@ -625,6 +629,9 @@ export default {
 | 
			
		||||
			this.open = false;
 | 
			
		||||
			this.reset();
 | 
			
		||||
		},
 | 
			
		||||
		cancelImport() {
 | 
			
		||||
			this.upload.open = false;
 | 
			
		||||
		},
 | 
			
		||||
		// 取消按钮(角色权限)
 | 
			
		||||
		cancelRole() {
 | 
			
		||||
			this.openRole = false;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user