Quellcode durchsuchen

Merge remote-tracking branch 'origin/dev' into dev

001295 vor 1 Jahr
Ursprung
Commit
12b14a202c

+ 15 - 0
src/api/purchase/purchaseDemand.js

@@ -93,4 +93,19 @@ export function confirmSubmit(data) {
     method: 'POST',
     data: data
   })
+}
+// 需求窗口期配置列表获取
+export function getDemandWindowList() {
+  return request({
+    url: `/pu/setting/list`,
+    method: 'get',
+  })
+}
+// 需求窗口期配置保存
+export function saveDemandWindow(data) {
+  return request({
+    url: `/pu/setting/update`,
+    method: 'POST',
+    data: data
+  })
 }

+ 26 - 23
src/views/WMS/historical-route/index.vue

@@ -195,7 +195,6 @@
                 path.push([latitudeLongitude[i].gpsLongitude, latitudeLongitude[i].gpsLatitude]);
               }
             }
-            console.log(latitudeLongitude, 'latitudeLongitude')
             //计算各值
             this.calculate(res.data);
             //对订单温湿度列表进行赋值
@@ -207,7 +206,6 @@
               probeSum[i] = latitudeLongitude[i].measuringPointAddr;
             }
             probe = Array.from(new Set(probeSum));
-            console.log(probe, 'probe');
             //车辆温度数组
             let c, d;
             this.initEcharts();
@@ -227,7 +225,7 @@
                 },
                 markArea: {
                   itemStyle: {
-                    color: 'rgba(255, 173, 177, 0.4)'
+                    color: 'rgba(255, 0, 0)'
                   },
                   data: [
                     [{
@@ -275,12 +273,8 @@
               }
               this.option.series.push(carForm);
               this.option.legend.data.push(carForm.name);
-              console.log(this.option.series, 'this.option.series');
             }
-            // console.log(path, 'path')
-            console.log(this.temperatureData, 'temperatureData')
             //筛选保温箱的数组
-            console.log(this.carMessage.boxCode, 'this.carMessage.boxCode')
             if (this.carMessage.boxCode != null) {
               let e, f;
               for (let i = 0; i < this.carMessage.boxCode.length; i++) {
@@ -299,7 +293,7 @@
                   },
                   markArea: {
                     itemStyle: {
-                      color: 'rgba(255, 173, 177, 0.4)'
+                      color: 'rgba(255, 0, 0)'
                     },
                     data: [
                       [{
@@ -348,7 +342,6 @@
                 this.option.series.push(boxForm);
                 this.option.legend.data.push(boxForm.name);
               }
-              console.log(this.option.series, 'this.option.series');
             }
             //如果车辆温度数组为空,则其它数组前移一位
             for (let i = 1;;) {
@@ -364,13 +357,12 @@
                 break;
               }
             }
-            console.log(this.option, 'this.option');
             this.windowSize();
             //对基础数据进行赋值
             this.basicData.billCode = this.carMessage.billCode;
             this.basicData.plateNumber = this.carMessage.plateNumber;
-            this.basicData.startTime = res.data[0].hisDate;
-            this.basicData.endTime = res.data[res.data.length - 1].hisDate;
+            this.basicData.startTime = this.xData[0];
+            this.basicData.endTime = this.xData[this.xData.length - 1];
             //基本地图加载
             this.loadMap(path);
           }
@@ -428,10 +420,11 @@
             }
           },
           grid: {
-            left: '3%',
-            right: '4%',
-            bottom: '5%',
-            containLabel: true
+            x: 22,
+            y: 30,
+            x2: 20,
+            y2: 18,
+            borderWidth: 1,
           },
           toolbox: {
             //保存图
@@ -453,7 +446,10 @@
           yAxis: {
             name: '温度',
             // Y轴最大值
-            // max: 10,
+            max: 10,
+            // Y轴最大值
+            min: -30,
+            splitNumber: 2,
             // 间隔值
             // interval: 3
           },
@@ -531,9 +527,19 @@
           this.aggT += array[i].temperature;
           this.aggH += array[i].humidity;
         }
-        //x轴时间去重
-        this.xData = Array.from(new Set(x));
-        // console.log(this.xData, 'this.xData')
+        //x数组去重
+        x = Array.from(new Set(x));
+        let xSort = [];
+        for (let i = 0; i < x.length; i++) {
+          xSort[i] = new Date(x[i]);
+        }
+        xSort.sort(function (a, b) {
+          return a - b;
+        })
+        for (let i = 0; i < xSort.length; i++) {
+          x[i] = this.formatDateTime(xSort[i], 'yyyy-MM-dd HH:mm:ss');
+        }
+        this.xData = x;
         //温湿度平均值
         this.avgT = this.aggT / array.length;
         this.avgH = this.aggH / array.length;
@@ -550,7 +556,6 @@
         this.modelData1[0].endTime = array[array.length - 1].hisDate;
         this.tableData1 = this.modelData1;
         let median = (array.length / 2).toFixed(0);
-        console.log(median, 'median');
         let table = []
         for (let i = 0; i < median; i++) {
           table[i] = {
@@ -564,7 +569,6 @@
             hisDate1: ''
           }
         }
-        console.log(table, 'table');
         if (array.length % 2 == 0) {
           for (let i = 0, j = 0, z = 1; i < median; i++, j = j + 2, z = z + 2) {
             table[i].measuringPointName = array[j].measuringPointName;
@@ -590,7 +594,6 @@
             }
           }
         }
