Kaynağa Gözat

物资柜与邮件管理部分修复bug提交25年2月6日

pm 9 ay önce
ebeveyn
işleme
6e03d75143

+ 8 - 1
src/api/mes/material/plan.js

@@ -43,4 +43,11 @@ export function selectPlanById(query) {
   })
 }
 
-
+// 物资检查计划 签名分页
+export function getCheckPlanCabinetList(query) {
+  return request({
+    url: '/iscs/plan/getCheckPlanCabinetList',
+    method: 'get',
+    params: query
+  })
+}

+ 45 - 0
src/api/mes/standard/index.js

@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+
+// 查询物资属性项--分页
+export function PropertyPage(query) {
+  return request({
+    url: '/iscs/property/getIsMaterialsPropertyPage',
+    method: 'get',
+    params: query
+  })
+}
+
+// 新增物资属性项
+export function addProperty(data) {
+  return request({
+    url: '/iscs/property/insertIsMaterialsProperty',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改物资属性项
+export function updateProperty(data) {
+  return request({
+    url: '/iscs/property/updateIsMaterialsProperty',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除物资属性项
+export function deleteProperty(data) {
+  return request({
+    url: '/iscs/property/deleteIsMaterialsPropertyByPropertyIds?propertyIds=' + data,
+    method: 'post',
+  })
+}
+
+// 获取属性项详细信息
+export function selectPropertyById(query) {
+  return request({
+    url: '/iscs/property/selectIsMaterialsPropertyById?propertyId=' + query,
+    method: 'get',
+  })
+}
+

+ 45 - 0
src/api/mes/standard/propertyForm.js

@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+
+// 查询物资属性值--分页
+export function PropertyValuePage(query) {
+  return request({
+    url: '/iscs/propvalue/getIsMaterialsPropertyValuePage',
+    method: 'get',
+    params: query
+  })
+}
+
+// 新增物资属性值
+export function addPropertyValue(data) {
+  return request({
+    url: '/iscs/propvalue/insertIsMaterialsPropertyValue',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改物资属性值
+export function updatePropertyValue(data) {
+  return request({
+    url: '/iscs/propvalue/updateIsMaterialsPropertyValue',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除物资属性值
+export function deletePropertyValue(data) {
+  return request({
+    url: '/iscs/propvalue/deleteIsMaterialsPropertyValueByRecordIds?recordIds=' + data,
+    method: 'post',
+  })
+}
+
+// 获取属性值详细信息
+export function selectPropertyValueById(query) {
+  return request({
+    url: '/iscs/propvalue/selectIsMaterialsPropertyValueById?recordId=' + query,
+    method: 'get',
+  })
+}
+

+ 17 - 1
src/router/index.js

@@ -282,7 +282,23 @@ export const dynamicRoutes = [
       }
     ]
   },
-
+// 物资属性值
+  {
+    path: '/mes/material/standard',
+    component: Layout,
+    hidden: true,
+    permissions: ['iscs:property:list'],
+    children: [
+      {
+        path: 'propertyForm',
+        component: () => import('@/views/mes/material/standard/PropertyForm'),
+        name: 'propertyForm',
+        meta: {
+          title: '物资属性值'
+        },
+      }
+    ]
+  },
   {
     path: '/system/role-auth',
     component: Layout,

+ 1 - 2
src/views/mes/email/emailNotify/index.vue

@@ -413,7 +413,6 @@ export default {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.isEdit) {
-
             updateIsMailNotifyConfig(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
@@ -433,7 +432,7 @@ export default {
     handleDelete(row) {
       const templateCodes = row.configId || this.codes;
       this.$modal
-        .confirm('是否确认删除名称为"' + templateCodes + '"的数据项?')
+        .confirm('是否确认删除所选的数据项?')
         .then(function () {
           return deleteIsMailNotifyConfig(templateCodes);
         })

+ 1 - 1
src/views/mes/email/emailTemplates/index.vue

@@ -344,7 +344,7 @@ export default {
     handleDelete(row) {
       const templateIds = row.templateId || this.codes;
       this.$modal
-        .confirm('是否确认删除名称为"' + templateIds + '"的数据项?')
+        .confirm('是否确认删除所选数据项?')
         .then(function () {
           return delEmailTemplates(templateIds);
         })

+ 20 - 5
src/views/mes/material/Inspectionrecords/index.vue

@@ -68,6 +68,7 @@
           start-placeholder="开始日期"
           end-placeholder="结束日期"
           align="right"
+          @change="handleClearTime"
         >
         </el-date-picker>
       </el-form-item>
@@ -216,6 +217,12 @@
           <dict-tag :options="dict.type.exceptions_status" :value="scope.row.reason"/>
         </template>
       </el-table-column>
+      <el-table-column
+        label="措施"
+        align="center"
+        prop="measure"
+      >
+      </el-table-column>
       <el-table-column label="更换记录" align="center" prop="status">
         <template slot-scope="scope">
           <el-button type="text" @click="goto(scope.row)">查看</el-button>
@@ -428,15 +435,14 @@ export default {
     /** 查询物资信息列表 */
     getList() {
       this.loading = true
-      this.queryParams.planName = null
-      this.queryParams.cabinetId = null
-      this.queryParams.planId = null
+
       // 格式化日期并更新 queryParams
       if (Array.isArray(this.createTime) && this.createTime.length === 2) {
         this.queryParams.startTime = this.formatDate(this.createTime[0])
         this.queryParams.endTime = this.formatDate(this.createTime[1])
       }
       // 更新 queryParams 从路由查询参数
+
       if (this.$route.query.planName) {
         this.queryParams.planName = this.$route.query.planName
       }
@@ -463,7 +469,6 @@ export default {
       listCheckRecord(data).then((response) => {
         console.log(response, 'response')
         this.RecordList = response.data.records
-
         this.total = response.data.total
         this.loading = false
       })
@@ -560,13 +565,16 @@ export default {
     },
     // 表单重置
     reset() {
-
       this.resetForm('form')
       this.autoGenFlag = false
     },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.current = 1
+      // 在调用 getList 前确保查询条件保留输入框的值
+      this.queryParams.planName =this.queryParams.planName|| null
+      this.queryParams.cabinetId =this.queryParams.cabinetId|| null
+      this.queryParams.planId =this.queryParams.planId|| null
       this.getList()
     },
     /** 重置按钮操作 */
@@ -648,6 +656,13 @@ export default {
       this.download('iscs/check/exportIsMaterialsCheckRecord', {
         ...this.queryParams
       }, `records_${new Date().getTime()}.xlsx`)
+    },
+    //   检查日期清空
+    handleClearTime(value){
+      if(value==null){
+        this.queryParams.startTime=null
+        this.queryParams.endTime=null
+      }
     }
   }
 }

+ 5 - 1
src/views/mes/material/blacklist/index.vue

@@ -245,6 +245,7 @@ export default {
       loading: true,
       // 选中数组
       ids: [],
+      codes:[],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -345,7 +346,9 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
+      console.log(selection,'selection')
       this.ids = selection.map((item) => item.recordId)
+      this.codes=selection.map((item) => item.nickName)
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
@@ -423,8 +426,9 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const repairIds = row.recordId || this.ids
+      const nickName = row.nickName ||this.codes
       this.$modal
-        .confirm('是否确认的数据项?')
+        .confirm('是否确认删除姓名为"' + nickName + '"的数据项?')
         .then(function() {
           return delBlacklist(repairIds)
         })

+ 93 - 55
src/views/mes/material/collectionmanagement/index.vue

@@ -8,61 +8,65 @@
       v-show="showSearch"
       label-width="100px"
     >
-      <el-form-item label="物资柜" prop="loanFromId">
-        <el-select
-          :disabled="visibleSelect"
-          style="width: 215px"
-          v-model="queryParams.loanFromId"
-          placeholder="请选择物资柜"
-          clearable
-        >
-          <el-option
-            v-for="dict in cabinets"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
+      <el-row>
+        <el-form-item label="物资柜" prop="loanFromId">
+          <el-select
+            :disabled="visibleSelect"
+            style="width: 215px"
+            v-model="queryParams.loanFromId"
+            placeholder="请选择物资柜"
+            clearable
+          >
+            <el-option
+              v-for="dict in cabinets"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="物资名称" prop="materialsName">
+          <el-input
+            v-model="queryParams.materialsName"
+            placeholder="请输入物资名称"
+            clearable
+            @keyup.enter.native="handleQuery"
           />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="物资名称" prop="materialsName">
-        <el-input
-          v-model="queryParams.materialsName"
-          placeholder="请输入物资名称"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="物资类型" prop="materialsTypeId">
-        <treeselect
-          style="width: 215px"
-          v-model="queryParams.materialsTypeId"
-          :options="machinerytypeOptions"
-          :normalizer="normalizer"
-          placeholder="请选择物资类型"
-        />
-      </el-form-item>
-      <el-form-item label="领取人" prop="loanUserName">
-        <el-input
-          v-model="queryParams.loanUserName"
-          placeholder="请输入领取人"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="领取时间" prop="">
-        <el-date-picker
-          style="width: 215px"
-          :default-time="['00:00:00', '23:59:59']"
-          v-model="loanTime"
-          type="datetimerange"
-          :picker-options="pickerOptions"
-          range-separator="-"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          align="right"
-        >
-        </el-date-picker>
-      </el-form-item>
+        </el-form-item>
+        <el-form-item label="物资类型" prop="materialsTypeId">
+          <treeselect
+            style="width: 215px"
+            v-model="queryParams.materialsTypeId"
+            :options="machinerytypeOptions"
+            :normalizer="normalizer"
+            placeholder="请选择物资类型"
+          />
+        </el-form-item>
+        <el-form-item label="领取人" prop="loanUserName">
+          <el-input
+            v-model="queryParams.loanUserName"
+            placeholder="请输入领取人"
+            clearable
+            @keyup.enter.native="handleQuery"
+          />
+        </el-form-item>
+        <el-form-item label="领取时间" prop="">
+          <el-date-picker
+            style="width: 210px"
+            :default-time="['00:00:00', '23:59:59']"
+            v-model="loanTime"
+            type="datetimerange"
+            :picker-options="pickerOptions"
+            range-separator="-"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            align="right"
+            @change="handleClearLoanTime"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-row>
+
       <el-form-item label="归还人" prop="restitutionUserName">
         <el-input
           v-model="queryParams.restitutionUserName"
@@ -82,6 +86,7 @@
           start-placeholder="开始日期"
           end-placeholder="结束日期"
           align="right"
+          @change="handleClearRestitutionTime"
         >
         </el-date-picker>
       </el-form-item>
@@ -121,6 +126,7 @@
 <!--      </el-form-item>-->
 
       <el-form-item>
+
         <el-button
           v-no-more-click
           type="primary"
@@ -138,7 +144,17 @@
         >
       </el-form-item>
     </el-form>
-
+    <el-row>
+      <el-button
+        v-no-more-click
+        type="danger"
+        icon="el-icon-search"
+        size="mini"
+        v-if="!visibleSelect"
+        @click="handleQueryStatus"
+      >超时未还</el-button
+      >
+    </el-row>
 
     <el-table
       v-loading="loading"
@@ -430,6 +446,13 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+
+      this.queryParams.current = 1;
+      this.getList();
+    },
+    // 专门查询超时未还的
+    handleQueryStatus() {
+      this.queryParams.status='2'
       this.queryParams.current = 1;
       this.getList();
     },
@@ -510,6 +533,21 @@ export default {
         this.form.teamCode = null;
       }
     },
+    //领取时间清空
+    handleClearLoanTime(value){
+      if(value==null){
+        this.queryParams.loanTimeStart=null
+        this.queryParams.loanTimeEnd=null
+      }
+    },
+    //归还时间情况
+    handleClearRestitutionTime(value){
+      if(value==null){
+        this.queryParams.restitutionTimeStart=null
+        this.queryParams.restitutionTimeEnd=null
+      }
+    },
+
   },
 };
 </script>

+ 0 - 13
src/views/mes/material/directions/index.vue

@@ -1,13 +0,0 @@
-<script>
-export default {
-  name: 'index'
-}
-</script>
-
-<template>
-
-</template>
-
-<style scoped lang="scss">
-
-</style>

+ 238 - 12
src/views/mes/material/inspectionplan/index.vue

@@ -43,17 +43,23 @@
           start-placeholder="开始日期"
           end-placeholder="结束日期"
           align="right"
-
+          @change="handleClearTime"
         >
         </el-date-picker>
       </el-form-item>
       <el-form-item label="检察员" prop="checkUserName">
-        <el-input
+        <el-select
           v-model="queryParams.checkUserName"
-          placeholder="请输入检察员"
+          placeholder="请选择检察员"
           clearable
-          @keyup.enter.native="handleQuery"
-        />
+        >
+          <el-option
+            v-for="dict in planPersonOption"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.label"
+          />
+        </el-select>
       </el-form-item>
       <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="状态">
@@ -131,7 +137,7 @@
       <el-table-column label="巡检物资柜" align="center" prop="cabinetName">
         <template slot-scope="scope">
           <el-tooltip :content="scope.row.cabinetName" placement="top">
-            <span>{{ getDisplayText(scope.row.cabinetName) }}</span>
+            <span style="color:#1890ff;cursor: pointer" @click="PlanDetail(scope.row)">{{ getDisplayText(scope.row.cabinetName) }}</span>
           </el-tooltip>
         </template>
       </el-table-column>
@@ -165,6 +171,7 @@
       >
         <template slot-scope="scope">
           <el-button
+            :disabled="scope.row.status=='1'"
             v-no-more-click
             size="mini"
             type="text"
@@ -261,8 +268,115 @@
         <el-button v-no-more-click @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+<!--    签名弹窗-->
+    <el-dialog :visible.sync="openTable" width="800px" append-to-body>
+      <div slot="title" class="dialog-title">
+        <i></i>
+        <span class="title">巡检物资柜详情</span>
+      </div>
+      <el-table  v-loading="loading" :data="PlanDetailTableList">
+        <el-table-column label="计划名称" align="center" prop="planName">
+        </el-table-column>
+        <el-table-column label="巡检物资柜" align="center" prop="cabinetName">
+        </el-table-column>
+        <el-table-column label="签名" align="left" prop="signatureImg">
+          <template slot-scope="scope">
+            <div class="img-box" v-if="scope.row.signatureImg">
+              <el-image
+                style="width: 50px; height: 50px"
+                :preview-teleported="true"
+                class="images"
+                :hide-on-click-modal=true
+                :src="scope.row.signatureImg"
+                :zoom-rate="1.2"
+                :preview-src-list="[scope.row.signatureImg]"
+                :initial-index="1"
+                fit="cover"
+              >
+              </el-image>
+              <i class="el-icon-zoom-in" id="eyeicon"></i>
+            </div>
+            <span v-else>-</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="left" prop="">
+          <template slot-scope="scope">
+            <el-button type="text" @click="PlanDialogDetail(scope.row)">详情</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div slot="footer" class="dialog-footer">
+        <el-button v-no-more-click @click="cancel">关 闭</el-button>
+      </div>
+    </el-dialog>
+<!--  签名详情弹窗-->
+    <el-dialog :visible.sync="openRecord" width="1500px" append-to-body>
+      <div slot="title" class="dialog-title">
+        <i></i>
+        <span class="title">巡检物资柜检查记录</span>
+      </div>
+      <el-table  v-loading="loading" :data="RecordList">
+        <el-table-column label="计划名称" align="center" prop="planName" width="200">
+          <template slot-scope="scope">
+            {{ scope.row.planName }}
+          </template>
+        </el-table-column>
+        <el-table-column label="物资柜" align="center" prop="cabinetName">
+        </el-table-column>
+        <el-table-column label="物资编号" align="center" prop="materialsId">
+        </el-table-column>
+        <el-table-column label="物资名称" align="center" prop="materialsName"/>
+        <el-table-column label="物资类型" align="center" prop="materialsTypeName"/>
+        <el-table-column
+          label="物资图片"
+          align="center"
+          prop="materialsTypePicture"
+        >
+          <template slot-scope="scope">
+            <img
+              v-if="scope.row.materialsTypePicture"
+              :src="scope.row.materialsTypePicture"
+              alt=""
+              style="width: 50px; height: 50px"
+            />
+            <span v-else>-</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="RFID" align="center" prop="materialsRfid">
+        </el-table-column>
+        <el-table-column
+          label="检查时间"
+          align="center"
+          prop="createTime"
+          width="250"
+        >
+          <template slot-scope="scope">
+            {{ scope.row.createTime }}
+          </template>
+        </el-table-column>
+        <el-table-column label="状态" align="center" prop="status">
+          <template slot-scope="scope">
+            <dict-tag :options="dict.type.checks_status" :value="scope.row.status"/>
+          </template>
+        </el-table-column>
+        <el-table-column label="异常原因" align="center" prop="reason">
+          <template slot-scope="scope">
+            <dict-tag :options="dict.type.exceptions_status" :value="scope.row.reason"/>
+          </template>
+        </el-table-column>
 
-
+      </el-table>
+      <pagination
+        v-show="recordtotal > 0"
+        :total="recordtotal"
+        :page.sync="recordCurrent"
+        :limit.sync="recordSize"
+        @pagination="PlanDialogDetail"
+      />
+      <div slot="footer" class="dialog-footer">
+        <el-button v-no-more-click @click="cancelDetail">关 闭</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -273,7 +387,7 @@ import {
   addPlan,
   deletePlan,
   updatePlan,
-  selectPlanById
+  selectPlanById, getCheckPlanCabinetList
 } from '@/api/mes/material/plan'
 import Crontab from '@/components/Crontab/index.vue'
 import Treeselect from '@riophae/vue-treeselect'
@@ -282,6 +396,7 @@ import { listMarsDept } from '@/api/system/marsdept'
 import { getIsMaterialsCabinets, listMaterials } from '@/api/mes/material/information'
 import { listUser } from '@/api/system/user'
 import Template from '@/views/print/printtemplate/list.vue'
+import { listCheckRecord } from '@/api/mes/material/checkRecord'
 
 export default {
   name: 'Team',
@@ -292,7 +407,7 @@ export default {
       required: false
     }
   },
-  dicts: ['material_status', 'checking_status'],
+  dicts: ['material_status', 'checking_status','checks_status','exceptions_status'],
   data() {
     return {
       //自动生成编码
@@ -311,12 +426,21 @@ export default {
       showSearch: true,
       // 总条数
       total: 0,
+      recordtotal:0,//签名详情渲染
+      recordCurrent:1,//签名列表页面
+      recordSize:10,
       // 班组表格数据
       PlanList: [],
+      PlanDetailTableList:[],
+      // 检查记录表格数据
+      RecordList: [],
       // 弹出层标题
       title: '',
       // 是否显示弹出层
       open: false,
+      openTable:false,//巡检物资柜详情
+      openRecord:false,//签名弹框详情再打开
+      RecordselectedRow:null,//保证签名详情列表分页切换查询数据还在
       // 查询参数
       createTime: '',
       queryParams: {
@@ -477,6 +601,7 @@ export default {
         )
         this.loading = false
       })
+     ;
     },
 
     getOtherList() {
@@ -526,13 +651,46 @@ export default {
     getDisplayText(cabinetName) {
       const names = cabinetName.split(',')
       if (names.length == 1) {
-        return `${names.length}个 (${names[0]})`
+        // return `${names.length}个 (${names[0]})`
+        return `${names.length}个`
       }
       if (names.length > 1) {
-        return `${names.length}个 (${names[0]}...)`
+        // return `${names.length}个 (${names[0]}...)`
+        return `${names.length}个`
       }
       return names[0]
     },
+    // 巡检物资柜 点击事件
+    PlanDetail(row){
+      console.log(row,'签名分页')
+      this.openTable=true
+      const data={
+        planId:row.planId,
+        pageSize: 999999999,
+        pageNum: 1,
+      }
+      getCheckPlanCabinetList(data).then((response) => {
+        console.log(response,'物资柜 签名分页')
+        this.PlanDetailTableList=response.data
+      })
+    },
+    // 签名弹窗内部详情查看
+    PlanDialogDetail(row){
+      this.openRecord=true
+      this.RecordselectedRow = row || this.RecordselectedRow;
+      const data = {
+        planId: this.RecordselectedRow.planId,
+        cabinetId: this.RecordselectedRow.cabinetId,
+        current: this.recordCurrent,
+        size: this.recordSize,
+      };
+      listCheckRecord(data).then((response) => {
+        console.log(response, 'response')
+        this.RecordList = response.data.records
+        this.recordtotal = response.data.total
+        this.loading = false
+      })
+    },
     goto(row) {
       console.log(row, 'goto检查计划查看')
       if (this.cabinetId) {
@@ -613,8 +771,13 @@ export default {
     // 取消按钮
     cancel() {
       this.open = false
+      this.openTable = false
+
       this.reset()
     },
+    cancelDetail(){
+      this.openRecord=false
+    },
     // 表单重置
     reset() {
       this.form = {
@@ -650,7 +813,6 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const checkIds = row.planId || this.ids
-
       this.$modal
         .confirm('是否确认删除编号为"' + checkIds + '"的数据项?')
         .then(function() {
@@ -662,12 +824,76 @@ export default {
         })
         .catch(() => {
         })
+    },
+  //   计划日期清空
+    handleClearTime(value){
+      if(value==null){
+        this.queryParams.startTime=null
+        this.queryParams.endTime=null
+      }
     }
 
   }
 }
 </script>
 <style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
+</style>
+<style lang="scss" >
+//图片放大
+.img-box {
+  width: 50px;
+  height: 50px;
+  position: relative;
+
+  #eyeicon {
+    display: none;
+  }
+}
+
+.img-box:hover {
+  background: #000;
+
+  .images {
+    opacity: 0.6;
+  }
+
+  #eyeicon {
+    display: block;
+    position: absolute;
+    top: 40%;
+    left: 40%;
+    z-index: 100;
+    color: white;
+    pointer-events: none
+  }
+}
+.img-box1 {
+  width: 90px;
+  height: 90px;
+  position: relative;
+
+  #eyeicon {
+    display: none;
+  }
+}
+.img-box1:hover {
+  background: #000;
+  position: absolute;
+  top: 62%;
+  .images {
+    opacity: 0.6;
+  }
+
+  #eyeicon {
+    display: block;
+    position: absolute;
+    top: 40%;
+    left: 40%;
+    z-index: 100;
+    color: white;
+    pointer-events: none
+  }
+}
 .el-input-width {
   width: 380px !important;
 }

+ 1 - 0
src/views/mes/material/instructions/index.vue

@@ -445,6 +445,7 @@ export default {
         instructionsTitle:'',
         fileType:'',
         fileUrl:'',
+        orderNum:0
       }
       this.resetForm('form')
       this.autoGenFlag = false

+ 296 - 62
src/views/mes/material/materialinformation/index.vue

@@ -67,11 +67,12 @@
           start-placeholder="开始日期"
           end-placeholder="结束日期"
           align="right"
+          @change="handleClearTime"
         >
         </el-date-picker>
       </el-form-item>
       <el-form-item label="状态" prop="loanState">
-        <el-select v-model="queryParams.loanState" placeholder="状态">
+        <el-select style="width: 215px" v-model="queryParams.loanState" placeholder="状态">
           <el-option
             v-for="dict in dict.type.material_status"
             :key="dict.value"
@@ -80,7 +81,31 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="物资属性" prop="propertyId">
+        <el-select style="width: 200px" v-model="queryParams.propertyId" placeholder="请选择属性"
+                   @change="handlePropertyChange"
+        >
+          <el-option
+            v-for="property in PropertyList"
+            :key="property.propertyId"
+            :label="property.propertyName"
+            :value="property.propertyId"
+          />
+        </el-select>
+      </el-form-item>
 
+      <el-form-item label="物资属性值" prop="recordId">
+        <el-select style="width: 215px" v-model="queryParams.recordId" placeholder="请选择属性值"
+                   :disabled="!queryParams.propertyId"
+        >
+          <el-option
+            v-for="value in filteredPropertyValues"
+            :key="value.recordId"
+            :label="value.valueName"
+            :value="value.recordId"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button
           v-no-more-click
@@ -178,7 +203,11 @@
         align="center"
         prop="materialsTypeName"
       />
-
+      <el-table-column
+        label="物资规格"
+        align="center"
+        prop="propertiesValue"
+      />
       <el-table-column
         label="物资图片"
         prop="materialsTypePicture"
@@ -186,7 +215,7 @@
         <template slot-scope="scope">
           <div class="img-box" v-if="scope.row.materialsTypePicture">
             <el-image
-              style="width: 50px; height: 50px"
+              style="width: 50px; height: 50px;"
               :preview-teleported="true"
               class="images"
               :hide-on-click-modal=true
@@ -254,7 +283,7 @@
       @pagination="getList"
     />
     <!-- 添加或修改物资对话框 -->
-    <el-dialog :visible.sync="open" width="960px" append-to-body>
+    <el-dialog :visible.sync="open"  width="960px" append-to-body>
       <div slot="title" class="dialog-title">
         <i></i>
         <span class="title">{{ title }}</span>
@@ -278,6 +307,7 @@
                 :options="machinerytypeOptions"
                 :normalizer="normalizer"
                 placeholder="选择物资类型"
+
               />
             </el-form-item>
           </el-col>
@@ -326,54 +356,51 @@
                 v-model="form.expirationDate"
                 type="date"
                 placeholder="选择日期"
+                :picker-options="FormpickerOptions"
+                @change="handleClearTime"
               >
               </el-date-picker>
             </el-form-item>
           </el-col>
-          <!--            <el-form-item label="可用寿命" prop="serviceLife">-->
-          <!--           -->
-          <!--              <el-date-picker-->
-          <!--                v-model="form.serviceLife"-->
-          <!--                type="date"-->
-          <!--                placeholder="选择日期"-->
-          <!--              >-->
-          <!--              </el-date-picker>-->
-          <!--            </el-form-item>-->
-          <!--            <el-form-item label="可用次数" prop="serviceTimes">-->
-          <!--              <el-input v-model="form.serviceTimes" placeholder="" disabled />-->
-          <!--            </el-form-item>-->
-          <!--        <el-row>-->
-          <!--          <el-col :span="12">-->
-          <!--            <el-form-item label="启用日期" prop="startTime">-->
-          <!--              <el-input v-model="form.startTime" placeholder="" disabled />-->
-          <!--            </el-form-item>-->
-          <!--          </el-col>-->
-          <!--          <el-col :span="12">-->
-          <!--            <el-form-item label="物资剩余次数" prop="availableTimes">-->
-          <!--              <el-input-->
-          <!--                v-model="form.availableTimes"-->
-          <!--                placeholder="请输入物资剩余次数"-->
-          <!--              />-->
-          <!--            </el-form-item>-->
-          <!--          </el-col>-->
-          <!--        </el-row>-->
-          <!--            <el-form-item label="物资编码" prop="materialsCode">-->
-          <!--              <el-input-->
-          <!--                v-model="form.materialsCode"-->
-          <!--                placeholder="请输入物资编码"-->
-          <!--                style="width: 200px; margin-right: 10px"-->
-          <!--              />-->
-          <!--              <el-switch-->
-          <!--                v-model="autoGenFlag"-->
-          <!--                active-color="#13ce66"-->
-          <!--                active-text="自动生成"-->
-          <!--                @change="handleAutoGenChange(autoGenFlag)"-->
-          <!--              >-->
-          <!--              </el-switch>-->
-          <!--            </el-form-item>-->
-
         </el-row>
-
+        <el-row>
+          <el-form-item label="物资规格" prop="properties">
+            <div v-for="(property, index) in PropertyList" :key="property.propertyId" class="property-container">
+              <h3>{{ property.propertyName }}</h3>
+              <div class="property-values">
+                <!-- 循环渲染属性值 -->
+                <div
+                  v-for="(value, valueIndex) in PropertyValueList.filter(v => v.propertyId === property.propertyId)"
+                  :key="value.recordId"
+                  :class="['property-value', { 'selected': selectedValues[property.propertyId] === value.recordId }]"
+                  @click="selectValue(property.propertyId, value.recordId)"
+                >
+                  {{ value.valueName }}
+                </div>
+              </div>
+            </div>
+          </el-form-item>
+        </el-row>
+        <el-row style="height: 110px">
+          <el-form-item label="物资图片" prop="materialsTypePicture">
+            <div class="img-box2" v-if="form.materialsTypePicture">
+              <el-image
+                style="width: 90px; height: 90px"
+                :preview-teleported="true"
+                class="images"
+                :hide-on-click-modal=true
+                :src="form.materialsTypePicture"
+                :zoom-rate="1.2"
+                :preview-src-list="[form.materialsTypePicture]"
+                :initial-index="1"
+                fit="cover"
+              >
+              </el-image>
+              <i class="el-icon-zoom-in" id="eyeicon"></i>
+            </div>
+            <span v-else>-</span>
+          </el-form-item>
+        </el-row>
       </el-form>
 
       <div slot="footer" class="dialog-footer">
@@ -415,10 +442,10 @@
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
         <div class="el-upload__tip text-center" slot="tip">
-<!--          <div class="el-upload__tip" slot="tip">-->
-<!--            <el-checkbox v-model="upload.updateSupport"/>-->
-<!--            是否更新已经存在的用户数据-->
-<!--          </div>-->
+          <!--          <div class="el-upload__tip" slot="tip">-->
+          <!--            <el-checkbox v-model="upload.updateSupport"/>-->
+          <!--            是否更新已经存在的用户数据-->
+          <!--          </div>-->
           <span>仅允许导入xls、xlsx格式文件。</span>
           <el-link
             type="primary"
@@ -521,12 +548,14 @@ import {
   selectMaterialsById,
   getIsMaterialsCabinets, updateMaterialsBinding
 } from '@/api/mes/material/information'
-import { listType } from '@/api/mes/material/typeindex'
+import { listType, selectMaterialsTypeById } from '@/api/mes/material/typeindex'
 import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import { genCode } from '@/api/system/autocode/rule'
 import Template from '@/views/print/printtemplate/list.vue'
 import { getToken } from '@/utils/auth'
+import { PropertyPage } from '@/api/mes/standard'
+import { PropertyValuePage } from '@/api/mes/standard/propertyForm'
 
 export default {
   name: 'Team',
@@ -565,7 +594,6 @@ export default {
       title: '',
       // 是否显示弹出层
       open: false,
-
       // 查询参数
       createTime: '',
       queryParams: {
@@ -580,7 +608,9 @@ export default {
         startExpirationDate: '',
         endExpirationDate: '',
         supplier: null,
-        expirationDate: null
+        expirationDate: null,
+        recordId: null,
+        propertyId: null
       },
 
       // 查询参数
@@ -588,6 +618,11 @@ export default {
         current: 1,
         size: -1
       },
+      FormpickerOptions: {
+        disabledDate(time) {
+          return time.getTime() < Date.now() - 8.64e7;
+        },
+      },
       pickerOptions: {
         shortcuts: [
           {
@@ -632,7 +667,7 @@ export default {
         // 设置上传的请求头部
         headers: { Authorization: 'Bearer ' + getToken() },
         // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/iscs/materials/importMaterials",
+        url: process.env.VUE_APP_BASE_API + '/iscs/materials/importMaterials'
         // url: process.env.VUE_APP_BASE_API + '/common/upload'
       },
 
@@ -648,7 +683,8 @@ export default {
         ],
         materialsTypeId: [
           { required: true, message: '物资类型不能为空', trigger: 'blur' }
-        ]
+        ],
+
       },
       machinerytypeOptions: [],
       materialsIds: [],//绑定物资传递的数据
@@ -660,23 +696,62 @@ export default {
       dialogMatList: [],//绑定物资弹窗el-table数据
       openBind: false,
       totalBind: 0,//弹窗列表总数
-      visibleSelect: false
+      visibleSelect: false,
+      PropertyList: [],//属性名
+      PropertyValueList: [],//属性值
+      selectedValues: {} // 存储选中的属性值
+    }
+  },
+  watch: {
+    'form.materialsTypeId': function(val,old) {
+      if (val && val !== old) {
+        console.log(val, 'watch监听拿到新增时候的值')
+        selectMaterialsTypeById(val).then(response => {
+          const data = {
+            pageSize: 99999999,
+            pageNum: 1,
+            propertyId: response.data.propertyIds
+          }
+          this.form.materialsTypePicture=response.data.materialsTypePicture
+          PropertyPage(data).then((response) => {
+            console.log(response, '获取物资属性名 ')
+            this.PropertyList = response.data.records
+          })
+
+          PropertyValuePage(data).then((response) => {
+            console.log(response, '获取物资属性值 ')
+            this.PropertyValueList = response.data.records
+          })
+        })
+      }
     }
   },
   created() {
     this.queryParams.materialsCabinetId = this.cabinetId || null
     if (this.cabinetId) {
       this.visibleSelect = true
-
     }
     this.getList()
     this.getTreeselect()
 
   },
+  computed: {
+    filteredPropertyValues() {
+      if (!this.queryParams.propertyId) {
+        return []
+      }
+      return this.PropertyValueList.filter(value => value.propertyId === this.queryParams.propertyId)
+    }
+  },
   mounted() {
     this.materialsCabinets()
   },
   methods: {
+
+    handlePropertyChange(propertyId) {
+      // 当属性改变时,重置 recordId
+      this.queryParams.recordId = ''
+    },
     /* 绑定物资 */
     handleBind() {
       this.openBind = true
@@ -768,6 +843,43 @@ export default {
           'children'
         )
       })
+      // 这里给查询的数据
+      PropertyPage(data).then((response) => {
+        console.log(response, '获取物资属性名 ')
+        this.PropertyList = response.data.records
+      })
+      PropertyValuePage(data).then((response) => {
+        console.log(response, '获取物资属性值 ')
+        this.PropertyValueList = response.data.records
+      })
+    },
+    // 选择属性值
+    selectValue(propertyId, recordId) {
+      // 如果当前选中值和之前选中的相同,直接切换选中状态
+      if (this.selectedValues[propertyId] === recordId) {
+        this.selectedValues[propertyId] = null
+      } else {
+        this.$set(this.selectedValues, propertyId, recordId)
+      }
+      // 生成 JSON 格式的数据
+      const selectionJson = Object.entries(this.selectedValues).map(([propertyId, recordId]) => {
+        const property = this.PropertyList.find(p => p.propertyId === propertyId)
+        const value = this.PropertyValueList.find(v => v.recordId === recordId)
+        return {
+          propertyId,
+          recordId,
+          valueName: value ? value.valueName : '',
+          propertyName: property ? property.propertyName : ''
+
+        }
+      })
+      this.form.properties = JSON.stringify(selectionJson)
+      console.log(selectionJson, '生成的属性值json')
+    },
+    setInitialSelection(data) {
+      data.forEach(item => {
+        this.$set(this.selectedValues, item.propertyId, item.recordId)
+      })
     },
     //图片上传成功
     handleImgUplaoded(imgUrl) {
@@ -791,7 +903,8 @@ export default {
         materialsTypeId: '',
         materialsCabinetId: '',
         expirationDate: '',
-        supplier: ''
+        supplier: '',
+        materialsRfid:''
       }
       this.resetForm('form')
       this.autoGenFlag = false
@@ -812,6 +925,8 @@ export default {
       this.queryParams.endExpirationDate = null
       this.queryParams.materialsRfid = null
       this.queryParams.supplier = null
+      this.queryParams.propertyId = null
+      this.queryParams.recordId = null
       this.resetForm('queryForm')
       this.handleQuery()
     },
@@ -832,7 +947,7 @@ export default {
             value: item.cabinetId,
             label: item.cabinetName
           }))
-          this.cabinets.push({ value: 0, label: '空' });
+          this.cabinets.push({ value: 0, label: '空' })
         }
       })
     },
@@ -840,6 +955,9 @@ export default {
     /** 新增按钮操作 */
     handleAdd() {
       this.reset()
+      this.selectedValues = {}//新增保持物资规格是清空的
+      this.PropertyList=[]//新增保持物资规格是清空的
+      this.PropertyValueList=[]//新增保持物资规格是清空的
       this.open = true
       this.title = '新增物资信息'
       this.optType = 'add'
@@ -854,13 +972,39 @@ export default {
       this.reset()
       selectMaterialsById(row.materialsId).then((response) => {
         this.form = response.data
+        if (response.data) {
+          const data = {
+            pageSize: 99999999,
+            pageNum: 1,
+            propertyId: response.data.propertyIds
+          }
+          PropertyPage(data).then((response) => {
+            console.log(response, '获取物资属性名 ')
+            this.PropertyList = response.data.records
+          })
+          PropertyValuePage(data).then((response) => {
+            console.log(response, '获取物资属性值 ')
+            this.PropertyValueList = response.data.records
+          })
+        }
         this.open = true
         this.title = '编辑物资信息'
         this.optType = 'edit'
+        // 设置 selectedValues
+        if (response.data.properties) {
+          const JsonData = JSON.parse(response.data.properties)
+          this.setInitialSelection(JsonData)
+        } else {
+          this.selectedValues = {}
+        }
+
       })
     },
     // 有效期参数转换时间类型
     formatDateExpirationDate(dateString) {
+      if (!dateString) {
+        return null;  // 如果传入的是 null 或 undefined,则返回 null
+      }
       const date = new Date(dateString)
       const year = date.getFullYear()
       const month = String(date.getMonth() + 1).padStart(2, '0') // 月份从0开始,需要加1,并且补零
@@ -932,7 +1076,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const materialsIds = row.materialsId || this.ids
-      const materialsCodes = row.materialsName || this.codes
+      const materialsCodes = row.materialsId || this.ids
       this.$modal
         .confirm('是否确认删除编号为"' + materialsCodes + '"的数据项?')
         .then(function() {
@@ -965,12 +1109,21 @@ export default {
       } else {
         this.form.materialsCode = null
       }
+    },
+    //有效期截止 清空函数
+    handleClearTime(value){
+      console.log(value,'日期被清空了没')
+      if(value==null){
+        this.queryParams.startExpirationDate=null
+        this.queryParams.endExpirationDate=null
+        this.form.expirationDate=null
+      }
     }
   }
 }
 </script>
 <style lang="scss" src="@/assets/styles/dialog-title.scss" scoped></style>
-<style lang="scss" >
+<style lang="scss">
 //图片放大
 .img-box {
   width: 50px;
@@ -1000,6 +1153,87 @@ export default {
   }
 }
 
+.img-box1 {
+  width: 90px;
+  height: 90px;
+  position: relative;
+
+  #eyeicon {
+    display: none;
+  }
+}
+
+.img-box1:hover {
+  background: #000;
+  position: absolute;
+  top: 62%;
+
+  .images {
+    opacity: 0.6;
+  }
+
+  #eyeicon {
+    display: block;
+    position: absolute;
+    top: 40%;
+    left: 40%;
+    z-index: 100;
+    color: white;
+    pointer-events: none
+  }
+}
+.img-box2 {
+  width: 90px;
+  height: 90px;
+  position: relative;
+background: pink;
+  #eyeicon {
+    display: none;
+  }
+}
+
+.img-box2:hover {
+  background: #000;
+  position: absolute;
+
+
+  .images {
+    opacity: 0.6;
+  }
+
+  #eyeicon {
+    display: block;
+    position: absolute;
+    top: 40%;
+    left: 40%;
+    z-index: 100;
+    color: white;
+    pointer-events: none
+  }
+}
+//属性名和属性值样式
+.property-container {
+  margin-bottom: 20px;
+}
+
+.property-values {
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.property-value {
+  padding: 10px;
+  margin: 5px;
+  border: 1px solid #ccc;
+  cursor: pointer;
+  border-radius: 4px;
+}
+
+.property-value.selected {
+  border: 1px solid #80b3ff; /* 淡蓝色边框 */
+  background-color: #e6f0ff; /* 选中时的背景色 */
+}
+
 .el-input-width {
   width: 380px !important;
 }

+ 9 - 8
src/views/mes/material/replacementrecords/index.vue

@@ -51,6 +51,7 @@
           start-placeholder="开始日期"
           end-placeholder="结束日期"
           align="right"
+          @change="handleClearTime"
         >
         </el-date-picker>
       </el-form-item>
@@ -457,8 +458,6 @@ export default {
   },
 
   created() {
-
-
     if(this.cabinetId){
       this.visibleSelect=true
     }
@@ -498,10 +497,6 @@ export default {
       listChangeRecord(data).then((response) => {
         console.log(response, '获取物资信息allList ')
         this.changeRecordList = response.data.records
-        if(response.data.records.length > 0){
-          this.queryParams.cabinetId = response.data.records[0].cabinetId
-        }
-
         this.total = response.data.total
         this.loading = false
       })
@@ -600,7 +595,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pages = 1
+      this.queryParams.size = 10
       this.getList()
     },
     /** 重置按钮操作 */
@@ -674,7 +669,13 @@ export default {
         .catch(() => {
         })
     },
-
+    //   检查日期清空
+    handleClearTime(value){
+      if(value==null){
+        this.queryParams.startTime=null
+        this.queryParams.endTime=null
+      }
+    },
 
 
   }

+ 382 - 0
src/views/mes/material/standard/PropertyForm.vue

@@ -0,0 +1,382 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="100px"
+    >
+      <el-form-item label="属性项" prop="propertyName">
+        <el-input
+          disabled
+          v-model="queryParams.propertyName"
+          placeholder="请输入属性项"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="名称" prop="valueName">
+        <el-input
+          v-model="queryParams.valueName"
+          placeholder="请输入名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item>
+        <el-button
+          v-no-more-click
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+        >搜索
+        </el-button
+        >
+        <el-button
+          v-no-more-click
+          icon="el-icon-refresh"
+          size="mini"
+          @click="resetQuery"
+        >重置
+        </el-button
+        >
+        <el-button
+          v-no-more-click
+          type="warning"
+          icon="el-icon-close"
+          size="mini"
+          @click="goBack"
+        >返回
+        </el-button
+        >
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          v-no-more-click
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['iscs:propvalue:add']"
+        >新增
+        </el-button>
+      </el-col>
+
+
+      <el-col :span="1.5">
+        <el-button
+          v-no-more-click
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['iscs:propvalue:remove']"
+        >批量删除
+        </el-button>
+      </el-col>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+
+    <el-table
+      v-loading="loading"
+      :data="PropertyValueList"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="编号" align="center" prop="recordId">
+      </el-table-column>
+      <el-table-column label="名称" align="center" prop="valueName"/>
+      <el-table-column
+        label="备注"
+        align="center"
+        prop="remark"
+      />
+      <el-table-column
+        label="创建时间"
+        align="center"
+        prop="createTime"
+      />
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button
+            v-no-more-click
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['iscs:propvalue:edit']"
+          >编辑
+          </el-button>
+
+          <el-button
+            v-no-more-click
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['iscs:propvalue:remove']"
+          >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.current"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
+    <!-- 添加或修改物资对话框 -->
+    <el-dialog :visible.sync="open" width="500px" append-to-body>
+      <div slot="title" class="dialog-title">
+        <i></i>
+        <span class="title">{{ title }}</span>
+      </div>
+      <el-form ref="form" :model="form" :rules="rules" label-width="90px">
+        <el-form-item label="属性编号" prop="propertyId">
+          <el-input
+            disabled
+            style="width: 350px"
+            v-model="form.propertyId"
+            placeholder="请输入属性编号"
+          />
+        </el-form-item>
+        <el-form-item label="名称" prop="valueName">
+          <el-input
+            style="width: 350px"
+            v-model="form.valueName"
+            placeholder="请输入名称"
+          />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input
+            type="textarea"
+            style="width: 350px"
+            v-model="form.remark"
+            placeholder="请输入内容"
+          />
+        </el-form-item>
+      </el-form>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button v-no-more-click type="primary" @click="submitForm"
+        >确 定
+        </el-button
+        >
+        <el-button v-no-more-click @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import {
+  PropertyValuePage,
+  addPropertyValue,
+  updatePropertyValue,
+  deletePropertyValue,
+  selectPropertyValueById
+} from '@/api/mes/standard/propertyForm'
+
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+
+import Template from '@/views/print/printtemplate/list.vue'
+
+
+export default {
+  name: 'Team',
+  components: {
+    Template,
+    Treeselect
+  },
+  dicts: ['material_status','file_type'],
+  data() {
+    return {
+      //自动生成编码
+      autoGenFlag: false,
+      optType: undefined,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      codes: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 班组表格数据
+      PropertyValueList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      createTime: '',
+      queryParams: {
+        current: 1,
+        size: 10,
+        propertyName:'',
+        valueName:'',
+        propertyId:null
+      },
+      // 表单参数
+      form: {
+        propertyId:''
+      },
+      // 表单校验
+      rules: {
+        valveName: [
+          { required: true, message: '名称不能为空', trigger: 'blur' }
+        ],
+        materialsTypeId: [
+          { required: true, message: '物资类型不能为空', trigger: 'blur' }
+        ]
+      },
+
+
+    }
+  },
+  created() {
+    this.getList()
+
+  },
+
+  methods: {
+    goBack(){
+      this.$router.push('/material/standard')
+    },
+    /** 查询物资信息列表 */
+    getList() {
+      this.loading = true
+      this.queryParams.propertyId=this.$route.query.propertyId
+      this.queryParams.propertyName=this.$route.query.propertyName
+      PropertyValuePage(this.queryParams).then((response) => {
+        console.log(response, '获取物资说明 ')
+        this.PropertyValueList = response.data.records
+        this.total = response.data.total
+        this.loading = false
+      })
+    },
+
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        propertyName:''
+      }
+      this.resetForm('form')
+      this.autoGenFlag = false
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm('queryForm')
+      this.handleQuery()
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.recordId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset()
+      this.open = true
+      this.form.propertyId=this.$route.query.propertyId
+      this.title = '新增物资属性值'
+      this.optType = 'add'
+    },
+
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset()
+      selectPropertyValueById(row.recordId).then((response) => {
+        console.log(response,'编辑')
+        this.form = response.data
+        this.open = true
+        this.title = '编辑物资属性值'
+        this.optType = 'edit'
+      })
+    },
+
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          if (this.form.recordId != null) {
+            updatePropertyValue(this.form).then((response) => {
+              console.log(response, '修改返回')
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
+          } else {
+            console.log(this.form, '新增参数')
+            addPropertyValue(this.form).then((response) => {
+              console.log(response, '新增返回')
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
+          }
+        }
+      })
+    },
+
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const recordId = row.recordId || this.ids
+      this.$modal
+        .confirm('是否确认删除编号为"' + recordId + '"的数据项?')
+        .then(function() {
+          return deletePropertyValue(recordId)
+        })
+        .then(() => {
+          this.getList()
+          this.$modal.msgSuccess('删除成功')
+        })
+        .catch(() => {
+        })
+    }
+
+  }
+}
+</script>
+<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
+.el-input-width {
+  width: 380px !important;
+}
+</style>

+ 360 - 0
src/views/mes/material/standard/index.vue

@@ -0,0 +1,360 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="100px"
+    >
+      <el-form-item label="名称" prop="propertyName">
+        <el-input
+          v-model="queryParams.propertyName"
+          placeholder="请输入名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item>
+        <el-button
+          v-no-more-click
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+        >搜索
+        </el-button
+        >
+        <el-button
+          v-no-more-click
+          icon="el-icon-refresh"
+          size="mini"
+          @click="resetQuery"
+        >重置
+        </el-button
+        >
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          v-no-more-click
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['iscs:property:add']"
+        >新增
+        </el-button>
+      </el-col>
+
+
+      <el-col :span="1.5">
+        <el-button
+          v-no-more-click
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['iscs:property:remove']"
+        >批量删除
+        </el-button>
+      </el-col>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+
+    <el-table
+      v-loading="loading"
+      :data="PropertyList"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="编号" align="center" prop="propertyId">
+      </el-table-column>
+      <el-table-column label="名称" align="center" prop="propertyName"/>
+      <el-table-column
+        label="备注"
+        align="center"
+        prop="remark"
+      />
+      <el-table-column
+        label="创建时间"
+        align="center"
+        prop="createTime"
+      />
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button
+            v-no-more-click
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['iscs:property:edit']"
+          >编辑
+          </el-button>
+          <el-button
+            v-no-more-click
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleValue(scope.row)"
+            v-hasPermi="['iscs:property:edit']"
+          >属性值
+          </el-button>
+          <el-button
+            v-no-more-click
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['iscs:property:remove']"
+          >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.current"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
+    <!-- 添加或修改物资对话框 -->
+    <el-dialog :visible.sync="open" width="500px" append-to-body>
+      <div slot="title" class="dialog-title">
+        <i></i>
+        <span class="title">{{ title }}</span>
+      </div>
+      <el-form ref="form" :model="form" :rules="rules" label-width="90px">
+        <el-form-item label="名称" prop="propertyName">
+          <el-input
+            style="width: 350px"
+            v-model="form.propertyName"
+            placeholder="请输入名称"
+          />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input
+            type="textarea"
+            style="width: 350px"
+            v-model="form.remark"
+            placeholder="请输入内容"
+          />
+        </el-form-item>
+      </el-form>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button v-no-more-click type="primary" @click="submitForm"
+        >确 定
+        </el-button
+        >
+        <el-button v-no-more-click @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import {
+  PropertyPage,
+  addProperty,
+  updateProperty,
+  deleteProperty,
+  selectPropertyById
+} from '@/api/mes/standard/index'
+
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+
+import Template from '@/views/print/printtemplate/list.vue'
+
+
+export default {
+  name: 'Team',
+  components: {
+    Template,
+    Treeselect
+  },
+  dicts: ['material_status','file_type'],
+  data() {
+    return {
+      //自动生成编码
+      autoGenFlag: false,
+      optType: undefined,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      codes: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 班组表格数据
+      PropertyList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      createTime: '',
+      queryParams: {
+        current: 1,
+        size: 10,
+        propertyName: '',
+      },
+      // 表单参数
+      form: {
+
+      },
+      // 表单校验
+      rules: {
+        propertyName: [
+          { required: true, message: '名称不能为空', trigger: 'blur' }
+        ],
+        materialsTypeId: [
+          { required: true, message: '物资类型不能为空', trigger: 'blur' }
+        ]
+      },
+
+
+    }
+  },
+  created() {
+    this.getList()
+
+  },
+
+  methods: {
+
+    /** 查询物资信息列表 */
+    getList() {
+      this.loading = true
+      PropertyPage(this.queryParams).then((response) => {
+        console.log(response, '获取物资说明 ')
+        this.PropertyList = response.data.records
+        this.total = response.data.total
+
+        this.loading = false
+      })
+    },
+    // 跳转属性值页面
+    handleValue(row){
+      this.$router.push({name: 'propertyForm',query:{propertyId:row.propertyId,propertyName:row.propertyName}})
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        propertyName:''
+      }
+      this.resetForm('form')
+      this.autoGenFlag = false
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm('queryForm')
+      this.handleQuery()
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.propertyId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset()
+      this.open = true
+      this.title = '新增物资属性项'
+      this.optType = 'add'
+    },
+
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset()
+      selectPropertyById(row.propertyId).then((response) => {
+        this.form = response.data
+        this.open = true
+        this.title = '编辑物资属性项'
+        this.optType = 'edit'
+      })
+    },
+
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          if (this.form.propertyId != null) {
+            updateProperty(this.form).then((response) => {
+              console.log(response, '修改返回')
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
+          } else {
+            console.log(this.form, '新增参数')
+            addProperty(this.form).then((response) => {
+              console.log(response, '新增返回')
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
+          }
+        }
+      })
+    },
+
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const propertyId = row.propertyId || this.ids
+      this.$modal
+        .confirm('是否确认删除编号为"' + propertyId + '"的数据项?')
+        .then(function() {
+          return deleteProperty(propertyId)
+        })
+        .then(() => {
+          this.getList()
+          this.$modal.msgSuccess('删除成功')
+        })
+        .catch(() => {
+        })
+    }
+
+  }
+}
+</script>
+<style lang="scss" src="@/assets/styles/dialog-title.scss" scoped>
+.el-input-width {
+  width: 380px !important;
+}
+</style>

+ 28 - 0
src/views/mes/material/typeofmaterial/index.vue

@@ -236,6 +236,16 @@
             placeholder="请输入物资类型名称"
             style="width: 318px"
           />
+        </el-form-item>
+        <el-form-item label="物资规格" prop="propertyId">
+          <el-select style="width: 318px" v-model="form.propertyIds" placeholder="请选择规格" >
+            <el-option
+              v-for="property in PropertyList"
+              :key="property.propertyId"
+              :label="property.propertyName"
+              :value="property.propertyId"
+            />
+          </el-select>
         </el-form-item>
          <el-form-item label="是否需要归还" prop="restitutionRequired">
           <el-radio-group v-model="form.restitutionRequired" @change="changeLabel">
@@ -319,6 +329,7 @@
             <el-radio :label="'n'">禁用</el-radio>
           </el-radio-group>
         </el-form-item>
+
         <el-form-item label="备注" prop="remark">
           <el-input
             v-model="form.remark"
@@ -352,6 +363,17 @@
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row>
+          <el-form-item label="检查标准" prop="checkStandard">
+            <el-input
+              type="textarea"
+              :rows="10"
+              v-model="form.checkStandard"
+              placeholder="请输入检查标准"
+              style="width: 420px"
+            />
+          </el-form-item>
+        </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button v-no-more-click type="primary" @click="submitForm"
@@ -374,6 +396,7 @@ import {
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { genCode } from "@/api/system/autocode/rule";
+import { PropertyPage } from '@/api/mes/standard'
 export default {
   name: "hardwareType",
   dicts: ["material_type_status"],
@@ -393,6 +416,7 @@ export default {
       machinerytypeList: [],
       // 设备类型树选项
       machinerytypeOptions: [],
+      PropertyList:[],//属性名 物资规格
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -512,6 +536,10 @@ export default {
           "children"
         );
       });
+      PropertyPage(data).then((response) => {
+        console.log(response, '获取物资属性名 ')
+        this.PropertyList = response.data.records
+      })
     },
     // 取消按钮
     cancel() {