huang_an 2 tahun lalu
induk
melakukan
be3f899f70

+ 760 - 0
src/views/ledgerAssets/components/assetInformationView.vue

@@ -0,0 +1,760 @@
+<template>
+  <div id="assetInformation" class="baseinfo-container">
+    <el-form label-width="120px" :model="{ ...zcInfo }" ref="form">
+      <div class="content">
+        <div class="basic-details-title border-none">
+          <span class="border-span">资产信息</span>
+        </div>
+        <el-descriptions
+          title=""
+          :column="4"
+          size="medium"
+          border
+          style="edit"
+          :label-style="labelStyle"
+          class="descriptions"
+        >
+          <el-descriptions-item>
+            <template slot="label"> 固资编码 </template>
+            <el-form-item label-width="0">
+              <el-input class="input" v-model="zcInfo.fixCode"></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 编号 </template>
+            <el-form-item label-width="0">
+              <el-input class="input" v-model="zcInfo.codeNumber"></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 颜色 </template>
+            <el-form-item label-width="0">
+              <el-input class="input" v-model="zcInfo.color"></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 级别 </template>
+            <el-form-item label-width="0">
+              <el-select
+                style="width: 100%"
+                v-model="zcInfo.level"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in options.assetLevel"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 有效期开始 </template>
+            <el-form-item label-width="0">
+              <el-date-picker
+                style="width: 100%"
+                v-model="zcInfo.startTime"
+                type="month"
+                value-format="yyyy-MM"
+                placeholder="选择有效期开始"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 有效期结束 </template>
+            <el-form-item label-width="0">
+              <el-date-picker
+                style="width: 100%"
+                v-model="zcInfo.endTime"
+                @change="endTimeRules"
+                value-format="yyyy-MM"
+                type="month"
+                placeholder="选择有效期结束"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-descriptions-item>
+          <!-- <el-descriptions-item>
+            <template slot="label"> 状态 </template>
+            <el-form-item label-width="0">
+              <el-input
+                v-model="zcInfo.status"
+                placeholder="请输入状态"
+              ></el-input>
+            </el-form-item>
+          </el-descriptions-item> -->
+          <el-descriptions-item>
+            <template slot="label"> 入账日期 </template>
+            <el-form-item label-width="0">
+              <el-date-picker
+                style="width: 100%"
+                v-model="zcInfo.entryDate"
+                type="date"
+                placeholder="选择入账日期"
+                value-format="yyyy-MM-dd"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 周期 </template>
+            <el-form-item label-width="0">
+              <el-select
+                style="width: 100%"
+                v-model="zcInfo.cycle"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in options.deliveryCycle"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-descriptions-item>
+        </el-descriptions>
+        <el-descriptions
+          title=""
+          :column="3"
+          size="medium"
+          border
+          style="edit"
+          :label-style="labelStyle"
+          class="descriptions"
+        >
+          <el-descriptions-item>
+            <template slot="label"> 权属人 </template>
+            <el-form-item label-width="0">
+              <el-input
+                v-model="zcInfo.workstation.leaderName"
+                disabled
+                placeholder="请输入内容"
+              ></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 权属部门 </template>
+            <el-form-item label-width="0">
+              <div class="input">
+                <el-input
+                  v-model="zcInfo.workstation.groupName"
+                  disabled
+                  placeholder="请输入内容"
+                ></el-input>
+              </div>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item :span="3">
+            <template slot="label"> 所属厂房 </template>
+            <el-form-item label-width="0">
+              <el-input
+                style="margin-right: 10px; width: 20%"
+                v-model="zcInfo.workstation.workshopPlanName"
+                disabled
+                placeholder="请输入内容"
+              ></el-input>
+              <el-input
+                style="margin-right: 10px; width: 20%"
+                v-model="zcInfo.workstation.workshopName"
+                disabled
+                placeholder="请输入内容"
+              ></el-input>
+              <el-input
+                style="margin-right: 10px; width: 20%"
+                v-model="zcInfo.workstation.productionLineName"
+                disabled
+                placeholder="请输入内容"
+              ></el-input>
+              <el-input
+                style="margin-right: 10px; width: 20%"
+                v-model="zcInfo.workstation.name"
+                disabled
+                placeholder="请输入内容"
+              ></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 所属工序 </template>
+            <el-form-item label-width="0">
+              <el-input
+                v-model="zcInfo.workstation.taskNames"
+                disabled
+                placeholder="请输入内容"
+              ></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 设备位置 </template>
+            <el-form-item label-width="0" prop="location">
+              <div style="display: flex">
+                <el-cascader
+                  clearable
+                  v-model="zcInfo.location"
+                  :options="options.cityDataLabel"
+                ></el-cascader>
+                <el-input
+                  style="width: 60%; margin-left: 10px"
+                  placeholder="详细地址"
+                  v-model="zcInfo.detailPosition"
+                ></el-input>
+              </div>
+            </el-form-item>
+          </el-descriptions-item>
+        </el-descriptions>
+        <el-descriptions
+          title=""
+          :column="5"
+          size="medium"
+          border
+          style="edit"
+          :label-style="labelStyle"
+          class="descriptions"
+        >
+          <el-descriptions-item>
+            <template slot="label"> 维护部门 </template>
+            <el-form-item label-width="0">
+              <div class="input">
+                <DeptSelect v-model="zcInfo.repairGroupId" @input="getwhbm" />
+              </div>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 维护人 </template>
+            <el-form-item label-width="0">
+              <el-select
+                style="width: 100%"
+                v-model="zcInfo.repairUserId"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in options.repairUserId"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-descriptions-item>
+        </el-descriptions>
+        <el-descriptions
+          title=""
+          :column="5"
+          size="medium"
+          border
+          style="edit"
+          :label-style="labelStyle"
+          class="descriptions"
+        >
+          <el-descriptions-item>
+            <template slot="label"> 使用岗位 </template>
+            <el-form-item label-width="0">
+              <DeptSelect v-model="zcInfo.postId" @input="auditorDeptClick" />
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 使用人 </template>
+            <el-form-item label-width="0">
+              <el-select
+                style="width: 100%"
+                v-model="zcInfo.usePersonId"
+                filterable
+                placeholder="请选择使用人"
+              >
+                <el-option
+                  v-for="item in userList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-descriptions-item>
+
+          <el-descriptions-item>
+            <template slot="label"> 负责人 </template>
+            <el-form-item label-width="0">
+              <el-select
+                style="width: 100%"
+                v-model="zcInfo.chargePersonId"
+                filterable
+                placeholder="请选择负责人"
+              >
+                <el-option
+                  v-for="item in userList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-descriptions-item>
+        </el-descriptions>
+        <el-descriptions
+          title=""
+          :column="3"
+          size="medium"
+          border
+          style="edit"
+          :label-style="labelStyle"
+        >
+          <el-descriptions-item>
+            <template slot="label"> 供应商 </template>
+            <el-form-item label-width="0">
+              <el-select
+                v-model="zcInfo.supplierId"
+                style="width: 100%"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in options.suppList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 品牌 </template>
+            <el-form-item label-width="0">
+              <el-input v-model="zcInfo.brand" class="input"></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 设备用途 </template>
+            <el-form-item label-width="0">
+              <el-input v-model="zcInfo.purpose" class="input"></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+
+          <el-descriptions-item>
+            <template slot="label"> 备注 </template>
+            <el-form-item label-width="0">
+              <el-input
+                type="textarea"
+                :rows="2"
+                placeholder="请输入内容"
+                v-model="zcInfo.remark"
+              ></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+        </el-descriptions>
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script>
+  import DeptSelect from '@/components/CommomSelect/dept-select.vue';
+  import WorkshopSelect from '@/components/CommomSelect/workshop-select.vue';
+  import FactoryAreaSelect from '@/components/CommomSelect/factory-area-select.vue';
+  import WorkingProcedureSelect from '@/components/CommomSelect/working-procedure-select.vue';
+  import factorySelect from '@/components/CommomSelect/factory-select.vue';
+  import fileUpload from '@/components/upload/fileUpload';
+  import WithView from '@/components/upload/WithView';
+  import imgUpload from '@/components/upload/imgUpload';
+  import { cityDataLabel } from 'ele-admin/packages/utils/regions';
+  import personSelect from '@/components/CommomSelect/person-select.vue';
+  import { saveOrEdit, getAssetInfo } from '@/api/ledgerAssets';
+  import { getUserPage } from '@/api/system/organization';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+  import { getByCode } from '@/api/system/dictionary-data';
+  export default {
+    components: {
+      WithView,
+      WorkshopSelect,
+      FactoryAreaSelect,
+      WorkingProcedureSelect,
+      fileUpload,
+      imgUpload,
+      factorySelect,
+      DeptSelect,
+      personSelect
+    },
+    props: {
+      isEdit: {
+        type: Boolean,
+        default: true
+      }
+    },
+    data() {
+      return {
+        userList: [], // 人员列表
+        labelStyle: {
+          'min-width': '100px'
+        },
+        pageType: 'add',
+        id: '', // 设备主键id
+        rules: {
+          name: [
+            { required: true, message: '请输入设备名称', trigger: 'blur' }
+          ],
+          code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }]
+        },
+        // 资产信息
+        // zcInfo: {
+        //   // 	固定资产编码
+        //   fixCode: '',
+        //   // 颜色
+        //   color: '',
+        //   // 重量
+        //   weight: '',
+        //   // 维护部门
+        //   repairGroupId: '',
+        //   repairUserId: '',
+        //   // 设备用途
+        //   purpose: '',
+        //   // 设备位置
+        //   location: '',
+        //   //品牌
+        //   brand: '',
+        //   // 供应商code
+        //   supplierId: '',
+        //   // 编号
+        //   codeNumber: '',
+        //   // 使用人
+        //   usePersonId: '',
+        //   // 有效期开始
+        //   startTime: '',
+        //   // 有效结束
+        //   endTime: '',
+        //   // 级别
+        //   level: '',
+        //   // 状态
+        //   status: '',
+        //   // 负责人
+        //   chargePersonId: '',
+        //   // 入账日期
+        //   entryDate: '',
+        //   // 周期
+        //   cycle: '',
+        //   // 备注
+        //   remark: '',
+        //   // 使用岗位
+        //   postId: ''
+        // },
+        options: {
+          repairUserId: [], // 维护人
+          supplierId: [], // 供应商
+          cityDataLabel, // 设备位置
+          assetLevel: [], // 资产级别
+          deliveryCycle: [], // 送检周期
+          suppList: [] // 供应商
+        },
+        zcInfo: {
+          workstation: {}
+        }
+      };
+    },
+    props: {
+      form: {
+        type: Object,
+        default: {
+          workstation: {}
+        }
+      }
+    },
+    watch: {
+      form: {
+        //监听的对象
+        deep: true, //深度监听设置为 true
+        handler: function (newValue) {
+          console.log('watch中form:', newValue);
+          this.zcInfo = newValue;
+        }
+      }
+    },
+    async mounted() {
+      // 获取资产级别下拉框
+      await this.getAssetLevelOptions();
+      // 获取送检周期下拉
+      await this.getDeliveryCycleOptions();
+      // 获取供应商下拉列表
+      await this.getSuppliersList();
+      // 初始化数据
+      setTimeout(() => {
+        this.initData();
+      }, 500);
+    },
+    methods: {
+      // 限制结束时间
+      endTimeRules() {
+        if (this.zcInfo.startTime) {
+          console.log(this.zcInfo.startTime);
+          console.log(new Date(this.zcInfo.startTime).getTime());
+          let differenceTime =
+            new Date(this.zcInfo.endTime).getTime() -
+            new Date(this.zcInfo.startTime).getTime();
+          if (differenceTime <= 0) {
+            this.$message.error('请选择正确的有效结束时间');
+            this.zcInfo.endTime = '';
+          }
+        } else {
+          this.$message.error('请选择有效开始时间');
+          this.zcInfo.endTime = '';
+        }
+      },
+      // 获取资产级别下拉
+      async getAssetLevelOptions() {
+        let { data } = await getByCode('asset_level');
+        this.options.assetLevel =
+          data.length > 0
+            ? data.map((item) => {
+                return {
+                  name: Object.keys(item)[0],
+                  id: item[Object.keys(item)[0]]
+                };
+              })
+            : [];
+      },
+      // 获取送检周期下拉
+      async getDeliveryCycleOptions() {
+        let { data } = await getByCode('delivery_cycle');
+        console.log(data);
+        this.options.deliveryCycle =
+          data.length > 0
+            ? data.map((item) => {
+                return {
+                  name: item[Object.keys(item)[0]],
+                  id: +Object.keys(item)[0]
+                };
+              })
+            : [];
+      },
+      // 获取维护人下拉列表
+      async geMaintainersList() {
+        if (!this.zcInfo.repairGroupId) return;
+        let data = await getUserPage({
+          pageNum: 1,
+          size: 9999,
+          groupId: this.zcInfo.repairGroupId
+        });
+        this.options.repairUserId = data.list;
+      },
+      // 使用岗位点击事件
+      async auditorDeptClick(data) {
+        console.log(data);
+        if (data) {
+          this.getStaffList(data);
+        } else {
+          this.zcInfo.chargePersonId = '';
+          this.zcInfo.usePersonId = '';
+          this.userList = [];
+        }
+      },
+      // 获取供应商下拉列表
+      async getSuppliersList() {
+        const rep = await warehouseDefinition.eomContact({
+          type: 2,
+          status: 1,
+          size: -1,
+          pageNum: 1
+        });
+        this.options.suppList = rep.list;
+      },
+      // 通过部门岗位获取人员列表
+      async getStaffList(id) {
+        let res = await warehouseDefinition.getUserPage({
+          groupId: id,
+          size: 9999,
+          page: 1
+        });
+        this.userList = res.list;
+      },
+      // 维护部门
+      async getwhbm() {
+        if (!this.zcInfo.repairGroupId) return;
+        let data = await getUserPage({
+          pageNum: 1,
+          size: 9999,
+          groupId: this.zcInfo.repairGroupId
+        });
+        this.options.repairUserId = data.list;
+      },
+      // 提交
+      submit() {
+        if (!this.basicInfo && this.pageType == 'add') {
+          return this.$message.error('请选择物品编码');
+        }
+        this.$refs.form.validate((valid) => {
+          console.log(this.form);
+          if (valid) {
+            console.log('ppp', this.positionInfo);
+            let par = {
+              //基本信息
+              ...this.form,
+              assetType: 1,
+              // 资产信息
+              positionIds: '1,1,1,1',
+              ...this.zcInfo,
+              position: {
+                detailPosition: this.positionInfo.detailPosition,
+                pathIds: `${
+                  this.positionInfo.factoryCode
+                    ? this.positionInfo.factoryCode + ','
+                    : ''
+                }${
+                  this.positionInfo.workshopCode
+                    ? this.positionInfo.workshopCode + ','
+                    : ''
+                }${this.positionInfo.lineCode}`,
+                pathName: `${
+                  this.positionInfo.factoryName
+                    ? this.positionInfo.factoryName + ','
+                    : ''
+                }${
+                  this.positionInfo.workshopName
+                    ? this.positionInfo.workshopName + ','
+                    : ''
+                }${this.positionInfo.lineName}`,
+                type: '1',
+                num: 1
+              },
+              factoryRoomId: '',
+              factoryRoomName: '',
+              // 文档信息
+              attUrl: this.setWd() || [],
+              // // 设备图片
+              imageUrl: this.imageUrl || {},
+              // 是否启用物联
+              isIotEnable: this.isIotEnable
+              // // 扩展字段
+
+              // extInfoSelf: this.setKz()
+            };
+            const factoryRoomIds = [
+              this.zcInfo.factoryRoomId1,
+              this.zcInfo.factoryRoomId2,
+              this.zcInfo.factoryRoomId3,
+              this.zcInfo.factoryRoomId4,
+              this.zcInfo.factoryRoomId5
+            ];
+            const nonEmptyFactoryRoomIds = factoryRoomIds.filter((id) => id);
+            par.factoryRoomId = nonEmptyFactoryRoomIds.join(',');
+            //---
+            const factoryRoomNames = [
+              this.zcInfo.factoryRoomName1,
+              this.zcInfo.factoryRoomName2,
+              this.zcInfo.factoryRoomName3,
+              this.zcInfo.factoryRoomName4,
+              this.zcInfo.factoryRoomName5
+            ];
+            const nonEmptyFactoryRoomNames = factoryRoomNames.filter(
+              (id) => id
+            );
+            par.factoryRoomName = nonEmptyFactoryRoomNames.join(',');
+            //==
+
+            console.log(par);
+            par.deviceLocationName = par.location
+              ? par.location.toString()
+              : '';
+            // par.sss = par.position.detailPosition;
+            //==
+            //============================
+            par.extInfo = { ...this.zcInfo };
+            let obj = {};
+            par.extInfoSelf.forEach((item) => {
+              obj[item.key] = item.value;
+            });
+            par.extInfoSelf = obj;
+            //============================
+            if (this.pageType == 'edit') {
+              par.id = this.id;
+            }
+            this.btnLoading = true;
+            console.log('sasasasa', par);
+            saveOrEdit(par)
+              .then((res) => {
+                this.$message.success('操作成功');
+                this.$router.go(-1);
+              })
+              .finally(() => {
+                this.btnLoading = false;
+              });
+          } else {
+            console.log('error submit!!');
+            return false;
+          }
+        });
+      },
+      // 初始化
+      async initData() {
+        console.log('this.zcInfo---------------------', this.zcInfo);
+        // 填充使用岗位
+        this.zcInfo.postId && this.auditorDeptClick(this.zcInfo.postId);
+        this.geMaintainersList();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  ::v-deep .descriptions {
+    margin-bottom: 10px;
+  }
+  .baseinfo-container .basic-details-title {
+    font-size: 16px;
+    margin: 15px 0;
+  }
+  .upload-container {
+    display: flex;
+    justify-content: flex-start;
+    .file-list {
+      margin-left: 50px;
+      flex: 1;
+    }
+  }
+  .equipment-container {
+    // .content {
+    //   padding: 0 20px;
+    // }
+    .label-none {
+      .el-form-item__content {
+        margin-left: 0 !important;
+      }
+    }
+  }
+  .sbwz {
+    .item {
+      width: 120px !important;
+    }
+    .item + .item {
+      margin-left: 10px;
+    }
+    .item-input {
+      width: 350px !important;
+    }
+  }
+  .input {
+    width: 100%;
+  }
+  .kzzd {
+    width: 500px;
+    .add-col {
+      display: flex;
+      .col-input {
+        & + .col-input {
+          margin-left: 10px;
+        }
+      }
+      .del {
+        margin-left: 10px;
+      }
+    }
+  }
+  ::v-deep .el-descriptions {
+    .el-form-item {
+      margin-bottom: 0px;
+    }
+  }
+</style>

+ 165 - 0
src/views/ledgerAssets/components/basicInfoView.vue

@@ -0,0 +1,165 @@
+<template>
+  <!-- 基本信息 -->
+  <div class="baseinfo-container" style="padding: 0">
+    <div class="basic-details-title border-none">
+      <span class="border-span">基本信息</span>
+    </div>
+    <el-descriptions
+      :label-style="labelStyle"
+      :contentStyle="contentStyle"
+      title=""
+      :column="3"
+      size="medium"
+      border
+    >
+      <el-descriptions-item>
+        <template slot="label"> 分类 </template>
+        {{ idata.categoryLevelPath }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 编码 </template>
+        {{ idata.code }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 名称 </template>
+        {{ idata.name }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 牌号</template>
+        {{ idata.brandNum }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 型号 </template>
+        {{ idata.modelType }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 规格 </template>
+        {{ idata.specification }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 计量单位 </template>
+        {{ idata.measuringUnit }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 重量单位 </template>
+        {{ idata.weightUnit }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 包装单位 </template>
+        {{ idata.packingUnit }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 体积 </template>
+        {{ idata.volume ? idata.volume + '/' : null }}{{ idata.volumeUnit }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 毛重 </template>
+        {{ idata.roughWeight }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">净重 </template>
+        {{ idata.netWeight }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">所属部门 </template>
+        {{ idata.groupName }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">负责人 </template>
+        {{ idata.chargePerson }}
+      </el-descriptions-item>
+    </el-descriptions>
+  </div>
+</template>
+<script>
+  import { getUserPage } from '@/api/system/organization';
+  export default {
+    data() {
+      return {
+        labelStyle: {
+          width: '200px'
+        },
+        contentStyle: {
+          width: '400px'
+        },
+        depInfo: {},
+        idata: {}
+      };
+    },
+
+    methods: {
+      async getDetailInfoAugr(data) {
+        // const dep = await this.getDepUser(data.deptLeaderId, data.deptId);
+        // this.idata = { ...data, groupName: dep.groupName, name: dep.name };
+        this.idata = data;
+      },
+      async getDepUser(id, depId) {
+        const res = await getUserPage({
+          pageNum: 1,
+          size: -1,
+          executeGroupId: id
+        });
+        const list = res.list;
+        for (const key in list) {
+          if (list[key].id == depId) {
+            return list[key];
+          } else {
+            return {};
+          }
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .baseinfo-container {
+    background-color: #fff;
+    padding: 0px 20px 20px;
+    .content {
+      padding: 0 20px;
+    }
+    .basic-details-title {
+      font-size: 16px;
+      margin: 15px 0;
+    }
+    .upload-container {
+      display: flex;
+      .img-box {
+        width: 280px;
+        height: 342px;
+        border: 1px solid rgba(215, 215, 215, 1);
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        img {
+          max-width: 100%;
+        }
+      }
+      .file-list {
+        margin-left: 50px;
+        flex: 1;
+        display: flex;
+        justify-content: space-between;
+        flex-wrap: wrap;
+        justify-items: baseline;
+        align-content: flex-start;
+        .file-box {
+          width: 30%;
+          margin-bottom: 20px;
+          height: 57px;
+          text-align: center;
+          line-height: 55px;
+          border: 1px solid #1890ff;
+          color: #1890ff;
+          cursor: pointer;
+          &.disabled {
+            cursor: not-allowed;
+            border-color: rgba(215, 215, 215, 1);
+            color: rgba(215, 215, 215, 1);
+          }
+        }
+      }
+    }
+  }
+</style>

+ 3 - 6
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -67,9 +67,7 @@
       </template>
       <!-- 编码列 -->
       <!-- <template v-slot:code="{ row }">
-        <el-link type="primary" :underline="false" @click="handleView(row)">
-          {{ row.code }}
-        </el-link>
+        <span>{{ row.code }}</span>
       </template> -->
       <!-- 操作列 -->
       <template v-slot:action="{ row }">
@@ -137,22 +135,21 @@
             showOverflowTooltip: true,
             fixed: 'left'
           },
-
           {
             columnKey: 'code',
-            slot: 'code',
+            prop: 'code',
             label: '设备编码',
             showOverflowTooltip: true,
             minWidth: 130
           },
           // {
+          //   columnKey: 'code',
           //   prop: 'code',
           //   label: '设备编码',
           //   showOverflowTooltip: true,
           //   minWidth: 110,
           //   slot: 'code'
           // },
-
           {
             prop: 'name',
             label: '设备名称',

+ 0 - 221
src/views/ledgerAssets/equipment/edit.vue

@@ -20,139 +20,6 @@
         :rules="rules"
       >
         <div class="content">
-          <!-- <div class="basic-details-title border-none">
-            <span class="border-span">基本信息</span>
-          </div>
-          <el-descriptions title="" :column="4" size="medium" border>
-            <template slot="title" v-if="pageType == 'add'">
-              <el-form-item class="label-none" label-width="0">
-                <span style="color: red; padding-right: 5px">*</span>
-                <el-button type="primary" plain @click="handlwpbm"
-                  >选择物品编码</el-button
-                >
-              </el-form-item>
-            </template>
-            <el-descriptions-item :span="2">
-              <template slot="label"> 分类 </template>
-              {{ assetInfo.categoryLevelPath }}
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 设备编码 </template>
-              <el-form-item
-                prop="code"
-                label-width="0"
-                v-if="pageType == 'add'"
-              >
-                <el-input
-                  v-if="basicInfo"
-                  class="input"
-                  v-model="form.code"
-                ></el-input>
-              </el-form-item>
-              <span v-if="pageType == 'edit'">{{ form.code }}</span>
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 设备名称 </template>
-              <el-form-item
-                prop="name"
-                label-width="0"
-                v-if="pageType == 'add'"
-              >
-                <el-input
-                  v-if="basicInfo"
-                  class="input"
-                  v-model="form.name"
-                ></el-input>
-              </el-form-item>
-              <span v-if="pageType == 'edit'">{{ form.name }}</span>
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 牌号</template>
-              {{ assetInfo.brandNum }}
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 型号</template>
-              {{ assetInfo.modelType }}
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 规格 </template>
-              {{ assetInfo.specification }}
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 生产日期 </template>
-              <el-form-item
-                prop="productTime"
-                label-width="0"
-                v-if="pageType == 'add'"
-              >
-                <el-date-picker
-                  v-if="basicInfo"
-                  v-model="form.productTime"
-                  type="date"
-                  placeholder="选择日期时间"
-                  value-format="yyyy-MM-dd"
-                >
-                </el-date-picker>
-              </el-form-item>
-              <span v-if="pageType == 'edit'">{{ form.productTime }}</span>
-            </el-descriptions-item>
-                       <el-descriptions-item>
-              <template slot="label"> 过保日期 </template>
-              <span v-if="pageType == 'add'">{{ expirationTime }}</span>
-              <span v-if="pageType == 'edit'">{{ cbexpirationTime }}</span>
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 计量单位 </template>
-              {{ basicInfo.measuringUnit }}
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 重量单位 </template>
-              {{ basicInfo.weightUnit }}
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 包装单位 </template>
-              {{ basicInfo.packingUnit }}
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 体积 </template>
-              {{ basicInfo.volume ? basicInfo.volume + '/' : null
-              }}{{ basicInfo.volumeUnit }}
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 毛重 </template>
-              {{ basicInfo.roughWeight }}
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 净重 </template>
-              {{ basicInfo.netWeight }}
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 所属部门 </template>
-              <personSelect
-                ref="directorRef"
-                v-model="basicInfo.deptId"
-                :init="false"
-              />
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 负责人 </template>
-              {{ basicInfo.name }}
-            </el-descriptions-item>
-            <el-descriptions-item>
-              <template slot="label"> 标准产能 </template>
-              {{ setbzcn(basicInfo.extendField) }}
-            </el-descriptions-item>
-            <el-descriptions-item v-if="pageType == 'edit'">
-              <template slot="label"> 生命周期</template>
-              {{ sourceDICT }}
-            </el-descriptions-item>
-            <el-descriptions-item v-if="pageType == 'edit'">
-              <template slot="label"> 网络状态</template>
-              {{
-                networkStatus === 1 ? '在线' : networkStatus === 0 ? '离线' : ''
-              }}
-            </el-descriptions-item>
-          </el-descriptions> -->
           <basicInfoVue ref="basicInfoVueRef" />
           <businessInformation ref="businessInformationRef" :form="form" />
           <assetInformation ref="assetInformationRef" :form="zcInfo" />
@@ -193,12 +60,6 @@
             </el-descriptions-item>
             <el-descriptions-item>
               <template slot="label">质保预警参考</template>
-              <!-- <DictSelection
-                dictName="质保预警参考"
-                clearable
-                v-model="categoryWms.warrantyWarnRefer"
-              >
-              </DictSelection> -->
               {{ categoryWms.warrantyWarnRefer }}
             </el-descriptions-item>
             <el-descriptions-item>
@@ -482,26 +343,7 @@
   import { getDetails } from '@/api/classifyManage/itemInformation';
   import { sysDict, isExit } from '@/utils/sys';
   import linkMsg from './components/link-msg.vue';
-  // import selectUpload from "@/components/selectUpload";
-  // import UploadImg from "@/components/uploadImg/WithView.vue";
   import DialogGoods from './components/DialogGoods';
-  // import { parseTime } from "@/utils/ruoyi.js";
-  // import org from "@/api/main/org";
-  // import user from "@/api/main/user";
-  // import selectTree from "@/components/selectTree";
-  // import dict from "@/api/main/craft/dict";
-  // import { imageView } from "@/utils";
-  // import {
-  //   getPlants,
-  //   getfactoryInfo,
-  //   getFactorys,
-  //   getProductionLine,
-  //   // saveOrEdit,
-  //   getAssetNum,
-  //   getDetail,
-  //   getSupplier
-  // } from '@/api/ledgerAssets/equipment';
-  import { getFactoryarea } from '@/api/factoryModel';
   import assetInformation from '../components/assetInformation.vue';
   import businessInformation from '../components/businessInformation.vue';
   import {
@@ -516,8 +358,6 @@
   export default {
     components: {
       linkMsg,
-      //selectUpload,
-      //UploadImg,
       selectTree,
       FactoryLineSelect,
       WithView,
@@ -535,20 +375,6 @@
       basicInfoVue
     },
     data() {
-      // 设备地址校验规则
-      // var addressValidation = (rule, array, callback) => {
-      //   if (array?.length > 0) {
-      //     var filterArray = array.filter((item) => item && item.trim());
-      //     console.log(filterArray);
-      //     if (filterArray.length > 0) {
-      //       callback();
-      //     } else {
-      //       callback(new Error('地址不能为空'));
-      //     }
-      //   } else {
-      //     callback(new Error('地址不能为空'));
-      //   }
-      // };
       return {
         treeList: [], // 使用岗位树
         userList: [], // 人员列表
@@ -1068,21 +894,6 @@
         if (!this.basicInfo && this.pageType == 'add') {
           return this.$message.error('请选择物品编码');
         }
-        // if (!this.zcInfo.factoryRoomId1) {
-        //   return this.$message.error('请选择工厂');
-        // }
-        // if (!this.zcInfo.factoryRoomId2) {
-        //   return this.$message.error('请选择厂房');
-        // }
-        // if (!this.zcInfo.factoryRoomId3) {
-        //   return this.$message.error('请选择车间');
-        // }
-        // if (!this.zcInfo.factoryRoomId4) {
-        //   return this.$message.error('请选择产线');
-        // }
-        // if (!this.zcInfo.factoryRoomId5) {
-        //   return this.$message.error('请选择工位');
-        // }
         this.$refs.form.validate((valid) => {
           console.log('valid---------', valid);
           console.log(this.form);
@@ -1266,25 +1077,6 @@
 
         if (data.detailPosition) {
           this.positionInfo.detailPosition = data.detailPosition;
-
-          // const pathIds = data.positionList[0].pathIds.split(',');
-          // const pathName = data.positionList[0].pathName.split(',');
-
-          // this.zcInfo.factoryRoomId1 = pathIds[0];
-
-          // this.zcInfo.factoryRoomId2 = pathIds[1];
-
-          // this.zcInfo.factoryRoomId3 = pathIds[2];
-
-          // this.zcInfo.factoryRoomId4 = pathIds[3];
-
-          // this.zcInfo.factoryRoomId5 = pathIds[4];
-
-          this.$nextTick(() => {
-            // this.$refs.WorkshopSelectRef.getList();
-            // this.$refs.FactoryLineSelectRef.getList();
-          });
-          console.log('data', data);
           this.isLink = false;
           this.categoryWms = {
             ...data.category.categoryWms,
@@ -1314,10 +1106,6 @@
           };
           this.isLink = true;
         }
-        // // 资产信息
-        // this.zcInfo.codeNumber = data.codeNumber;
-        // this.zcInfo.fixCode = data.fixCode;
-
         this.getwhbm();
         this.getqsbm();
         if (data.attUrl && data.attUrl.length > 0) {
@@ -1385,12 +1173,6 @@
   ::v-deep .descriptions {
     margin-bottom: 10px;
   }
-  ::v-deep .el-descriptions__table tbody:nth-child(4) {
-    .el-descriptions-row {
-      .el-descriptions-item__cell:last-child {
-      }
-    }
-  }
   .baseinfo-container .basic-details-title {
     font-size: 16px;
     margin: 15px 0;
@@ -1404,9 +1186,6 @@
     }
   }
   .equipment-container {
-    // .content {
-    //   padding: 0 20px;
-    // }
     .label-none {
       .el-form-item__content {
         margin-left: 0 !important;

+ 4 - 1
src/views/maintenance/components/MaterialAdd.vue

@@ -32,7 +32,7 @@
         <template v-slot:content>
           <ProductSearch @search="reload" ref="searchRef" />
           <ele-pro-table
-            style="min-height: 400px"
+            height="400"
             ref="table"
             :columns="columns"
             :datasource="datasource"
@@ -248,9 +248,12 @@
             height: 100%;
             display: flex;
             flex-direction: column;
+            box-sizing: border-box;
             > div {
               flex: 1;
               .ele-split-panel-body {
+                display: flex;
+                flex-direction: column;
                 > div {
                   height: 100%;
                   display: flex;

+ 2 - 1
src/views/maintenance/components/operationGuideDialog.vue

@@ -113,6 +113,7 @@
 </template>
 
 <script>
+  import { deepClone } from 'ele-admin/lib/utils/core';
   // import { update, getById } from '@/api/inspectionClassify';
   import ProductModal from './ProductModal.vue';
   export default {
@@ -155,7 +156,7 @@
         console.log(row);
         console.log(index);
         if (row) {
-          this.form = row;
+          this.form = deepClone(row);
         }
         this.currentIndex = index;
         this.visible = true;

+ 1 - 1
src/views/maintenance/components/product-search.vue

@@ -23,7 +23,7 @@
           <el-input clearable v-model="where.fixCode" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { md: 4 } : { md: 4 }">
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
         <div class="ele-form-actions">
           <el-button
             type="primary"

+ 57 - 42
src/views/maintenance/components/programRulesDialog.vue

@@ -673,51 +673,62 @@
       save() {
         console.log(this.addForm);
         console.log(this.ruleIdList);
-        this.$refs.addFormRef.validate(async (valid) => {
-          console.log(valid);
-          if (valid) {
-            const planDeviceList = this.ruleIdList.map((ruleItem) => {
-              return ruleItem.equipmentList.map((item) => {
+        if (this.ruleIdList && this.ruleIdList.length > 0) {
+          this.$refs.addFormRef.validate(async (valid) => {
+            console.log(valid);
+            if (valid) {
+              const planDeviceList = this.ruleIdList.map((ruleItem) => {
+                return ruleItem.equipmentList.map((item) => {
+                  return {
+                    // equiCode: item.code,
+                    // equiName: item.name,
+                    deviceId: item.id,
+                    codeNumber: item.codeNumber,
+                    // equiModel: item.modelType,
+                    equiLocation: item.position[0].pathName,
+                    equiLocationCode: item.position[0].pathIds,
+                    workItems: ruleItem.ruleItems ? ruleItem.ruleItems : []
+                    // sparePart: ruleItem.sparePart ? obj.sparePart : []
+                  };
+                });
+              });
+              let boolen = planDeviceList.every((item) => item.length > 0);
+              console.log(planDeviceList);
+              if (!boolen) {
+                this.$message.error('请添加设备!');
+                return false;
+              }
+              let sendMsg = this.ruleIdList.map((item, index) => {
                 return {
-                  // equiCode: item.code,
-                  // equiName: item.name,
-                  deviceId: item.id,
-                  codeNumber: item.codeNumber,
-                  // equiModel: item.modelType,
-                  equiLocation: item.position[0].pathName,
-                  equiLocationCode: item.position[0].pathIds,
-                  workItems: ruleItem.ruleItems ? ruleItem.ruleItems : []
-                  // sparePart: ruleItem.sparePart ? obj.sparePart : []
+                  ...this.addForm,
+                  ruleId: item.ruleId,
+                  categoryId: item.categoryId,
+                  planDeviceList: planDeviceList[index],
+                  executorId: this.addForm.executeId
+                    ? this.addForm.executeId.join(',')
+                    : ''
                 };
               });
-            });
-
-            let sendMsg = this.ruleIdList.map((item, index) => {
-              return {
-                ...this.addForm,
-                ruleId: item.ruleId,
-                categoryId: item.categoryId,
-                planDeviceList: planDeviceList[index],
-                executorId: this.addForm.executeId
-                  ? this.addForm.executeId.join(',')
-                  : ''
-              };
-            });
-            let type = '';
-            if (this.dialogTitle === '派单') {
-              type = '派单';
-            } else {
-              type = this.dialogTitle.includes('新增') ? '新增' : '编辑';
-            }
-            try {
-              let res = await saveOrUpdate(sendMsg);
-              if (res) {
-                this.$message.success(type + '成功!');
-                this.$emit('done');
+              let type = '';
+              if (this.dialogTitle === '派单') {
+                type = '派单';
+              } else {
+                type = this.dialogTitle.includes('新增') ? '新增' : '编辑';
               }
-            } catch (error) {}
-          }
-        });
+              try {
+                let res = await saveOrUpdate(sendMsg);
+                if (res) {
+                  this.$message.success(type + '成功!');
+                  this.$emit('done');
+                }
+              } catch (error) {
+                this.$message.error(type + '失败!');
+              }
+            }
+          });
+        } else {
+          this.$message.error('请添加规则!');
+        }
       },
       // 保存操作指导数据
       saveEdit(data, index) {
@@ -740,7 +751,11 @@
         this.ruleIdList[this.ruleIndex].equipmentList.splice(index, 1);
       },
       deleteItem(index) {
-        this.ruleIdList[this.ruleIndex].ruleItems.splice(index, 1);
+        if (this.ruleIdList[this.ruleIndex].ruleItems.length > 1) {
+          this.ruleIdList[this.ruleIndex].ruleItems.splice(index, 1);
+        } else {
+          this.$message.error('至少要有一个规则事项!');
+        }
       },
       addPostscript() {
         console.log(

+ 1 - 1
vue.config.js

@@ -35,7 +35,7 @@ module.exports = {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.139:18086', // 粟
         // target: 'http://192.168.1.132:18086', // 徐
-        target: 'http://192.168.1.110:18086', //本
+        target: 'http://192.168.1.119:18086', //本
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''