-        console.log(table, 'table');
         this.tableData2 = table;
       },
       //获取当前时间

+ 10 - 0
src/views/purchase/PurchaseDemandList/add.vue

@@ -153,6 +153,15 @@
               </el-select>
             </el-form-item>
          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="是否超需求可用周期">
+              <el-select v-model="basicForm.isBeyondRap" disabled size="mini" style="width: 200px">
+                <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+         </el-col>
       </el-row>
 
 
@@ -577,6 +586,7 @@ export default {
         planType: 'ZJH',
         demandDate: '',
         source: '4',
+        isBeyondRap: '',
         billType: 'ZQBH',
         isCustomerSpecified: 'N',
         isProcess: '',

+ 69 - 1
src/views/purchase/PurchaseDemandList/index.vue

@@ -154,6 +154,7 @@
 
         
         <div class="btn_grooup">
+          <el-button type="primary" size="mini" @click="demandWindow">需求窗口期</el-button>
           <el-button type="primary" size="mini" @click="addDivision">新增</el-button>
 
           <el-dropdown size="mini" @command="handleCommand">
@@ -319,6 +320,45 @@
       </div>
     </el-dialog>
 
+    <!-- 需求窗口期 -->
+    <el-dialog title="需求窗口期" :visible.sync="setDemand.open" @close="closeDemand" width="800px">
+      <div slot="footer">
+        <el-button size="mini" @click="setDemand.open = false">取 消</el-button>
+        <el-button type="primary" size="mini" @click="saveDemand">保 存</el-button>
+      </div>
+      <el-table
+        :data="setDemand.gridData"
+      >
+        <el-table-column property="ways" label="方案">
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.ways" size="mini" disabled>
+              <el-option v-for="dict in dict.type.sys_plan_type" :key="dict.value" :label="dict.label" :value="dict.value">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column property="category" label="类型">
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.category" size="mini" disabled>
+              <el-option v-for="dict in dict.type.sys_plan_type" :key="dict.value" :label="dict.label" :value="dict.value">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column property="deadline" label="截止星期/月份">
+          <template slot-scope="scope">
+            <el-input-number size="mini" :min=1 :max="scope.row.ways == 'ZJH' ? 7 : 12 " v-model="scope.row.deadline" clearable @input=changeDeadline(scope.row)></el-input-number>
+          </template>
+        </el-table-column>
+        <el-table-column property="remark" label="备注">
+          <template slot-scope="scope">
+            <el-input size="mini" v-model="scope.row.remark" clearable></el-input>
+          </template>
+        </el-table-column>
+      </el-table>
+      <span style="color: red">注:周计划星期填写范围1-7,月计划填写范围1-12</span>
+    </el-dialog>
+
     <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="searchList"/>
   
     <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
@@ -336,7 +376,7 @@ import TreeRefers from '@/components/Refers/sigleTreeRefer.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 // 流程收回
 import { rebacktWork } from '@/api/purchase/workSpace.js'
-import {getDemandList, delDemand, downLoadDemand, exportDemand, submitDemand, confirmSubmit } from '@/api/purchase/purchaseDemand.js'
+import {getDemandList, delDemand, downLoadDemand, exportDemand, submitDemand, confirmSubmit, getDemandWindowList, saveDemandWindow } from '@/api/purchase/purchaseDemand.js'
 export default {
   name: 'PurchaseDemandList',
   components: {
@@ -446,6 +486,10 @@ export default {
       hiddenabled: true,
     },
   })),
+    setDemand: {
+      open: false,
+      gridData: []
+    }
     }
   },
   created() {
@@ -862,6 +906,30 @@ export default {
       this.classOptions.push(selection)
       this.download.category = selection.code
     },
+    // 需求窗口期配置
+    demandWindow() {
+      this.setDemand.open = true
+      this.$nextTick(() => {
+        getDemandWindowList().then(res => {
+          if (res.code === 200) {
+            this.setDemand.gridData = res.rows
+          }
+        })
+      })
+    },
+    saveDemand() {
+      let params = this.setDemand.gridData
+      saveDemandWindow(params).then(res => {
+        if (res.code === 200) {
+          this.$modal.notifySuccess("保存成功");
+          this.setDemand.open = false
+        }
+      })
+    },
+    changeDeadline(row) {
+      row.delFlag = '2'
+    },
+    closeDemand() {}
   }
 }
 </script>

+ 94 - 30
src/views/purchase/equipmentData/add.vue

@@ -27,6 +27,13 @@
           </el-col>
 
           <el-col :span="1.5">
+            <el-form-item label="适用科室" prop="departmentCode">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.departmentCode">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
             <el-form-item label="厂家名称" prop="factoryName">
               <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.factoryName">
               </el-input>
@@ -61,7 +68,6 @@
           <el-col :span="12">
             <el-form-item label="文件上传" prop="sysMaterialDeviceOriginFileList">
             <el-upload
-              class="upload-demo"
               :action="url"
               :headers="headers"
               :on-preview="handlePreview"
@@ -72,7 +78,7 @@
               :limit="1"
               :on-exceed="handleExceed"
               :file-list="basicForm.sysMaterialDeviceOriginFileList">
-              <el-button size="small" type="primary">点击上传</el-button>
+              <el-button size="small" type="primary" :disabled="sonDisable">点击上传</el-button>
               <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
             </el-upload>
             </el-form-item>
@@ -82,7 +88,7 @@
         <el-row>
           <el-col :span="1.5">
             <el-form-item label="参数" prop="parameters">
-              <el-input type="textarea" style="width: 400px" clearable :disabled="sonDisable" size="mini" v-model="basicForm.parameters">
+              <el-input type="textarea" rows=4 style="width: 900px" clearable :disabled="sonDisable" size="mini" v-model="basicForm.parameters">
               </el-input>
             </el-form-item>
           </el-col>
@@ -91,7 +97,7 @@
         <el-row>
           <el-col :span="1.5">
             <el-form-item label="备注" prop="remark">
-              <el-input type="textarea" style="width: 400px" clearable :disabled="sonDisable" size="mini" v-model="basicForm.remark">
+              <el-input type="textarea" rows=4 style="width: 400px" clearable :disabled="sonDisable" size="mini" v-model="basicForm.remark">
               </el-input>
             </el-form-item>
           </el-col>
@@ -135,7 +141,15 @@
           <!-- <ux-table-column resizable title="序号" type="index" align="center" width="50px"/> -->
           <ux-table-column resizable title="省份" align="center"  field="province" edit-render>
             <template v-slot:edit="scope">
-                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.province"/>
+              <el-select size="mini" :disabled="sonDisable" v-model="scope.row.province" filterable clearable placeholder="请选择">
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+                <!-- <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.province"/> -->
             </template>
           </ux-table-column>
 
@@ -183,6 +197,7 @@ export default {
         commonName: '',
         registrationName: '',
         deviceCategory: '',
+        departmentCode: '',
         factoryName: '',
         model: '',
         referencePrice: '',
@@ -204,7 +219,43 @@ export default {
       ids:[],
       delDemandItemList:[],
       headers: { Authorization: "Bearer " + getToken() },
-      url: process.env.VUE_APP_BASE_API + '/device/origin/upload'
+      url: process.env.VUE_APP_BASE_API + '/device/origin/upload',
+      options: [
+        {value: '黑龙江省', label: '黑龙江省'},
+        {value: '吉林省', label: '吉林省'},
+        {value: '辽宁省', label: '辽宁省'},
+        {value: '河北省', label: '河北省'},
+        {value: '甘肃省', label: '甘肃省'},
+        {value: '青海省', label: '青海省'},
+        {value: '陕西省', label: '陕西省'},
+        {value: '河南省', label: '河南省'},
+        {value: '山东省', label: '山东省'},
+        {value: '山西省', label: '山西省'},
+        {value: '安徽省', label: '安徽省'},
+        {value: '湖北省', label: '湖北省'},
+        {value: '湖南省', label: '湖南省'},
+        {value: '江苏省', label: '江苏省'},
+        {value: '四川省', label: '四川省'},
+        {value: '贵州省', label: '贵州省'},
+        {value: '云南省', label: '云南省'},
+        {value: '浙江省', label: '浙江省'},
+        {value: '广东省', label: '广东省'},
+        {value: '江西省', label: '江西省'},
+        {value: '福建省', label: '福建省'},
+        {value: '台湾省', label: '台湾省'},
+        {value: '海南省', label: '海南省'},
+        {value: '新疆维吾尔自治区', label: '新疆维吾尔自治区'},
+        {value: '内蒙古自治区', label: '内蒙古自治区'},
+        {value: '宁夏回族自治区', label: '宁夏回族自治区'},
+        {value: '广西壮族自治区', label: '广西壮族自治区'},
+        {value: '西藏自治区', label: '西藏自治区'},
+        {value: '北京市', label: '北京市'},
+        {value: '上海市', label: '上海市'},
+        {value: '天津市', label: '天津市'},
+        {value: '重庆市', label: '重庆市'},
+        {value: '香港特别行政区', label: '香港特别行政区'},
+        {value: '澳门特别行政区', label: '澳门特别行政区'},
+      ]
     }
   },
   created() {
@@ -230,30 +281,33 @@ export default {
       this.sonDisable = false
     },
     async save() {
-      console.log(this.sonPageStu)
       // return false
-      if (this.sonPageStu == 'add') {
-        await addEquipment(this.basicForm).then(res => {
-          if(res.code === 200) {
-            this.$modal.notifySuccess("新增保存成功");
-            this.back()
-          }
-        })
-      } else if (this.sonPageStu == 'edit') {
-        let list = []
-        list.push(...this.basicForm.sysMaterialDeviceOriginItemList, ...this.delDemandItemList)
-        // 深拷贝一下参数对象
-        let param = JSON.parse(JSON.stringify(this.basicForm))
-        console.log('深拷贝对象',param);
-        param.sysMaterialDeviceOriginItemList = list
-        await editEquipment(param).then(res => {
-          if(res.code === 200) {
-            this.$modal.notifySuccess("编辑保存成功");
-            this.sonPageStu = 'check'
-            this.sonDisable = true
-            this.getDetails(this.row)
-          }
-        })
+      if(this.basicForm.sysMaterialDeviceOriginItemList.length !== 0) {
+        if (this.sonPageStu == 'add') {
+          await addEquipment(this.basicForm).then(res => {
+            if(res.code === 200) {
+              this.$modal.notifySuccess("新增保存成功");
+              this.back()
+            }
+          })
+        } else if (this.sonPageStu == 'edit') {
+          let list = []
+          list.push(...this.basicForm.sysMaterialDeviceOriginItemList, ...this.delDemandItemList)
+          // 深拷贝一下参数对象
+          let param = JSON.parse(JSON.stringify(this.basicForm))
+          console.log('深拷贝对象',param);
+          param.sysMaterialDeviceOriginItemList = list
+          await editEquipment(param).then(res => {
+            if(res.code === 200) {
+              this.$modal.notifySuccess("编辑保存成功");
+              this.sonPageStu = 'check'
+              this.sonDisable = true
+              this.getDetails(this.row)
+            }
+          })
+        }
+      } else {
+        this.$modal.notifyWarning("请填写明细信息");
       }
     },
     back() {
@@ -300,6 +354,11 @@ export default {
     },
     handlePreview(file) {
       console.log(file);
+      let link = document.createElement("a")
+      link.download = file.name
+      link.href = file.url
+      link.click()
+      window.URL.revokeObjectURL(link.href)
     },
     handleSuccess(response, file, fileList) {
       console.log(response)
@@ -312,7 +371,12 @@ export default {
       this.$message.warning(`当前限制选择1个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
     },
     beforeRemove(file, fileList) {
-      return this.$confirm(`确定移除 ${ file.name }?`);
+      if(this.sonPageStu == 'check') {
+        this.$modal.notifyWarning("详情态不允许删除");
+        return false
+      } else {
+        return this.$confirm(`确定移除 ${ file.name }?`);
+      }
     }
   }
 }

+ 45 - 39
src/views/purchase/equipmentData/index.vue

@@ -75,6 +75,17 @@
           </el-col>
 
           <el-col :span="1.5">
+            <el-form-item label="适用科室">
+                <el-input
+                  v-model.trim="params.departmentCode"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
             <el-form-item label="是否项目/厂家年度授权">
                 <el-select clearable v-model="params.isProjectOrFactoryEmpower" size="mini" style="width: 200px">
                   <el-option v-for="dict in dict.type.sys_equipment_type" :key="dict.value" :label="dict.label" :value="dict.value">
@@ -104,12 +115,19 @@
                 />
               </el-form-item>
           </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label-width="80px">
+              <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜 索</el-button>
+              <el-button size="mini" plain icon="el-icon-refresh" @click="resetList">重 置</el-button>
+            </el-form-item>
+          </el-col>
         </el-row>
 
-        <div style="position: absolute;top: 18px;right: 10px;">
-          <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
-          <el-button size="mini" plain @click="resetList">重置</el-button>
-        </div>
+        <!-- <div style="position: absolute;top: 18px;right: 10px;">
+          <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜 索</el-button>
+          <el-button size="mini" plain icon="el-icon-refresh" @click="resetList">重 置</el-button>
+        </div> -->
       </el-form>
 
       <div class="btn_grooup">
@@ -140,6 +158,14 @@
         ref="tables"
       >
         <ux-table-column
+          field="parameters"
+          title="参数"
+        >
+          <template slot-scope="scope">
+            <span v-html="showData(scope.row.parameters, params.parameters)"></span>
+          </template>
+        </ux-table-column>
+        <ux-table-column
           fixed="right"
           title="操作"
           align="center"
@@ -230,6 +256,7 @@ export default {
         commonName: '',
         registrationName: '',
         deviceCategory: '',
+        departmentCode: '',
         factoryName: '',
         model: '',
         referencePrice: '',
@@ -250,11 +277,12 @@ export default {
         { item: { key: "commonName", title: "通用名称" }, attr: {} },
         { item: { key: "registrationName", title: "注册名" }, attr: {} },
         { item: { key: "deviceCategory", title: "设备类别" }, attr: {} },
+        { item: { key: "departmentCode", title: "适用科室" }, attr: {} },
         { item: { key: "factoryName", title: "厂家名称" }, attr: {} },
         { item: { key: "model", title: "型号"}, attr: {} },
         { item: { key: "referencePrice", title: "参考价格" }, attr: {} },
         { item: { key: "isProjectOrFactoryEmpower", title: "是否项目/厂家年度授权" }, attr: {is: "el-dict-tag", dictName: "sys_equipment_type"} },
-        { item: { key: "parameters", title: "参数" }, attr: {} },
+        // { item: { key: "parameters", title: "参数" }, attr: {} },
         { item: { key: "remark", title: "备注"}, attr: {} },
       ].map(({ item, attr }) => ({
       attr,
@@ -273,6 +301,17 @@ export default {
     this.useQuery(this.params, this.pageInfo)
   },
   methods: {
+    showData(val, searchData) {
+        // 不区分大小写  const Reg = new RegExp(searchData, 'i');
+        // 全局替换  const Reg = new RegExp(searchData, 'g');
+        const Reg = new RegExp(searchData, 'ig');
+        if (val) {
+            // 注意 这里推荐使用正则占位符$& 不使用${searchData}  因为当这里使用正则表达式(i)不区分大小写时,如果你的文本是大写,搜索的关键字是小写,匹配结果会替换掉大写的文本
+            // const res = val.replace(Reg, `<span style="background-color: yellow;">${searchData}</span>`);
+            const res = val.replace(Reg, `<span style="background-color: yellow;">$&</span>`);
+            return res;
+        }
+    },
     useSee() {},
     useSelect() {},
     handleSelectionChange(selection) {
@@ -292,37 +331,6 @@ export default {
           this.pageInfo.total = res.total
         }
       })
-      // 获取搜索框和表格元素
-      const searchInput = this.params.parameters;
-      const table = document.querySelector('#data-table'); 
-      // 监听搜索框输入事件
-      // searchInput.addEventListener('input', () => {
-      // 获取搜索关键字
-      const keyword = searchInput; 
-      // 如果搜索关键字为空,移除所有高亮样式
-      if (!keyword) {
-        table.querySelectorAll('.highlight').forEach(el => {
-          el.classList.remove('highlight');
-        });
-        return;
-      } 
-      // 遍历表格中的每个单元格
-      table.querySelectorAll('td').forEach(td => {
-        console.log('td',td)
-        // 获取单元格文本内容
-        const cellText = td.innerHTML.trim().toLowerCase();
-
-        // 如果单元格内容包含搜索关键字,添加高亮样式
-        if (cellText.includes(keyword)) {
-          // 将匹配到的关键字替换为带有高亮样式的文本
-          const highlightedText = cellText.replace(new RegExp(keyword, 'gi'), match => `<span class="highlight">${match}</span>`);
-          td.innerHTML = highlightedText;
-        } else {
-          // 移除高亮样式
-          td.innerHTML = cellText;
-        }
-      });
-      // });
     },
     // 新增
     addDivision() {
@@ -396,6 +404,7 @@ export default {
         commonName: '',
         registrationName: '',
         deviceCategory: '',
+        departmentCode: '',
         factoryName: '',
         model: '',
         referencePrice: '',
@@ -460,7 +469,4 @@ export default {
   display: flex;
   justify-content: flex-end;
 }
-::v-deep .highlight {
-  background: yellow !important;
-}
 </style>