Browse Source

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

001295 1 year ago
parent
commit
88b26c2e3b

+ 10 - 1
src/api/WMS/historical-route.js

@@ -10,7 +10,16 @@ const queryAddress = (data) => {
   });
 }
 
+// 查询地址
+const getMerge = (data) => {
+  return request({
+    url: `/geocode/merge`,
+    method: "post",
+    data,
+  });
+}
+
 export default {
   queryAddress,
-
+  getMerge,
 }

+ 2 - 2
src/components/popover-select/components/MANUFACTURER_PARAM.js

@@ -45,11 +45,11 @@ export default [
     },
   },
   {
-    item: { key: "countryId", title: "产地ID", width: "auto" },
+    item: { key: "country", title: "产地ID", width: "auto" },
     attr: {
       type:'ComputedInput',
       formatter: (prop) => {
-        return prop.manufacturerOther != null ? prop.manufacturerOther.countryId : null;
+        return prop.manufacturerOther != null ? prop.manufacturerOther.country : null;
       },
     },
   },

+ 5 - 2
src/components/popover-tree-select/index.vue

@@ -103,8 +103,11 @@ export default {
   methods: {
     // open dialog
     async open() {
-      this.visible = true;
-      await this.useReset();
+      let { disabled } = this.$attrs;
+      if (!disabled) {
+        this.visible = true;
+        await this.useReset();
+      }
     },
     // hide dialog
     async hide() {

+ 10 - 2
src/components/super-ux-table/index.vue

@@ -258,6 +258,7 @@ export default {
     // 排序
     onSort(prop) {
       const { key, sort } = prop;
+      console.log(key, "key", sort, "sort");
       this.$nextTick(() => {
         this.$refs.superUxTable.sort(key, sort);
         this.$refs.superUxTable.doLayout();
@@ -425,6 +426,7 @@ export default {
         :title="item.title"
         :fixed="item.fixed ? 'left' : undefined"
         :width="item.width || 180"
+        :sortable="item.sortabled"
         resizable
         show-overflow
       >
@@ -444,11 +446,11 @@ export default {
               {{ item.title }}
             </span>
             <template>
-              <icon-sort
+              <!-- <icon-sort
                 v-if="item.sortabled"
                 v-model="item.sort"
                 @sort="onSort(item)"
-              ></icon-sort>
+              ></icon-sort> -->
               <icon-freeze
                 v-if="item.fixedabled"
                 v-model="item.fixed"
@@ -599,6 +601,12 @@ export default {
   &:hover .icon-hide {
     display: inline-block;
   }
+  .elx-cell--sort {
+    display: none;
+  }
+  &:hover .elx-cell--sort {
+    display: inline-block;
+  }
 }
 
 ::v-deep.uxbeautifyTableClass

+ 669 - 0
src/views/WMS/historical-route/index copy.vue

@@ -0,0 +1,669 @@
+<template>
+  <div id="print">
+    <el-tabs v-model="activeName" type="border-card" stretch @tab-click="handleClick">
+      <el-tab-pane label="温湿度信息" name="first">
+        <div id="body" :style="{width: width - 300 + 'px'}">
+          <!-- 单据信息 -->
+          <el-timeline>
+            <el-timeline>
+              <el-descriptions>
+                <el-descriptions-item label="订单编号">{{this.basicData.billCode}}</el-descriptions-item>
+                <el-descriptions-item label="车牌号">{{this.basicData.plateNumber}}</el-descriptions-item>
+              </el-descriptions>
+              <el-descriptions>
+                <el-descriptions-item label="开始时间">{{this.basicData.startTime}}</el-descriptions-item>
+                <el-descriptions-item label="结束时间">{{this.basicData.endTime}}</el-descriptions-item>
+              </el-descriptions>
+              <!--导出按钮-->
+              <el-button class="OutCss" v-print="'#print'" type="primary">导出</el-button>
+            </el-timeline>
+          </el-timeline>
+          <el-timeline>
+            <!-- 数据表 -->
+            <h2>订单温湿度列表</h2>
+            <el-table :data="tableData2" stripe border style="width: 97%">
+              <el-table-column prop="measuringPointName" label="车牌号或保温箱" align="center" min-width="150" />
+              <el-table-column prop="measuringPointAddr" label="探头" align="center" min-width="90" />
+              <el-table-column prop="temperature" label="温度" align="center" min-width="80" />
+              <el-table-column prop="hisDate" label="时间点" align="center" min-width="200" />
+              <el-table-column prop="measuringPointName1" label="车牌号或保温箱" align="center" min-width="150" />
+              <el-table-column prop="measuringPointAddr1" label="探头" align="center" min-width="90" />
+              <el-table-column prop="temperature1" label="温度" align="center" min-width="80" />
+              <el-table-column prop="hisDate1" label="时间点" align="center" min-width="200" />
+              <!-- <el-table-column prop="address" label="地址" width="400" /> -->
+            </el-table>
+          </el-timeline>
+        </div>
+        <br>
+        <div id="body" :style="{width: width - 300 + 'px'}">
+          <el-timeline>
+            <h2>订单温度折线图</h2>
+            <div class="echart" id="mychart" :style="myChartStyle"></div>
+          </el-timeline>
+        </div>
+      </el-tab-pane>
+      <el-tab-pane label="运输信息" name="second">
+        <div id="body" :style="{width: width - 300 + 'px'}">
+          <!-- 单据信息 -->
+          <el-timeline>
+            <el-timeline>
+              <el-descriptions>
+                <el-descriptions-item label="订单编号">{{this.basicData.billCode}}</el-descriptions-item>
+                <el-descriptions-item label="车牌号">{{this.basicData.plateNumber}}</el-descriptions-item>
+              </el-descriptions>
+              <el-descriptions>
+                <el-descriptions-item label="开始时间">{{this.basicData.startTime}}</el-descriptions-item>
+                <el-descriptions-item label="结束时间">{{this.basicData.endTime}}</el-descriptions-item>
+              </el-descriptions>
+            </el-timeline>
+          </el-timeline>
+
+          <!-- 地图 -->
+          <div id="container"></div>
+
+          <!-- 订单温湿度列表 -->
+          <el-timeline>
+            <br>
+            <h2>订单温湿度列表</h2>
+            <el-table :data="tableData1" height="200" style="width: 97%">
+              <el-table-column prop="maxTemperature" label="温度最大值" align="center" min-width="100" />
+              <el-table-column prop="avgTemperature" label="温度平均值" align="center" min-width="100" />
+              <el-table-column prop="minTemperature" label="温度最小值" align="center" min-width="100" />
+              <el-table-column prop="maxHumidity" label="湿度最大值" align="center" min-width="100" />
+              <el-table-column prop="avgHumidity" label="湿度平均值" align="center" min-width="100" />
+              <el-table-column prop="minHumidity" label="湿度最小值" align="center" min-width="100" />
+              <el-table-column prop="startTime" label="开始时间" align="center" min-width="250" />
+              <el-table-column prop="endTime" label="结束时间" align="center" min-width="250" />
+            </el-table>
+          </el-timeline>
+        </div>
+      </el-tab-pane>
+
+    </el-tabs>
+  </div>
+</template>
+
+<script>
+  import AMapLoader from '@amap/amap-jsapi-loader'
+  window._AMapSecurityConfig = {
+    securityJsCode: '8e23904a0cf421675353f31fd1fc213c'
+  }
+  import historyApi from '@/api/WMS/historical-route'
+  import * as echarts from "echarts";
+
+  export default {
+    data() {
+      return {
+        width: document.documentElement.clientWidth - 10,
+        param: this.$route.query,
+        basicData: {
+          billCode: "",
+          plateNumber: "",
+          startTime: "",
+          endTime: ""
+        },
+        //标签页
+        activeName: 'first',
+        //地图对象
+        map: null,
+        //图表
+        myChart: {},
+        xData: [], //横坐标
+        temperatureData: [], //温度数据
+        humidityData: [], //湿度数据
+        myChartStyle: {
+          float: "left",
+          width: "100%",
+          height: "400px"
+        }, //图表样式
+        //运输信息表单数据
+        tableData1: [],
+        //运输信息表单数据准备
+        modelData1: [{
+          maxTemperature: "",
+          avgTemperature: "",
+          minTemperature: "",
+          maxHumidity: "",
+          avgHumidity: "",
+          minHumidity: "",
+          startTime: "",
+          endTime: ""
+        }],
+        //温湿度信息表单数据
+        tableData2: [],
+        resData: [],
+        carMessage: {
+          billCode: "",
+          plateNumber: "",
+          boxCode: [],
+          startTime: "",
+          endTime: ""
+        },
+        option: {},
+        //表单各值
+        maxT: 0,
+        maxH: 0,
+        minT: 0,
+        minH: 0,
+        aggT: 0,
+        aggH: 0,
+        avgT: 0,
+        avgH: 0
+      };
+    },
+    mounted() {
+      //DOM初始化完成进行地图初始化
+      this.initMap();
+    },
+    created() {
+      //把传参中的保温箱转换成数组
+      this.carMessage = this.$route.query;
+      if (this.carMessage.boxCode != null) {
+        this.carMessage.boxCode = this.$route.query.boxCode.split(',');
+      }
+      //当结束时间为空时,默认为当前时间
+      if (this.carMessage.endTime == '' || this.carMessage.endTime == null) {
+        this.carMessage.endTime = this.formatDateTime(this.getCurrentTime(), 'yyyy-MM-dd HH:mm:ss');
+      }
+      console.log(this.carMessage, 'this.carMessage')
+      this.handleGeocodeRepo(this.carMessage);
+    },
+    methods: {
+      //通过传参查询数据
+      handleGeocodeRepo(data) {
+        historyApi.queryAddress(data).then(res => {
+          console.log(res, 'res-----------------');
+          if (res.code == 200) {
+            //定义路线数组
+            let path = [];
+            //筛选含经纬度的数组
+            let latitudeLongitude = [];
+            let count = 0;
+            for (let i = 0; i < res.data.length; i++) {
+              if (res.data[i].gpsLatitude != 0 && res.data[i].gpsLongitude != 0) {
+                latitudeLongitude[count++] = res.data[i];
+              }
+            }
+            //定义整数递增值,并且绘制初始路径
+            if (latitudeLongitude.length >= 14) {
+              this.increment = Math.trunc(latitudeLongitude.length / 14);
+              for (let i = 0; i < latitudeLongitude.length; i = i + this.increment) {
+                path.push([latitudeLongitude[i].gpsLongitude, latitudeLongitude[i].gpsLatitude]);
+              }
+            } else {
+              for (let i = 0; i < latitudeLongitude.length; i++) {
+                path.push([latitudeLongitude[i].gpsLongitude, latitudeLongitude[i].gpsLatitude]);
+              }
+            }
+            //计算各值
+            this.calculate(res.data);
+            //对订单温湿度列表进行赋值
+            this.assignmentTable1(res.data);
+            //提取探头种类数量
+            let probeSum = [];
+            let probe = [];
+            for (let i = 0; i < latitudeLongitude.length; i++) {
+              probeSum[i] = latitudeLongitude[i].measuringPointAddr;
+            }
+            probe = Array.from(new Set(probeSum));
+            //车辆温度数组
+            let c, d;
+            this.initEcharts();
+            for (let i = 0; i < probe.length; i++) {
+              let carForm = {
+                name: this.carMessage.plateNumber + '/' + probe[i],
+                data: [],
+                type: "line",
+                smooth: true,
+                showSymbol: false,
+                label: {
+                  show: true,
+                  position: "top",
+                  textStyle: {
+                    fontSize: 12
+                  }
+                },
+                markArea: {
+                  itemStyle: {
+                    color: 'rgba(255, 0, 0)'
+                  },
+                  data: [
+                    [{
+                        name: '冷藏温度警戒线',
+                        yAxis: '8'
+                      },
+                      {
+                        yAxis: '8.1'
+                      }
+                    ],
+                    [{
+                        name: '冷藏温度警戒线',
+                        yAxis: '2'
+                      },
+                      {
+                        yAxis: '1.9'
+                      }
+                    ],
+                    [{
+                        name: '冷冻温度警戒线',
+                        yAxis: '-15'
+                      },
+                      {
+                        yAxis: '-14.9'
+                      }
+                    ],
+                    [{
+                        name: '冷冻温度警戒线',
+                        yAxis: '-25'
+                      },
+                      {
+                        yAxis: '-25.1'
+                      }
+                    ]
+                  ]
+                }
+              }
+              // count = 0;
+              for (let j = 0; j < latitudeLongitude.length; j++) {
+                if (carForm.name.indexOf(latitudeLongitude[j].measuringPointAddr) != -1) {
+                  c = latitudeLongitude[j].hisDate;
+                  d = latitudeLongitude[j].temperature;
+                  carForm.data.push([c, d]);
+                }
+              }
+              this.option.series.push(carForm);
+              this.option.legend.data.push(carForm.name);
+            }
+            //筛选保温箱的数组
+            if (this.carMessage.boxCode != null) {
+              let e, f;
+              for (let i = 0; i < this.carMessage.boxCode.length; i++) {
+                let boxForm = {
+                  name: this.carMessage.boxCode[i],
+                  data: [],
+                  type: "line",
+                  smooth: true,
+                  showSymbol: false,
+                  label: {
+                    show: true,
+                    position: "top",
+                    textStyle: {
+                      fontSize: 12
+                    }
+                  },
+                  markArea: {
+                    itemStyle: {
+                      color: 'rgba(255, 0, 0)'
+                    },
+                    data: [
+                      [{
+                          name: '冷藏温度警戒线',
+                          yAxis: '8'
+                        },
+                        {
+                          yAxis: '8.1'
+                        }
+                      ],
+                      [{
+                          name: '冷藏温度警戒线',
+                          yAxis: '2'
+                        },
+                        {
+                          yAxis: '1.9'
+                        }
+                      ],
+                      [{
+                          name: '冷冻温度警戒线',
+                          yAxis: '-15'
+                        },
+                        {
+                          yAxis: '-14.9'
+                        }
+                      ],
+                      [{
+                          name: '冷冻温度警戒线',
+                          yAxis: '-25'
+                        },
+                        {
+                          yAxis: '-25.1'
+                        }
+                      ]
+                    ]
+                  }
+                }
+                // count = 0;
+                for (let j = 0; j < res.data.length; j++) {
+                  if (boxForm.name == res.data[j].measuringPointName) {
+                    e = res.data[j].hisDate;
+                    f = res.data[j].temperature;
+                    boxForm.data.push([e, f]);
+                  }
+                }
+                this.option.series.push(boxForm);
+                this.option.legend.data.push(boxForm.name);
+              }
+            }
+            //如果车辆温度数组为空,则其它数组前移一位
+            for (let i = 1;;) {
+              if (this.option.series[0].data.length == 0) {
+                for (let j = 0; j < this.option.series.length - i; j++) {
+                  this.option.series[j] = this.option.series[j + 1];
+                  this.option.legend.data[j] = this.option.legend.data[j + 1];
+                }
+                this.option.series[this.option.series.length - i] = '';
+                this.option.legend.data[this.option.series.length - i++] = '';
+              }
+              if (this.option.series[0].data.length != 0) {
+                break;
+              }
+            }
+            this.windowSize();
+            //对基础数据进行赋值
+            this.basicData.billCode = this.carMessage.billCode;
+            this.basicData.plateNumber = this.carMessage.plateNumber;
+            this.basicData.startTime = this.xData[0];
+            this.basicData.endTime = this.xData[this.xData.length - 1];
+            //基本地图加载
+            this.loadMap(path);
+          }
+        })
+      },
+      handleClick(tab, event) {
+        console.log(tab, event);
+        this.handleGeocodeRepo(this.carMessage);
+      },
+      //地图初始化
+      initMap() {
+        AMapLoader.load({
+            //申请好的Web端开发者Key,首次调用 load 时必填
+            key: 'f953210b2d5276ffbf5a2bc01ef80f55',
+            //指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
+            version: '2.0',
+            //需要使用的的插件列表,如比例尺'AMap.Scale'等
+            plugins: ['']
+          })
+          .then(AMap => {
+            this.map = new AMap.Map('container', {
+              //设置地图容器id
+              //是否为3D地图模式
+              viewMode: '3D',
+              //初始化地图级别
+              zoom: 13,
+              //初始化地图中心点位置
+              center: [112.976376, 28.195318]
+            })
+          })
+          .catch(e => {
+            console.log(e)
+          })
+      },
+      //基本地图加载
+      loadMap(path) {
+        var map, route;
+        map = new AMap.Map("container", {
+          resizeEnable: true
+        });
+        map.plugin("AMap.DragRoute", function () {
+          //构造拖拽导航类
+          route = new AMap.DragRoute(map, path, AMap.DrivingPolicy.LEAST_FEE);
+          //查询导航路径并开启拖拽导航
+          route.search();
+        });
+      },
+      //图表属性赋值
+      initEcharts() {
+        this.option = {
+          tooltip: {
+            trigger: 'axis',
+            axisPointer: {
+              type: 'cross'
+            }
+          },
+          grid: {
+            x: 22,
+            y: 30,
+            x2: 20,
+            y2: 18,
+            borderWidth: 1,
+          },
+          toolbox: {
+            //保存图
+            // show: true,
+            // feature: {
+            //   saveAsImage: {}
+            // }
+          },
+          xAxis: {
+            type: 'category',
+            boundaryGap: false,
+            data: this.xData
+          },
+          //图例
+          legend: {
+            data: [],
+            // bottom: "0%"
+          },
+          yAxis: {
+            name: '温度',
+            // Y轴最大值
+            max: 10,
+            // Y轴最大值
+            min: -30,
+            splitNumber: 2,
+            // 间隔值
+            // interval: 3
+          },
+          //加上dataZoom可实现缩放
+          dataZoom: [{
+              //x轴
+              type: 'slider',
+              xAxisIndex: 0,
+
+            },
+            {
+              //x轴
+              type: 'inside',
+              xAxisIndex: 0,
+              /**
+               * 如何触发缩放。可选值为:true:表示不按任何功能键,鼠标滚轮能触发缩放。false:表示鼠标滚轮不能触发缩放。
+               * 'shift':表示按住 shift和鼠标滚轮能触发缩放。
+               * 'ctrl':表示按住 ctrl 和鼠标滚轮能触发缩放。'alt':表示按住 alt 和鼠标滚轮能触发缩放。
+               */
+              zoomOnMouseWheel: 'true',
+            },
+          ],
+          /**
+           * series中的参数:
+           * smooth:是否曲线,showSymbol:是否显示数据和数据点
+           */
+          series: [],
+        }
+      },
+      //渲染图表
+      windowSize() {
+        this.myChart = echarts.init(document.getElementById("mychart"));
+        this.myChart.setOption(this.option);
+        window.addEventListener("resize", () => {
+          this.myChart.resize();
+        });
+      },
+      //计算各值
+      calculate(array) {
+        //数组中的温度湿度的字符串转成浮点
+        for (let i = 0; i < array.length; i++) {
+          array[i].temperature = parseFloat(array[i].temperature);
+          array[i].humidity = parseFloat(array[i].humidity);
+        }
+        //定义初始值
+        this.maxT = array[0].temperature;
+        this.maxH = array[0].humidity;
+        this.minT = array[0].temperature;
+        this.minH = array[0].humidity;
+        this.aggT = 0;
+        this.aggH = 0;
+        let x = [];
+        for (let i = 0; i < array.length; i++) {
+          //对X轴的时间进行赋值
+          x[i] = array[i].hisDate;
+          //对Y轴的温度进行赋值
+          // this.temperatureData[i] = array[i].temperature;
+          //温度最大值
+          if (array[i].temperature > this.maxT) {
+            this.maxT = array[i].temperature;
+          }
+          //湿度最大值
+          if (array[i].humidity > this.maxH) {
+            this.maxH = array[i].humidity;
+          }
+          //温度最小值
+          if (array[i].temperature < this.minT) {
+            this.minT = array[i].temperature
+          }
+          //湿度最小值
+          if (array[i].humidity < this.minH) {
+            this.minH = array[i].humidity
+          }
+          //温湿度合计值
+          this.aggT += array[i].temperature;
+          this.aggH += array[i].humidity;
+        }
+        //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;
+      },
+      //对订单温湿度列表进行赋值
+      assignmentTable1(array) {
+        this.modelData1[0].maxTemperature = this.maxT;
+        this.modelData1[0].maxHumidity = this.maxH;
+        this.modelData1[0].minTemperature = this.minT;
+        this.modelData1[0].minHumidity = this.minH;
+        this.modelData1[0].avgTemperature = this.avgT.toFixed(2);
+        this.modelData1[0].avgHumidity = this.avgH.toFixed(1);
+        this.modelData1[0].startTime = array[0].hisDate;
+        this.modelData1[0].endTime = array[array.length - 1].hisDate;
+        this.tableData1 = this.modelData1;
+        let median = (array.length / 2).toFixed(0);
+        let table = []
+        for (let i = 0; i < median; i++) {
+          table[i] = {
+            measuringPointName: '',
+            measuringPointAddr: '',
+            temperature: '',
+            hisDate: '',
+            measuringPointName1: '',
+            measuringPointAddr1: '',
+            temperature1: '',
+            hisDate1: ''
+          }
+        }
+        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;
+            table[i].measuringPointAddr = array[j].measuringPointAddr;
+            table[i].temperature = array[j].temperature;
+            table[i].hisDate = array[j].hisDate;
+            table[i].measuringPointName1 = array[z].measuringPointName;
+            table[i].measuringPointAddr1 = array[z].measuringPointAddr;
+            table[i].temperature1 = array[z].temperature;
+            table[i].hisDate1 = array[z].hisDate;
+          }
+        } else {
+          for (let i = 0, j = 0, z = 1; i < median; i++, j = j + 2, z = z + 2) {
+            table[i].measuringPointName = array[j].measuringPointName;
+            table[i].measuringPointAddr = array[j].measuringPointAddr;
+            table[i].temperature = array[j].temperature;
+            table[i].hisDate = array[j].hisDate;
+            if (i != median - 1) {
+              table[i].measuringPointName1 = array[z].measuringPointName;
+              table[i].measuringPointAddr1 = array[z].measuringPointAddr;
+              table[i].temperature1 = array[z].temperature;
+              table[i].hisDate1 = array[z].hisDate;
+            }
+          }
+        }
+        this.tableData2 = table;
+      },
+      //获取当前时间
+      getCurrentTime() {
+        let date = new Date();
+        return date;
+      },
+      //日期名称格式化
+      formatDateTime(date, format) {
+        const o = {
+          'M+': date.getMonth() + 1, // 月份
+          'd+': date.getDate(), // 日
+          'h+': date.getHours() % 12 === 0 ? 12 : date.getHours() % 12, // 小时
+          'H+': date.getHours(), // 小时
+          'm+': date.getMinutes(), // 分
+          's+': date.getSeconds(), // 秒
+          'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+          S: date.getMilliseconds(), // 毫秒
+          a: date.getHours() < 12 ? '上午' : '下午', // 上午/下午
+          A: date.getHours() < 12 ? 'AM' : 'PM', // AM/PM
+        };
+        if (/(y+)/.test(format)) {
+          format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+        }
+        for (let k in o) {
+          if (new RegExp('(' + k + ')').test(format)) {
+            format = format.replace(
+              RegExp.$1,
+              RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
+            );
+          }
+        }
+        return format;
+      },
+    }
+  };
+
+</script>
+
+<style scoped>
+  #container {
+    padding: 100px;
+    margin: 10px;
+    width: 1000;
+    height: 800px;
+  }
+
+  .OutCss {
+    float: right;
+  }
+
+  #body {
+    /* padding: 0px 200px 0px 200px; */
+    margin: 0 auto;
+
+  }
+
+  @media print {
+    @page {
+      margin: 0;
+      size: portrait;
+      /* size: A4 landscape; size: landscape横向,size: portrait;纵向,如果不设置,则页面有横向和纵向的选择框 */
+    }
+
+    #body {
+      /* margin: 20cm; */
+      margin: 0 auto;
+      /* 打印时缩放,防止页面溢出 */
+      zoom: 0.6;
+    }
+  }
+
+</style>

+ 207 - 73
src/views/WMS/historical-route/index.vue

@@ -3,35 +3,61 @@
     <el-tabs v-model="activeName" type="border-card" stretch @tab-click="handleClick">
       <el-tab-pane label="温湿度信息" name="first">
         <div id="body" :style="{width: width - 300 + 'px'}">
-          <!-- 单据信息 -->
+          <!--导出按钮-->
+          <el-button class="OutCss" v-print="'#print'" type="primary">导出</el-button>
           <el-timeline>
-            <el-timeline>
+            <!-- 数据表 -->
+            <h2>车辆温湿度列表</h2>
+            <div v-for="(item, index) in dataCar">
+              <h2>
+                ============================================================================================================================
+              </h2>
               <el-descriptions>
-                <el-descriptions-item label="订单编号">{{this.basicData.billCode}}</el-descriptions-item>
-                <el-descriptions-item label="车牌号">{{this.basicData.plateNumber}}</el-descriptions-item>
+                <el-descriptions-item label="订单编号">{{item[0].billCode}}</el-descriptions-item>
+                <el-descriptions-item label="车牌号">{{item[0].measuringPointName}}</el-descriptions-item>
+                <el-descriptions-item label="探头">{{item[0].measuringPointAddr}}</el-descriptions-item>
+                <el-descriptions-item label="开始时间">{{item[0].hisDate}}</el-descriptions-item>
+                <el-descriptions-item label="结束时间">{{item[item.length - 1].end}}</el-descriptions-item>
               </el-descriptions>
+              <el-table :data="item" stripe border style="width: 97%">
+                <el-table-column prop="temperature" label="温度" align="center" min-width="80" />
+                <el-table-column prop="hisDate" label="时间点" align="center" min-width="200" />
+                <el-table-column prop="temperature1" label="温度" align="center" min-width="80" />
+                <el-table-column prop="hisDate1" label="时间点" align="center" min-width="200" />
+                <el-table-column prop="temperature2" label="温度" align="center" min-width="80" />
+                <el-table-column prop="hisDate2" label="时间点" align="center" min-width="200" />
+                <el-table-column prop="temperature3" label="温度" align="center" min-width="80" />
+                <el-table-column prop="hisDate3" label="时间点" align="center" min-width="200" />
+                <el-table-column prop="temperature4" label="温度" align="center" min-width="80" />
+                <el-table-column prop="hisDate4" label="时间点" align="center" min-width="200" />
+              </el-table>
+              <template></template>
+            </div>
+            <h2>保温箱温湿度列表</h2>
+            <div v-for="(item, index) in dataBox">
+              <h2>
+                ============================================================================================================================
+              </h2>
               <el-descriptions>
-                <el-descriptions-item label="开始时间">{{this.basicData.startTime}}</el-descriptions-item>
-                <el-descriptions-item label="结束时间">{{this.basicData.endTime}}</el-descriptions-item>
+                <el-descriptions-item label="订单编号">{{item[0].billCode}}</el-descriptions-item>
+                <el-descriptions-item label="保温箱号">{{item[0].measuringPointName}}</el-descriptions-item>
+                <el-descriptions-item label="探头">{{item[0].measuringPointAddr}}</el-descriptions-item>
+                <el-descriptions-item label="开始时间">{{item[0].hisDate}}</el-descriptions-item>
+                <el-descriptions-item label="结束时间">{{item[item.length - 1].end}}</el-descriptions-item>
               </el-descriptions>
-              <!--导出按钮-->
-              <el-button class="OutCss" v-print="'#print'" type="primary">导出</el-button>
-            </el-timeline>
-          </el-timeline>
-          <el-timeline>
-            <!-- 数据表 -->
-            <h2>订单温湿度列表</h2>
-            <el-table :data="tableData2" stripe border style="width: 97%">
-              <el-table-column prop="measuringPointName" label="车牌号或保温箱" align="center" min-width="150" />
-              <el-table-column prop="measuringPointAddr" label="探头" align="center" min-width="90" />
-              <el-table-column prop="temperature" label="温度" align="center" min-width="80" />
-              <el-table-column prop="hisDate" label="时间点" align="center" min-width="200" />
-              <el-table-column prop="measuringPointName1" label="车牌号或保温箱" align="center" min-width="150" />
-              <el-table-column prop="measuringPointAddr1" label="探头" align="center" min-width="90" />
-              <el-table-column prop="temperature1" label="温度" align="center" min-width="80" />
-              <el-table-column prop="hisDate1" label="时间点" align="center" min-width="200" />
-              <!-- <el-table-column prop="address" label="地址" width="400" /> -->
-            </el-table>
+              <el-table :data="item" stripe border style="width: 97%">
+                <el-table-column prop="temperature" label="温度" align="center" min-width="80" />
+                <el-table-column prop="hisDate" label="时间点" align="center" min-width="200" />
+                <el-table-column prop="temperature1" label="温度" align="center" min-width="80" />
+                <el-table-column prop="hisDate1" label="时间点" align="center" min-width="200" />
+                <el-table-column prop="temperature2" label="温度" align="center" min-width="80" />
+                <el-table-column prop="hisDate2" label="时间点" align="center" min-width="200" />
+                <el-table-column prop="temperature3" label="温度" align="center" min-width="80" />
+                <el-table-column prop="hisDate3" label="时间点" align="center" min-width="200" />
+                <el-table-column prop="temperature4" label="温度" align="center" min-width="80" />
+                <el-table-column prop="hisDate4" label="时间点" align="center" min-width="200" />
+              </el-table>
+            </div>
           </el-timeline>
         </div>
         <br>
@@ -148,7 +174,10 @@
         aggT: 0,
         aggH: 0,
         avgT: 0,
-        avgH: 0
+        avgH: 0,
+        dataCar: [],
+        dataBox: [],
+        dataMerge: [],
       };
     },
     mounted() {
@@ -161,11 +190,9 @@
       if (this.carMessage.boxCode != null) {
         this.carMessage.boxCode = this.$route.query.boxCode.split(',');
       }
-      //当结束时间为空时,默认为当前时间
-      if (this.carMessage.endTime == '' || this.carMessage.endTime == null) {
-        this.carMessage.endTime = this.formatDateTime(this.getCurrentTime(), 'yyyy-MM-dd HH:mm:ss');
-      }
       console.log(this.carMessage, 'this.carMessage')
+      // 所有数据的总集合
+      this.merge(this.carMessage);
       this.handleGeocodeRepo(this.carMessage);
     },
     methods: {
@@ -174,14 +201,17 @@
         historyApi.queryAddress(data).then(res => {
           console.log(res, 'res-----------------');
           if (res.code == 200) {
+            // 表格中分列展示数据
+            this.listSplitting(res.data.car, res.data.box);
+            console.log(this.dataCar, 'this.dataCar');
             //定义路线数组
             let path = [];
             //筛选含经纬度的数组
             let latitudeLongitude = [];
             let count = 0;
-            for (let i = 0; i < res.data.length; i++) {
-              if (res.data[i].gpsLatitude != 0 && res.data[i].gpsLongitude != 0) {
-                latitudeLongitude[count++] = res.data[i];
+            for (let i = 0; i < this.dataMerge.length; i++) {
+              if (this.dataMerge[i].gpsLatitude != 0 && this.dataMerge[i].gpsLongitude != 0) {
+                latitudeLongitude[count++] = this.dataMerge[i];
               }
             }
             //定义整数递增值,并且绘制初始路径
@@ -196,9 +226,9 @@
               }
             }
             //计算各值
-            this.calculate(res.data);
+            this.calculate(this.dataMerge);
             //对订单温湿度列表进行赋值
-            this.assignmentTable1(res.data);
+            this.assignmentTable1(this.dataMerge);
             //提取探头种类数量
             let probeSum = [];
             let probe = [];
@@ -332,10 +362,10 @@
                   }
                 }
                 // count = 0;
-                for (let j = 0; j < res.data.length; j++) {
-                  if (boxForm.name == res.data[j].measuringPointName) {
-                    e = res.data[j].hisDate;
-                    f = res.data[j].temperature;
+                for (let j = 0; j < this.dataMerge.length; j++) {
+                  if (boxForm.name == this.dataMerge[j].measuringPointName) {
+                    e = this.dataMerge[j].hisDate;
+                    f = this.dataMerge[j].temperature;
                     boxForm.data.push([e, f]);
                   }
                 }
@@ -555,46 +585,150 @@
         this.modelData1[0].startTime = array[0].hisDate;
         this.modelData1[0].endTime = array[array.length - 1].hisDate;
         this.tableData1 = this.modelData1;
-        let median = (array.length / 2).toFixed(0);
-        let table = []
-        for (let i = 0; i < median; i++) {
-          table[i] = {
-            measuringPointName: '',
-            measuringPointAddr: '',
-            temperature: '',
-            hisDate: '',
-            measuringPointName1: '',
-            measuringPointAddr1: '',
-            temperature1: '',
-            hisDate1: ''
+        //   let median = (array.length / 2).toFixed(0);
+        //   let table = []
+        //   for (let i = 0; i < median; i++) {
+        //     table[i] = {
+        //       measuringPointName: '',
+        //       measuringPointAddr: '',
+        //       temperature: '',
+        //       hisDate: '',
+        //       measuringPointName1: '',
+        //       measuringPointAddr1: '',
+        //       temperature1: '',
+        //       hisDate1: ''
+        //     }
+        //   }
+        //   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;
+        //       table[i].measuringPointAddr = array[j].measuringPointAddr;
+        //       table[i].temperature = array[j].temperature;
+        //       table[i].hisDate = array[j].hisDate;
+        //       table[i].measuringPointName1 = array[z].measuringPointName;
+        //       table[i].measuringPointAddr1 = array[z].measuringPointAddr;
+        //       table[i].temperature1 = array[z].temperature;
+        //       table[i].hisDate1 = array[z].hisDate;
+        //     }
+        //   } else {
+        //     for (let i = 0, j = 0, z = 1; i < median; i++, j = j + 2, z = z + 2) {
+        //       table[i].measuringPointName = array[j].measuringPointName;
+        //       table[i].measuringPointAddr = array[j].measuringPointAddr;
+        //       table[i].temperature = array[j].temperature;
+        //       table[i].hisDate = array[j].hisDate;
+        //       if (i != median - 1) {
+        //         table[i].measuringPointName1 = array[z].measuringPointName;
+        //         table[i].measuringPointAddr1 = array[z].measuringPointAddr;
+        //         table[i].temperature1 = array[z].temperature;
+        //         table[i].hisDate1 = array[z].hisDate;
+        //       }
+        //     }
+        //   }
+        //   this.tableData2 = table;
+      },
+      merge(data) {
+        historyApi.getMerge(data).then(res => {
+          if (res.code == 200) {
+            this.dataMerge = res.data;
+            console.log(this.dataMerge, 'dataMerge')
           }
-        }
-        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;
-            table[i].measuringPointAddr = array[j].measuringPointAddr;
-            table[i].temperature = array[j].temperature;
-            table[i].hisDate = array[j].hisDate;
-            table[i].measuringPointName1 = array[z].measuringPointName;
-            table[i].measuringPointAddr1 = array[z].measuringPointAddr;
-            table[i].temperature1 = array[z].temperature;
-            table[i].hisDate1 = array[z].hisDate;
+        })
+      },
+      // 表格数据分列展示
+      listSplitting(dataCar, dataBox) {
+        let differenceValueCar;
+        let arr2 = [];
+        for (let i = 0; i < dataCar.length; i++) {
+          let arr3 = [];
+          // 向上取整差值
+          differenceValueCar = Math.ceil(dataCar[i].length / 5);
+          for (let j = 0; j < dataCar[i].length; j++) {
+            if (j == differenceValueCar) {
+              for (let z = 0; z < differenceValueCar; z++) {
+                dataCar[i][z].temperature1 = dataCar[i][j + z].temperature;
+                dataCar[i][z].hisDate1 = dataCar[i][j + z].hisDate;
+              }
+            }
+            if (j == differenceValueCar * 2) {
+              for (let z = 0; z < differenceValueCar; z++) {
+                dataCar[i][z].temperature2 = dataCar[i][j + z].temperature;
+                dataCar[i][z].hisDate2 = dataCar[i][j + z].hisDate;
+              }
+            }
+            if (j == differenceValueCar * 3) {
+              for (let z = 0; z < differenceValueCar; z++) {
+                dataCar[i][z].temperature3 = dataCar[i][j + z].temperature;
+                dataCar[i][z].hisDate3 = dataCar[i][j + z].hisDate;
+              }
+            }
+            if (j == differenceValueCar * 4) {
+              for (let z = 0; z < differenceValueCar; z++) {
+                if (j + z < dataCar[i].length) {
+                  dataCar[i][z].temperature4 = dataCar[i][j + z].temperature;
+                  dataCar[i][z].hisDate4 = dataCar[i][j + z].hisDate;
+                }
+              }
+            }
+            if (j < differenceValueCar) {
+              arr3.push(dataCar[i][j]);
+              console.log(arr3, 'arr3')
+            }
           }
-        } else {
-          for (let i = 0, j = 0, z = 1; i < median; i++, j = j + 2, z = z + 2) {
-            table[i].measuringPointName = array[j].measuringPointName;
-            table[i].measuringPointAddr = array[j].measuringPointAddr;
-            table[i].temperature = array[j].temperature;
-            table[i].hisDate = array[j].hisDate;
-            if (i != median - 1) {
-              table[i].measuringPointName1 = array[z].measuringPointName;
-              table[i].measuringPointAddr1 = array[z].measuringPointAddr;
-              table[i].temperature1 = array[z].temperature;
-              table[i].hisDate1 = array[z].hisDate;
+          arr2.push(arr3);
+          this.queryEnd(arr2[i], differenceValueCar);
+        }
+        this.dataCar = arr2;
+        let differenceValueBox;
+        let arr = [];
+        for (let i = 0; i < dataBox.length; i++) {
+          let arr1 = [];
+          // 向上取整差值
+          differenceValueBox = Math.ceil(dataBox[i].length / 5);
+          for (let j = 0; j < dataBox[i].length; j++) {
+            if (j == differenceValueBox) {
+              for (let z = 0; z < differenceValueBox; z++) {
+                dataBox[i][z].temperature1 = dataBox[i][j + z].temperature;
+                dataBox[i][z].hisDate1 = dataBox[i][j + z].hisDate;
+              }
             }
+            if (j == differenceValueBox * 2) {
+              for (let z = 0; z < differenceValueBox; z++) {
+                dataBox[i][z].temperature2 = dataBox[i][j + z].temperature;
+                dataBox[i][z].hisDate2 = dataBox[i][j + z].hisDate;
+              }
+            }
+            if (j == differenceValueBox * 3) {
+              for (let z = 0; z < differenceValueBox; z++) {
+                dataBox[i][z].temperature3 = dataBox[i][j + z].temperature;
+                dataBox[i][z].hisDate3 = dataBox[i][j + z].hisDate;
+              }
+            }
+            if (j == differenceValueBox * 4) {
+              for (let z = 0; z < differenceValueBox; z++) {
+                if (j + z < dataBox[i].length) {
+                  dataBox[i][z].temperature4 = dataBox[i][j + z].temperature;
+                  dataBox[i][z].hisDate4 = dataBox[i][j + z].hisDate;
+                }
+              }
+            }
+            if (j < differenceValueBox) {
+              arr1.push(dataBox[i][j]);
+            }
+          }
+          arr.push(arr1);
+          console.log(arr, 'arr')
+          this.queryEnd(arr[i], differenceValueBox);
+        }
+        this.dataBox = arr;
+      },
+      // 查找结束时间
+      queryEnd(arr, differenceValue) {
+        for (let j = differenceValue - 1; j >= 0; j--) {
+          if (arr[j].hisDate4 != null && arr[j].hisDate4 != '' && arr[j].hisDate4 != undefined) {
+            arr[differenceValue - 1].end = arr[j].hisDate4;
+            return;
           }
         }
-        this.tableData2 = table;
       },
       //获取当前时间
       getCurrentTime() {

+ 24 - 1
src/views/material/changeApply/add/column.js

@@ -165,7 +165,8 @@ export default function useColumns(){
               usefulLife:'usefulLife',
               serialNoManager:'serialNoManager',
               ratifyBatchNo:'ratifyBatchNo',
-
+              expiryUnitId:'expiryUnitId',
+              usefulLifeUnitId: 'usefulLifeUnitId',
             },
 
 
@@ -332,6 +333,28 @@ export default function useColumns(){
             min:0,
           },
         },
+        {
+          item:{
+            key:'expiryUnitId',
+            title:'效期单位',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "period_unit",
+            clearable: true,
+          },
+        },
+        {
+          item:{
+            key:'usefulLifeUnitId',
+            title:'有效期至单位',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "expiry_date",
+            clearable: true,
+          },
+        },
 
 
         // {

+ 314 - 337
src/views/material/changeApply/add/index.vue

@@ -1,8 +1,13 @@
 <!-- 批量新增 -->
 <script>
 import useColumns from "./column";
-import {addChangeList, getMaterialDetails, getChangeDetails, editChangeList,importInner} from '@/api/changeApply/basic';
-
+import {
+  addChangeList,
+  getMaterialDetails,
+  getChangeDetails,
+  editChangeList,
+  importInner,
+} from "@/api/changeApply/basic";
 
 export default {
   name: "AddChangeOrders",
@@ -23,10 +28,10 @@ export default {
     ElPopoverTreeSelect: () =>
       import("@/components/popover-tree-select/index.vue"),
     BatchImport: () => import("@/components/BatchImport/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
   },
 
   data() {
-
     const {
       TabColumns,
       TableColumns,
@@ -42,7 +47,7 @@ export default {
     return {
       width: "100%",
       visible: false,
-      loading:false,
+      loading: false,
       rules,
       params,
       tabName: tabName,
@@ -63,8 +68,8 @@ export default {
       },
       set() {},
     },
-    materialInfo:{
-      get(){
+    materialInfo: {
+      get() {
         const { materialBasic } = this.params;
         this.params.materialBasic = materialBasic.map((item, index) => ({
           ...item,
@@ -75,33 +80,30 @@ export default {
           materialBasic: this.params.materialBasic.filter(
             ({ delFlag }) => delFlag !== "2"
           ),
-        }
+        };
       },
-      set(){},
-    }
-
-  },
-  watch: {
-
+      set() {},
+    },
   },
+  watch: {},
   methods: {
-    setVisible(prop){
+    setVisible(prop) {
       this.visible = prop;
     },
-    beforeOpen(){
-      if(this.addType === 'add'){
-        let {name,nickName} = this.$store.state.user;
+    beforeOpen() {
+      if (this.addType === "add") {
+        let { name, nickName } = this.$store.state.user;
         this.params.createBy = name;
         this.params.createByName = nickName;
-        this.params.createTime =  new Date().Format('yyyy-MM-dd HH:mm:ss');
+        this.params.createTime = new Date().Format("yyyy-MM-dd HH:mm:ss");
         this.params.updateBy = name;
         this.params.updateByName = nickName;
-        this.params.updateTime =  new Date().Format('yyyy-MM-dd HH:mm:ss');
+        this.params.updateTime = new Date().Format("yyyy-MM-dd HH:mm:ss");
         // this.params.approver = name;
-        this.params.applicationTime =  new Date().Format('yyyy-MM-dd HH:mm:ss');
-        this.params.status = '0';
-        console.log(this.$store.state.user,'user');
-        this.params.orgName = '德荣集团';
+        this.params.applicationTime = new Date().Format("yyyy-MM-dd HH:mm:ss");
+        this.params.status = "0";
+        console.log(this.$store.state.user, "user");
+        this.params.orgName = "德荣集团";
         // this.useRowAdd(this.tabName);
       }
     },
@@ -114,10 +116,9 @@ export default {
 
         let { code, data } = await getChangeDetails(prop.id);
 
-        if(code == 200){
+        if (code == 200) {
           this.params = data;
         }
-
       } catch (err) {
         // catch
         console.error(err);
@@ -139,19 +140,18 @@ export default {
         ],
       } = useColumns();
       this.visible = false;
-      this.$emit('success');
+      this.$emit("success");
       this.tabName = tabName;
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
     },
     //
     async useRowAdd(prop) {
-
       const { TableColumns } = this.TabColumns.find(
         ({ item: { key } }) => key === prop
       );
       this.params[prop].push({
         delFlag: "0",
-        materialClassifyId:null,
+        materialClassifyId: null,
         ...this.$init.params(TableColumns),
       });
     },
@@ -165,30 +165,31 @@ export default {
         this.params[prop].splice($index, 1);
       }
       if (addType === "edit") {
-        this.params[prop] = this.params[prop].map((item, index) => ({
-          ...item,
-          delFlag: index === $index ? "2" : item.delFlag,
-        })).filter(item =>( item.id  || (!item.id && item.delFlag === '0')) )
-        ;
+        this.params[prop] = this.params[prop]
+          .map((item, index) => ({
+            ...item,
+            delFlag: index === $index ? "2" : item.delFlag,
+          }))
+          .filter((item) => item.id || (!item.id && item.delFlag === "0"));
       }
     },
-    handleSubmitValidate(prop,cb){
-
+    handleSubmitValidate(prop, cb) {
       this.$refs[prop].$refs[prop].validate(async (valid) => {
         if (valid) {
           try {
             this.loading = true;
 
-            let validList = this.params['materialBasic'].filter(item => item.delFlag === '0');
+            let validList = this.params["materialBasic"].filter(
+              (item) => item.delFlag === "0"
+            );
 
-            if(validList.length){
+            if (validList.length) {
               await cb();
-            }else{
+            } else {
               this.$notify.error({
-                message:'物料信息不能不为空!'
-              })
+                message: "物料信息不能不为空!",
+              });
             }
-
           } catch (err) {
             // catch
             console.error(err);
@@ -203,51 +204,45 @@ export default {
     },
     //
     async useSubmit(prop) {
-      console.log(this.params,'this.params');
-      this.handleSubmitValidate(prop,async()=>{
+      let params = _.cloneDeep(this.params);
 
+      this.handleSubmitValidate(prop, async () => {
         try {
           this.loading = true;
-          const {code,msg} = await addChangeList(this.params);
-
-          if(code == 200){
+          const { code, msg } = await addChangeList(params);
 
+          if (code == 200) {
             this.hide();
             this.$notify.success({
               title: msg,
             });
           }
-
-        } catch (error) {}
-        finally{
+        } catch (error) {
+        } finally {
           this.loading = false;
         }
 
-
         // await;
-      })
+      });
     },
 
-    async handelImport(fileList){
-
+    async handelImport(fileList) {
       try {
-
         let formData = new FormData();
 
-        formData.append('file',fileList[0].raw);
+        formData.append("file", fileList[0].raw);
 
         this.$modal.loading("正在上传文件,请稍候...");
 
-        let {code,data} = await importInner(formData);
-
-        if(code == 200) {
+        let { code, data } = await importInner(formData);
 
+        if (code == 200) {
           // let size = 20;
           // let num = 1;
           // let total = Math.ceil(data.length / size);
 
           // let resultData = [...data];
-          
+
           // let intervalPush = setInterval(()=>{
 
           //   if(num > total) clearInterval(intervalPush);
@@ -255,7 +250,7 @@ export default {
           //     resultData.slice(size*(num-1), (size*num) ).forEach(item =>{
 
           //       this.params['materialBasic'].push(item);
-                this.params['materialBasic'].push(...data);
+          this.params["materialBasic"].push(...data);
 
           //     })
 
@@ -263,76 +258,68 @@ export default {
 
           // },200);
 
-          let {setVisible} =  this.$refs.batchImport;
+          let { setVisible } = this.$refs.batchImport;
 
           setVisible(false);
-
         }
-        
       } catch (error) {
-        
-      }finally{
+      } finally {
         this.$modal.closeLoading();
       }
-
     },
 
-    async handleTemDownload(){
-
-      this.download('/material/change/downloadInner',{}, `变更单物料信息模板${new Date().getTime()}.xlsx`);
+    async handleTemDownload() {
+      this.download(
+        "/material/change/downloadInner",
+        {},
+        `变更单物料信息模板${new Date().getTime()}.xlsx`
+      );
     },
     // 批号及库存状态管理
-    changeIsInventoryStatus(row){
-
-      if(row.isInventoryStatus === '2'){
+    changeIsInventoryStatus(row) {
+      if (row.isInventoryStatus === "2") {
+        row.expiryDateManagerment = "2";
 
-        row.expiryDateManagerment = '2';
-
-        row.serialNoManager = '2';
+        row.serialNoManager = "2";
       }
       this.changeExpiryDateManagerment(row);
     },
-    changeExpiryDateManagerment(row){
-      
-      if(row.expiryDateManagerment === '2'){
-
-        row.usefulLife = '';
+    
+    changeExpiryDateManagerment(row) {
+      if (row.expiryDateManagerment === "2") {
+        row.usefulLife = "";
       }
     },
     // 物料编码
-    materialCodeChange( rows, props){
-      console.log(rows, props,'rows, props');
+    materialCodeChange(rows, props) {
+      console.log(rows, props, "rows, props");
     },
-
-  },
-  created() {
   },
+  created() {},
   mounted() {},
   destroyed() {},
 };
 </script>
 
 <template>
-    <el-drawer
-      v-bind="$attrs"
-      v-on="$listeners"
-      :size="width"
-      :visible.sync="visible"
-      destroy-on-close
-      :show-close="false"
-      @close="hide"
-      @open="beforeOpen"
-      v-loading="loading"
+  <el-drawer
+    v-bind="$attrs"
+    v-on="$listeners"
+    :size="width"
+    :visible.sync="visible"
+    destroy-on-close
+    :show-close="false"
+    @close="hide"
+    @open="beforeOpen"
+    v-loading="loading"
+  >
+    <div
+      slot="title"
+      style="display: flex; justify-content: space-between; align-items: center"
     >
-      <div
-        slot="title"
-        style="display: flex;
-            justify-content: space-between;
-            align-items: center;"
-      >
-        <h3>{{title}}</h3>
-        <div>
-          <el-button
+      <h3>{{ title }}</h3>
+      <div>
+        <el-button
           type="primary"
           :size="$attrs.size"
           :loading="loading"
@@ -342,134 +329,122 @@ export default {
         <el-button :size="$attrs.size" :loading="loading" @click="hide"
           >取 消</el-button
         >
-        </div>
       </div>
-      <el-super-form
-        v-model="params"
-        :dict="dict"
-        :rules="rules"
-        :size="$attrs.size"
-        :columns="TableColumns"
-        ref="superForm"
-        label-width="auto"
-        label-position="right"
-        style="padding: 20px"
-      >
-        <template slot="puOrgName" slot-scope="scope">
-          <component
-            v-bind="scope.attr"
-            v-model="scope.row[scope.item.key]"
+    </div>
+    <el-super-form
+      v-model="params"
+      :dict="dict"
+      :rules="rules"
+      :size="$attrs.size"
+      :columns="TableColumns"
+      ref="superForm"
+      label-width="auto"
+      label-position="right"
+      style="padding: 20px"
+    >
+      <template slot="puOrgName" slot-scope="scope">
+        <component
+          v-bind="scope.attr"
+          v-model="scope.row[scope.item.key]"
+          :size="$attrs.size"
+          :source.sync="scope.row"
+        >
+        </component
+      ></template>
+    </el-super-form>
+
+    <div style="position: relative">
+      <el-tabs v-model="tabName" style="padding: 0 20px 20px">
+        <el-tab-pane
+          v-for="({ item, TableColumns: columns }, index) in TabColumns"
+          :key="index"
+          :label="item.title"
+          :name="item.key"
+          lazy
+        >
+          <el-super-ux-table
+            index
+            v-model="materialInfo[item.key]"
+            :dict="dict"
+            :ref="tabName"
+            :columns="columns"
             :size="$attrs.size"
-            :source.sync="scope.row"
-          >
-          </component
-        ></template>
-      </el-super-form>
-
-
-      <div style="position: relative;">
-        <el-tabs v-model="tabName" style="padding: 0 20px 20px">
-          <el-tab-pane
-            v-for="({ item, TableColumns: columns }, index) in TabColumns"
-            :key="index"
-            :label="item.title"
-            :name="item.key"
-            lazy
+            :height="420"
           >
-            <div style="height: 420px;display:flex">
-              <el-super-table
-                index
-                v-model="materialInfo[item.key]"
-                :dict="dict"
-                :ref="tabName"
-                :columns="columns"
+            <template slot="materialName" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
                 :size="$attrs.size"
+                :source.sync="scope.row"
               >
-                <!-- <template slot="materialCode" slot-scope="scope">
-                  <component
-                    v-bind="scope.attr"
-                    v-model="scope.row[scope.item.key]"
-                    :size="$attrs.size"
-                    :source.sync="scope.row"
-                    copy
-                    @change="materialCodeChange"
-                  >
-                  </component>
-                </template> -->
-                <template slot="materialName" slot-scope="scope">
-                  <component
-                    v-bind="scope.attr"
-                    v-model="scope.row[scope.item.key]"
-                    :size="$attrs.size"
-                    :source.sync="scope.row"
-                  >
-                  </component>
-                </template>
-                <!-- 判断是否禁用 -->
-                <template slot="drug" slot-scope="scope">
-                  <component
-                    v-bind="scope.attr"
-                    v-model="scope.row[scope.item.key]"
-                    :size="$attrs.size"
-                    :source.sync="scope.row"
-                    :disabled="!(scope.row.medicineMaterial ==='0') "
-                  >
-                  <el-option
-                      v-for="item in dict.type[scope.attr.dictName]"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    >
-                    </el-option>
-                  </component>
-                </template>
-  
-                <template slot="registrationNo" slot-scope="scope">
-                  <component
-                    v-bind="scope.attr"
-                    v-model="scope.row[scope.item.key]"
-                    :size="$attrs.size"
-                    :source.sync="scope.row"
-                    :disabled="!(scope.row.medicineMaterial ==='0') "
-                  >
-                  </component>
-                </template>
-  
-                <template slot="medicalDevices" slot-scope="scope">
-                  <component
-                    v-bind="scope.attr"
-                    v-model="scope.row[scope.item.key]"
-                    :size="$attrs.size"
-                    :source.sync="scope.row"
-                    :disabled="!(scope.row.medicineMaterial ==='0') "
-                  >
-                  <el-option
-                      v-for="item in dict.type[scope.attr.dictName]"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    >
-                    </el-option>
-                  </component>
-                </template>
-                <template slot="maintenanceType" slot-scope="scope">
-                  <component
-                    v-bind="scope.attr"
-                    v-model="scope.row[scope.item.key]"
-                    :size="$attrs.size"
-                    :source.sync="scope.row"
-                    :disabled="!(scope.row.medicineMaterial ==='0') "
-                  >
-                  <el-option
-                      v-for="item in dict.type[scope.attr.dictName]"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    >
-                    </el-option>
-                  </component>
-                </template>
-                <!-- <template slot="dosageFromName" slot-scope="scope">
+              </component>
+            </template>
+            <!-- 判断是否禁用 -->
+            <template slot="drug" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                :disabled="!(scope.row.medicineMaterial === '0')"
+              >
+                <el-option
+                  v-for="item in dict.type[scope.attr.dictName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </component>
+            </template>
+
+            <template slot="registrationNo" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                :disabled="!(scope.row.medicineMaterial === '0')"
+              >
+              </component>
+            </template>
+
+            <template slot="medicalDevices" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                :disabled="!(scope.row.medicineMaterial === '0')"
+              >
+                <el-option
+                  v-for="item in dict.type[scope.attr.dictName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </component>
+            </template>
+            <template slot="maintenanceType" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                :disabled="!(scope.row.medicineMaterial === '0')"
+              >
+                <el-option
+                  v-for="item in dict.type[scope.attr.dictName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </component>
+            </template>
+            <!-- <template slot="dosageFromName" slot-scope="scope">
                   <component
                     v-bind="scope.attr"
                     v-model="scope.row[scope.item.key]"
@@ -479,114 +454,118 @@ export default {
                   >
                   </component>
                 </template> -->
-                <!-- 批号及库存状态管理 -->
-                <template slot="isInventoryStatus" slot-scope="scope">
-                  <component
-                    v-bind="scope.attr"
-                    v-model="scope.row[scope.item.key]"
-                    :size="$attrs.size"
-                    :source.sync="scope.row"
-                    @change="changeIsInventoryStatus(scope.row)"
-                  >
-                  <el-option
-                      v-for="item in dict.type[scope.attr.dictName]"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    >
-                    </el-option>
-                  </component>
-                </template>
-                <!-- 效期管理 -->
-                <template slot="expiryDateManagerment" slot-scope="scope">
-                  <component
-                    v-bind="scope.attr"
-                    v-model="scope.row[scope.item.key]"
-                    :size="$attrs.size"
-                    :source.sync="scope.row"
-                    :disabled="scope.row.isInventoryStatus !=='0' "
-                    @change="changeExpiryDateManagerment(scope.row)"
-                  >
-                  <el-option
-                      v-for="item in dict.type[scope.attr.dictName]"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    >
-                    </el-option>
-                  </component>
-                </template>
-                <!-- 是否序列号管理 -->
-                <template slot="serialNoManager" slot-scope="scope">
-                  <component
-                    v-bind="scope.attr"
-                    v-model="scope.row[scope.item.key]"
-                    :size="$attrs.size"
-                    :source.sync="scope.row"
-                    :disabled="scope.row.isInventoryStatus !=='0' "
-                  >
-                  <el-option
-                      v-for="item in dict.type[scope.attr.dictName]"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    >
-                    </el-option>
-                  </component>
-                </template>
-                <!-- 有效期 -->
-                <template slot="usefulLife" slot-scope="scope">
-                  <component
-                    v-bind="scope.attr"
-                    v-model="scope.row[scope.item.key]"
-                    :size="$attrs.size"
-                    :source.sync="scope.row"
-                    :disabled="scope.row.expiryDateManagerment !=='0'"
-                  >
-                  </component>
-                </template>
-  
-                <el-table-column fixed="right" label="操作" width="120" align="center">
-                  <template slot="header" slot-scope="scope">
-                    <el-button
-                      type="text"
-                      :size="$attrs.size"
-                      @click="useRowAdd(tabName)"
-                    >
-                      增行
-                    </el-button>
-                  </template>
-                  <template slot-scope="scope">
-                    <el-button
-                      type="text"
-                      :size="$attrs.size"
-                      @click.native.prevent="useRowRemove(tabName, scope)"
-                    >
-                    删除
-                    </el-button>
-                    <AmendantRecord
-                      v-if=" tabName ==='materialBasic' && addType === 'edit' && scope.row.id"
-                      v-model="scope.row"
-                    ></AmendantRecord>
-                  </template>
-                </el-table-column>
-              </el-super-table>
-            </div>
-          </el-tab-pane>
-        </el-tabs>
-        <el-row style="position: absolute; top: 0px; right: 20px">
-          
-          <BatchImport
-            ref="batchImport"
-            @import="handelImport"
-            @temDownload="handleTemDownload"
-          ></BatchImport>
-        </el-row>
-      </div>
-
-
-
-    </el-drawer>
+            <!-- 批号及库存状态管理 -->
+            <template slot="isInventoryStatus" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                @change="changeIsInventoryStatus(scope.row)"
+              >
+                <el-option
+                  v-for="item in dict.type[scope.attr.dictName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </component>
+            </template>
+            <!-- 效期管理 -->
+            <template slot="expiryDateManagerment" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                :disabled="scope.row.isInventoryStatus !== '0'"
+                @change="changeExpiryDateManagerment(scope.row)"
+              >
+                <el-option
+                  v-for="item in dict.type[scope.attr.dictName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </component>
+            </template>
+            <!-- 是否序列号管理 -->
+            <template slot="serialNoManager" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                :disabled="scope.row.isInventoryStatus !== '0'"
+              >
+                <el-option
+                  v-for="item in dict.type[scope.attr.dictName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </component>
+            </template>
+            <!-- 有效期 -->
+            <template slot="usefulLife" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                :disabled="scope.row.expiryDateManagerment !== '0'"
+              >
+              </component>
+            </template>
+
+            <ux-table-column
+              fixed="right"
+              title="操作"
+              width="120"
+              align="center"
+            >
+              <template slot="header" slot-scope="scope">
+                <el-button
+                  type="text"
+                  :size="$attrs.size"
+                  @click="useRowAdd(tabName)"
+                >
+                  增行
+                </el-button>
+              </template>
+              <template slot-scope="scope">
+                <el-button
+                  type="text"
+                  :size="$attrs.size"
+                  @click.native.prevent="useRowRemove(tabName, scope)"
+                >
+                  删除
+                </el-button>
+                <AmendantRecord
+                  v-if="
+                    tabName === 'materialBasic' &&
+                    addType === 'edit' &&
+                    scope.row.id
+                  "
+                  v-model="scope.row"
+                ></AmendantRecord>
+              </template>
+            </ux-table-column>
+          </el-super-ux-table>
+        </el-tab-pane>
+      </el-tabs>
+      <el-row style="position: absolute; top: 0px; right: 20px">
+        <BatchImport
+          ref="batchImport"
+          @import="handelImport"
+          @temDownload="handleTemDownload"
+        ></BatchImport>
+      </el-row>
+    </div>
+  </el-drawer>
 </template>
 
 <style scoped>
@@ -594,5 +573,3 @@ export default {
   display: none;
 }
 </style>
-
-

+ 5 - 4
src/views/material/changeApply/index.vue

@@ -116,12 +116,13 @@ export default {
   data() {
     const { TableColumns, SearchColumns } = useColumns();
     const params = this.$init.params(SearchColumns);
+    const page = this.$init.page();
     return {
       loading: false,
       size: "mini",
       tableList: [],
       TableColumns: TableColumns,
-      page: { pageNum: 1, pageSize: 50, total: 0 },
+      page: page,
       params: params,
       SearchColumns: SearchColumns,
       optionType: "add",
@@ -167,8 +168,9 @@ export default {
     },
 
     useReset() {
-      this.page.pageNum = 1;
-      this.page.pageSize = 10;
+      // this.page.pageNum = 1;
+      // this.page.pageSize = 50;
+      this.page = this.$init.page();
       this.params = this.$init.params(this.SearchColumns);
       this.useQuery(this.params, this.page);
     },
@@ -222,7 +224,6 @@ export default {
 
           if (code == 200) {
             this.$notify.success({
-              // title: '成功',
               message: msg,
             });
             await this.useQuery(this.params, this.page);

+ 82 - 35
src/views/material/changeApply/see/index.vue

@@ -19,6 +19,7 @@ export default {
     AmendantRecord: () => import("../amendantRecord/index.vue"),
     ElSuperForm: () => import("@/components/super-form/index.vue"),
     ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
     ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
     ElPopoverTreeSelect: () =>
       import("@/components/popover-tree-select/index.vue"),
@@ -126,19 +127,66 @@ export default {
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
     },
 
+    // 提交
     async handleSubmit() {
-      this.params = { ...this.params, status: "1" };
-      console.log(this.params, "this.params");
+      let params = _.cloneDeep({ ...this.params, status: "1" });
+
+      console.log(params, "params");
       try {
         this.loading = true;
 
-        const { code, msg } = await addChangeList(this.params);
+        const { code, msg } = await addChangeList({
+          ...params,
+          isInventory: "Y",
+        });
 
         if (code == 200) {
           this.hide();
           this.$notify.success({
             message: msg,
           });
+        } else if (code == 10000) {
+          this.$alert(
+            "<div style='overflow: auto;overflow-x: hidden;max-height: 65vh;padding: 10px 20px 0;'>" +
+              msg +
+              "</div>",
+            "提示",
+            {
+              showCancelButton: true,
+              dangerouslyUseHTMLString: true,
+              confirmButtonText: "确认",
+              cancelButtonText: "取消",
+              beforeClose: async (action, instance, done) => {
+                if (action === "confirm") {
+                  instance.confirmButtonLoading = true;
+                  instance.confirmButtonText = "执行中...";
+                  try {
+                    const { code, msg } = await addChangeList({
+                      ...params,
+                      isInventory: "N",
+                    });
+                    if (code == 200) {
+                      done();
+                      this.hide();
+                      this.$notify.success({
+                        message: msg,
+                      });
+                    }
+                  } catch (error) {
+                    instance.confirmButtonText = "确认";
+                  } finally {
+                    instance.confirmButtonLoading = false;
+                  }
+                } else {
+                  done();
+                  this.$notify.warning({
+                    message:
+                      "不允许修改【批号及库存状态管理】或【是否序列号管理】",
+                  });
+                }
+              },
+            }
+          );
         }
       } catch (error) {
       } finally {
@@ -234,40 +282,39 @@ export default {
         :name="item.key"
         lazy
       >
-        <div style="height: 420px; display: flex">
-          <el-super-table
-            v-model="materialInfo[item.key]"
-            :dict="dict"
-            index
-            :ref="tabName"
-            :columns="columns"
-            :size="$attrs.size"
+        <el-super-ux-table
+          v-model="materialInfo[item.key]"
+          :dict="dict"
+          index
+          :ref="tabName"
+          :columns="columns"
+          :size="$attrs.size"
+          :height="420"
+        >
+          <template slot="materialName" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              @change="changeMaterialName(scope)"
+            >
+            </component>
+          </template>
+          <ux-table-column
+            fixed="right"
+            title="操作"
+            width="120"
+            align="center"
           >
-            <template slot="materialName" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                @change="changeMaterialName(scope)"
-              >
-              </component>
+            <template slot-scope="scope">
+              <AmendantRecord
+                v-if="tabName === 'materialBasic'"
+                v-model="scope.row"
+              ></AmendantRecord>
             </template>
-            <el-table-column
-              fixed="right"
-              label="操作"
-              width="120"
-              align="center"
-            >
-              <template slot-scope="scope">
-                <AmendantRecord
-                  v-if="tabName === 'materialBasic'"
-                  v-model="scope.row"
-                ></AmendantRecord>
-              </template>
-            </el-table-column>
-          </el-super-table>
-        </div>
+          </ux-table-column>
+        </el-super-ux-table>
       </el-tab-pane>
     </el-tabs>
   </el-drawer>

+ 7 - 41
src/views/material/requisition/details/columns.js

@@ -23,43 +23,6 @@ export default function useColumns(){
           },
           attr:{
             is: "el-input",
-            // is: "el-popover-select-v2",
-            // valueKey: "name",
-            // referName: "MATERIAL_PARAM",
-            // dataMapping: {
-            //   classifyId: 'classifyId',
-            //   classifyName: 'classifyIdName',
-            //   isMedicine: 'isMedicine',
-            //   unitId: 'unitId',
-            //   unitName: 'unitIdName',
-            //   packExplain: 'packExplain',
-            //   isInventoryStatus: 'isInventoryStatus',
-            //   manufacturerId: 'manufacturerId',
-            //   manufacturerName: 'manufacturerIdName',
-            //   deliveryPeriod: 'deliveryPeriod',
-            //   expiryDateManagerment: 'expiryDateManagerment',
-            //   registrant: 'registrant',
-            //   minOrderQty: 'minOrderQty',
-            //   expiryUnitId: 'expiryUnitId',
-            //   productionPermit: 'productionPermit',
-            //   minPackQty: 'minPackQty',
-            //   usefulLife: 'usefulLife',
-            //   storageCondition: 'storageCondition',
-            //   minBatchQty: 'minBatchQty',
-            //   usefulLifeUnitId: 'usefulLifeUnitId',
-            //   transportationCondition: 'transportationCondition',
-            //   materialRate: 'materialRate',
-            //   materialRateName: 'materialRateName',
-            //   nearOnsetManagerment: 'nearOnsetManagerment',
-            //   originPlace: 'originPlace',
-            //   originPlaceName: 'originPlaceName',
-            //   purchasingOrganization: 'purchasingOrganization',
-            //   purchasingOrganizationName: 'purchasingOrganizationName',
-            //   recentWarningPeriod: 'recentWarningPeriod',
-            //   brand:'brand',
-            //   puPersonnelId:'puPersonnelId',
-            //   puPersonnelName:'puPersonnelIdName',
-            // },
           },
         },
         {
@@ -254,8 +217,8 @@ export default function useColumns(){
             dataMapping: {
               manufacturerId: 'id',
               brand:"brand" ,
-              originPlaceName: "countryName" ,
-              originPlace: "countryId",
+              // originPlaceName: "countryName" ,
+              // originPlace: "country",
               registrant: "registrantName" ,
               productionPermit: "productionLicense",
             }
@@ -472,7 +435,7 @@ export default function useColumns(){
             dataMapping: {
               originPlace: 'id'
             },
-            disabled: true,
+            // disabled: true,
           },
           
         },
@@ -541,8 +504,10 @@ export default function useColumns(){
             is: "el-popover-select-v2",
             valueKey: "name",
             referName: "MATERIALTAX_PARAM",
+            readonly:true,
             dataMapping: {
-              materialRate: "code",
+              materialRate: "id",
+              rateCode:'code',
             },
           },
         },
@@ -933,6 +898,7 @@ export default function useColumns(){
           transportationCondition: 'transportationCondition',
           materialRate: 'materialRate',
           materialRateName: 'materialRateName',
+          rateCode: 'rateCode',
           nearOnsetManagerment: 'nearOnsetManagerment',
           originPlace: 'originPlace',
           originPlaceName: 'originPlaceName',

+ 14 - 0
src/views/material/requisition/details/index.vue

@@ -233,6 +233,7 @@ export default {
         this.params.sysMaterialApply.isEnable = "0";
         this.params.sysMaterialApply.materialRateName = "专票13%";
         this.params.sysMaterialApply.materialRate = "1001A11000000000TPTF";
+        this.params.sysMaterialApply.rateCode = "CN011";
         this.params.sysMaterialApply.proposerId = name;
         this.params.sysMaterialApply.proposerName = nickName;
         this.params.sysMaterialApply.orgId = "";
@@ -638,6 +639,7 @@ export default {
                   v-model="materialReference.name"
                   :source.sync="materialReference"
                   v-bind="materialColums.attr"
+                  :disabled="addType === 'see'"
                   style="width: 100%"
                   @change="materialReferenceChange"
                 >
@@ -827,6 +829,18 @@ export default {
               style="width: 100%"
             ></component>
           </template>
+
+          <!-- DI -->
+          <!-- <template slot="diCode" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              :disabled="addType === 'see'"
+              style="width: 100%"
+            ></component>
+          </template> -->
         </component>
 
         <!--  -->

+ 1 - 1
src/views/material/requisition/index.vue

@@ -128,7 +128,7 @@ export default {
     },
     reset() {
       this.page = this.$init.page();
-      this.params = this.$init.params(SearchColumns);
+      this.params = this.$init.params(this.SearchColumns);
       this.useQuery(this.params, this.page);
     },
     // 批量提交

+ 76 - 42
src/views/purchase/purchase-order/add/column.js

@@ -324,6 +324,13 @@ const PurColumns =[
     isShow:true,
   },
   {
+    key: "closeReason",
+    title: "关闭原因",
+    inputType: "Input",
+    disabled: true,
+    isShow:true,
+  },
+  {
     key: "invoiceMoney",
     title: "发票金额",
     inputType: "InputNumber",
@@ -375,6 +382,24 @@ const PurchaseTabColumns =[
         },
       },
       {
+        key: "goodsAllocationName",
+        title: "货位",
+        inputType: "PopoverSelect",
+        valueKey: "id",
+        referName: "ALLOCATION_PARAM",
+        dataMapping: {
+          goodsAllocation: 'id',
+          goodsAllocationName: 'name',
+    
+        },
+         isShow:true,
+        queryParams: (params) => ({
+          stordocId: params.warehouse,
+          pkOrg: params.puOrg,
+        }),
+        width: 180,
+      },
+      {
         key: "rowNo",
         title: "行号",
         inputType: "Input",
@@ -383,13 +408,14 @@ const PurchaseTabColumns =[
       },
 
       {
-        key: "materialName",
-        title: "物料名称",
+        key: "materialCode",
+        title: "物料编码",
         inputType: "PopoverSelect",
         width: 180,
         require: true,
-        valueKey: "id",
+        valueKey: "code",
         referName: "MATERIAL_PARAM",
+        // copy: true,
         dataMapping: {
           material: "id",
           materialName: "name",
@@ -403,7 +429,6 @@ const PurchaseTabColumns =[
           manufacturerName:'manufacturerIdName',
           unit:'unitId',
           unitName:'unitIdName',
-          // tax:'materialRateName',
           storageCondition:'storageCondition',
           carriageCondition:'transportationCondition',
           materialClassifyOneName:'oneClass',
@@ -418,8 +443,10 @@ const PurchaseTabColumns =[
         width:180,
       },
       {
-        key: "materialCode",
-        title: "物料编码",
+        // key: "materialCode",
+        // title: "物料编码",
+        key: "materialName",
+        title: "物料名称",
         inputType: "Input",
         require: true,
         width: 180,
@@ -485,6 +512,7 @@ const PurchaseTabColumns =[
         width: 180,
         isSummary:true,
        },
+       
        {
         key: "isGift",
         title: "赠品",
@@ -597,23 +625,13 @@ const PurchaseTabColumns =[
         width: 180,
         isSummary:true,
       },
+      
       {
-        key: "goodsAllocationName",
-        title: "货位",
-        inputType: "PopoverSelect",
-        valueKey: "id",
-        referName: "ALLOCATION_PARAM",
-        dataMapping: {
-          goodsAllocation: 'id',
-          goodsAllocationName: 'name',
-    
-        },
-         isShow:true,
-        queryParams: (params) => ({
-          stordocId: params.warehouse,
-          pkOrg: params.puOrg,
-        }),
+        key: "closeReason",
+        title: "行关闭/打开原因",
+        inputType: "Input",
         width: 180,
+        disabled: true,
       },
     
     ]
@@ -1045,6 +1063,13 @@ const CauseColumns =[
     width: 200,
   },
   {
+    key: "closeReason",
+    title: "关闭原因",
+    inputType: "Input",
+    isShow:true,
+    disabled:true,
+   },
+  {
     key: "invoiceMoney",
     title: "发票金额",
     inputType: "InputNumber",
@@ -1142,6 +1167,24 @@ const CauseTabColumns =[
         },
       },
       {
+        key: "goodsAllocationName",
+        title: "货位",
+        inputType: "PopoverSelect",
+        valueKey: "id",
+        referName: "ALLOCATION_PARAM",
+        dataMapping: {
+          goodsAllocation: 'id',
+          goodsAllocationName: 'name',
+
+        },
+        isShow:true,
+        queryParams: (params) => ({
+          stordocId: params.warehouse,
+          pkOrg: params.puOrg,
+        }),
+        width: 180,
+      },
+      {
         key: "rowNo",
         title: "行号",
         inputType: "Input",
@@ -1150,18 +1193,17 @@ const CauseTabColumns =[
       },
 
       {
-        key: "materialName",
-        title: "物料",
+        key: "materialCode",
+        title: "物料编码",
         inputType: "PopoverSelect",
         width: 180,
         require: true,
-        valueKey: "id",
+        valueKey: "code",
         referName: "MATERIAL_PARAM",
         dataMapping: {
           material: "id",
           materialName: "name",
           materialCode: "code",
-          // materialClassify:'classifyIdName',
           materialManufacturersCode:'manufacturersMaterialCode',
           specification:'specification',
           model:'model',
@@ -1184,8 +1226,8 @@ const CauseTabColumns =[
         queryParams: () => ({}),
       },
       {
-        key: "materialCode",
-        title: "物料编码",
+        key: "materialName",
+        title: "物料名称",
         inputType: "Input",
         require: true,
         width: 180,
@@ -1273,6 +1315,7 @@ const CauseTabColumns =[
         width: 180,
         isSummary:true,
        },
+       
        {
         key: "ntaxnetprice",
         title: "含税净价",
@@ -1389,24 +1432,15 @@ const CauseTabColumns =[
       { key: "discountRule", title: "折扣规则编码", inputType: "Input", width: 180 },
       { key: "demandCode", title: "采购需求单号", inputType: "Input", width: 180 },
       { key: "remark", title: "备注", inputType: "Input", width: 200 },
+      
       {
-        key: "goodsAllocationName",
-        title: "货位",
-        inputType: "PopoverSelect",
-        valueKey: "id",
-        referName: "ALLOCATION_PARAM",
-        dataMapping: {
-          goodsAllocation: 'id',
-          goodsAllocationName: 'name',
-
-        },
+        key: "closeReason",
+        title: "关闭原因",
+        inputType: "Input",
         isShow:true,
-        queryParams: (params) => ({
-          stordocId: params.warehouse,
-          pkOrg: params.puOrg,
-        }),
+        disabled:true,
         width: 180,
-      },
+       },
 
     ]
   },

+ 46 - 69
src/views/purchase/purchase-order/add/index.vue

@@ -31,12 +31,7 @@ NewTabColumns.forEach((column) => {
 
 export default {
   name: "AddPurchaseOrderDrawer",
-  props: {
-    // roles:{
-    //   type:[Array,String,Object],
-    //   require:true,
-    // }
-  },
+  props: {},
   dicts: initDicts(SelectColumns),
   components: {
     "virtual-scroll": VirtualScroll,
@@ -65,6 +60,7 @@ export default {
       isCopy: false,
       tableData: [], //虚拟滚动加载显示的数据
       rowHeight: 60,
+      size: "mini",
     };
   },
   computed: {
@@ -116,7 +112,6 @@ export default {
     // },
     "params.billType": {
       handler(nVal, oVal) {
-        // let billList = ['21-Cxx-02','21-Cxx-04','21-Cxx-10','21-Cxx-14','21-Cxx-09','21-Cxx-17','21-Cxx-18'];
         let billList = ["21-Cxx-02", "21-Cxx-04", "21-Cxx-10", "21-Cxx-14"];
 
         this.params.warehouse = "";
@@ -142,7 +137,6 @@ export default {
     },
     "params.isBack": {
       handler(nVal, oVal) {
-        console.log(nVal, "val");
         if (nVal === "Y") {
           this.rules.retReasonName = [
             { required: true, message: "退换原因不能为空", trigger: "change" },
@@ -210,6 +204,7 @@ export default {
             paymentMoney: "",
             applyPaymentMoney: "",
             erpOrderCode: "",
+            closeReason: "",
           };
 
           try {
@@ -234,6 +229,7 @@ export default {
               this.params[key].forEach((v) => {
                 v.id = "";
                 v.demandCode = "";
+                v.closeReason = "";
                 v["isInvoice"] && (v["isInvoice"] = "N");
                 v["isStorage"] && (v["isStorage"] = "N");
                 v["isArrival"] && (v["isArrival"] = "N");
@@ -397,7 +393,6 @@ export default {
           //     return false
 
           //  }
-          //  console.log(isPrice,'isPrice');
           cb();
         } else {
           this.$notify.error({
@@ -510,11 +505,11 @@ export default {
           } else if (
             key != "puOrg" &&
             key != "puOrgName" &&
-            key != "buyer" &&
-            key != "buyerName" &&
-            key != "puDept" &&
-            key != "puDeptName" &&
-            key != "status" &&
+            // key != "buyer" &&
+            // key != "buyerName" &&
+            // key != "puDept" &&
+            // key != "puDeptName" &&
+            // key != "status" &&
             key != "billDate" &&
             key != "createTime"
           ) {
@@ -551,10 +546,32 @@ export default {
     },
 
     // 子表参照改变之后
-    async handleTabReferChange(val, type, source) {
-      // console.log(val,'val');
+    async handleTabReferChange(val, props, source) {
+      // let { type, copy, dataMapping } = props;
+      let { params, tabName } = this;
+      console.log(val, "val", props, "props", source, "source");
+
+      // // 复制
+      // if (copy) {
+      //   if (type == "MATERIAL_PARAM") {
+      //     for (let i = 1; i < val.length; i++) {
+      //       this.addTableRow(params[tabName]);
+      //     }
+
+      //     let value = val.map((item) => {
+      //       let columnValue = {};
+
+      //       for (let key in dataMapping) {
+      //         columnValue[key] = item[dataMapping[key]];
+      //       }
+
+      //       return columnValue;
+      //     });
+      //   }
+      // }
+
       // 触发物料参照询价
-      if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
+      if (props == "MATERIAL_PARAM" && source.qty && source.qty != "") {
         source["qty"] = 0;
 
         // source['whetherCompleteInquiry'] = false;
@@ -582,8 +599,9 @@ export default {
       }
 
       // 物料触发税率
-      if (type == "MATERIAL_PARAM") {
+      if (props == "MATERIAL_PARAM") {
         let { rateCode } = source;
+        console.log(rateCode, "rateCode-------");
         try {
           // try
           this.loading = true;
@@ -652,10 +670,7 @@ export default {
         });
 
         if (code == 200) {
-          // console.log(data,'data*----------******');
-
           this.params = { ...data };
-          // console.log(this.params,'this.params----------------------');
         }
       } catch (error) {}
     },
@@ -682,40 +697,6 @@ export default {
         let { code, data } = await orderApi.orderImport(formData);
 
         if (code == 200) {
-          // this.tabLoading = true;
-          // puOrderExecuteList puOrderItemList
-
-          // let size = 20;
-          // let num = 1;
-          // let total = Math.ceil(data['puOrderItemList'].length / size);
-
-          // let resultData = {...data};
-
-          // let intervalPush = setInterval(()=>{
-
-          //   if(num > total){
-
-          //     clearInterval(intervalPush);
-
-          //     this.tabLoading = false;
-
-          //     this.handleGetPrice();
-          //   }
-
-          //   for (const key in resultData) {
-
-          //     resultData[key].slice(size*(num-1), (size*num) ).forEach(item =>{
-
-          //       this.params[key].push(item);
-
-          //     })
-
-          //   }
-
-          //   num++;
-
-          // },200);
-
           for (const key in data) {
             this.params[key].push(...data[key]);
           }
@@ -740,11 +721,6 @@ export default {
       );
     },
 
-    // judgeRole(){
-    //   let {roles} = this.$store.state.user;
-    //   let role =  roles.find(item => item === "syfz-purchaseorder") || "procurementManager";
-    //   return role;
-    // },
     getSummaries({ columns, data }) {
       const means = []; // 合计
       let { tabColumns, tabName } = this;
@@ -806,7 +782,7 @@ export default {
     v-loading="loading"
   >
     <el-form
-      size="mini"
+      :size="size"
       label-position="right"
       ref="orderAddForm"
       class="orderAddForm"
@@ -833,10 +809,10 @@ export default {
         >
           <h3>新增</h3>
           <div style="text-align: right">
-            <el-button size="mini" type="primary" @click="handleSava"
+            <el-button :size="size" type="primary" @click="handleSava"
               >保存</el-button
             >
-            <el-button size="mini" @click="handleCancel">取消</el-button>
+            <el-button :size="size" @click="handleCancel">取消</el-button>
           </div>
         </div>
         <el-row style="display: flex; flex-wrap: wrap">
@@ -990,7 +966,7 @@ export default {
               show-overflow
               beautify-table
               :ref="column.key"
-              :size="'mini'"
+              :size="size"
               :height="tabHeight"
               style="width: 100%"
               :data="params[column.key]"
@@ -1026,7 +1002,7 @@ export default {
                       :placeholder="cColumn.placeholder"
                       :clearable="cColumn.clearable"
                       :disabled="cColumn.disabled"
-                      size="mini"
+                      :size="size"
                       style="width: 100%"
                     ></el-input>
 
@@ -1040,6 +1016,7 @@ export default {
                       :type="cColumn.referName"
                       :disabled="cColumn.disabled"
                       :multiple="cColumn.multiple"
+                      :copy="cColumn.copy"
                       :placeholder="cColumn.placeholder"
                       :data-mapping="cColumn.dataMapping"
                       :query-params="
@@ -1063,7 +1040,7 @@ export default {
                       :placeholder="cColumn.placeholder"
                       :controls-position="cColumn.controlsPosition"
                       :min="cColumn.key === 'reservedQty' ? 0 : -Infinity"
-                      size="mini"
+                      :size="size"
                       style="width: 100%"
                       @change="handleInputChange(scope.row, cColumn.key)"
                     ></el-input-number>
@@ -1072,7 +1049,7 @@ export default {
                       v-if="cColumn.inputType === 'Select'"
                       v-model="scope.row[cColumn.key]"
                       filterable
-                      size="mini"
+                      :size="size"
                       :disabled="cColumn.disabled"
                       :clearable="cColumn.clearable"
                       :placeholder="cColumn.placeholder"
@@ -1106,7 +1083,7 @@ export default {
                       delTableRow(params[tabName], scope.row, tabName)
                     "
                     type="text"
-                    size="small"
+                    :size="size"
                   >
                     删行
                   </el-button>
@@ -1116,7 +1093,7 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button size="mini" @click="addTableRow(params[tabName])"
+          <el-button :size="size" @click="addTableRow(params[tabName])"
             >增行</el-button
           >
 

+ 21 - 6
src/views/purchase/purchase-order/close/itemClose.vue

@@ -21,6 +21,17 @@ export default {
       },
       set() {},
     },
+    disabled: {
+      get() {
+        let { innerValue } = this;
+
+        if (innerValue.length > 0) {
+          return false;
+        }
+        return true;
+      },
+      set() {},
+    },
   },
   methods: {
     async open() {
@@ -28,18 +39,20 @@ export default {
 
       let data = innerValue.find((item) => item.isPayment === "Y");
 
-      if (!data) {
-        this.$confirm("是否继续此操作?", "提示", {
+      if (!data && innerValue.length) {
+        this.$prompt("请输入关闭原因", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning",
+          inputPattern: /\s*\S+?/,
+          inputErrorMessage: "关闭原因不能为空",
         })
-          .then(async () => {
+          .then(async ({ value }) => {
             try {
               let puOrderIds = innerValue.map((order) => Number(order.id));
 
               let { code } = await orderApi.itemClose({
                 puOrderIds,
+                closeReason: value,
               });
 
               if (code === 200) {
@@ -53,7 +66,7 @@ export default {
           .catch(() => {});
       } else {
         this.$notify.warning({
-          message: "存在已经完成关闭的行",
+          message: "不满足关闭条件",
         });
       }
     },
@@ -62,5 +75,7 @@ export default {
 };
 </script>
 <template>
-  <el-button :size="$attrs.size" @click="open">{{ title }}</el-button>
+  <el-button :size="$attrs.size" @click="open" :disabled="disabled">{{
+    title
+  }}</el-button>
 </template>

+ 21 - 6
src/views/purchase/purchase-order/close/itemOpen.vue

@@ -21,22 +21,35 @@ export default {
       },
       set() {},
     },
+    disabled: {
+      get() {
+        let { innerValue } = this;
+
+        if (innerValue.length > 0) {
+          return false;
+        }
+        return true;
+      },
+      set() {},
+    },
   },
   methods: {
     async open() {
       let { innerValue } = this;
       let data = innerValue.find((item) => item.isPayment === "N");
-      if (!data) {
-        this.$confirm("是否继续此操作?", "提示", {
+      if (!data && innerValue.length) {
+        this.$prompt("请输入打开原因", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning",
+          inputPattern: /\s*\S+?/,
+          inputErrorMessage: "打开原因不能为空",
         })
-          .then(async () => {
+          .then(async ({ value }) => {
             try {
               let puOrderIds = innerValue.map((order) => Number(order.id));
               let { code } = await orderApi.itemOpen({
                 puOrderIds,
+                closeReason: value,
               });
               if (code === 200) {
                 this.$emit("submit");
@@ -49,7 +62,7 @@ export default {
           .catch(() => {});
       } else {
         this.$notify.warning({
-          message: "存在已经完成打开的行",
+          message: "不满足打开条件",
         });
       }
     },
@@ -58,5 +71,7 @@ export default {
 };
 </script>
 <template>
-  <el-button :size="$attrs.size" @click="open">{{ title }}</el-button>
+  <el-button :size="$attrs.size" @click="open" :disabled="disabled">{{
+    title
+  }}</el-button>
 </template>

+ 28 - 30
src/views/purchase/purchase-order/column.js

@@ -222,6 +222,13 @@ const PurColumns = [
     },
   },
   { 
+    item:{ key: "closeReason", title: "关闭原因" ,width:100,},
+    attr:{
+      isHidden:true,
+    },
+  },
+  
+  { 
     item:{ key: "approverName", title: "审批人" ,width:100,},
     attr:{
       isHidden:true,
@@ -731,6 +738,7 @@ const CauseColumns = [
       isHidden:true,
     },
   },
+  
   { 
     item:{ key: "approverName", title: "审批人" ,width:100,},
     attr:{
@@ -806,6 +814,12 @@ const PurTabColumns = [
         },
       },
       { 
+        item:{ key: "goodsAllocationName", title: "货位",width:100,},
+        attr:{
+          isHidden:true,
+        },
+      },
+      { 
         item:{
           key: "rowNo", title: "行号",width:80,},
         attr:{
@@ -869,6 +883,7 @@ const PurTabColumns = [
           isSummary:true,
         },
       },
+     
       {
         item:{
           
@@ -1074,8 +1089,9 @@ const PurTabColumns = [
           isSummary:true,
         },
       },
+      
       { 
-        item:{ key: "goodsAllocationName", title: "货位",width:100,},
+        item:{ key: "closeReason", title: "行关闭/打开原因",width:100,},
         attr:{
           isHidden:true,
         },
@@ -1104,12 +1120,20 @@ const CommonTabColumns = [
     key: 'puOrderItemList',
     tableColumns: [
       { 
+        item:{ key: "goodsAllocationName", title: "货位",width:100,},
+        attr:{
+          isHidden:true,
+        },
+        
+      },
+      { 
         item:{
           key: "rowNo", title: "行号",width:80,},
         attr:{
           isHidden:true,
         },
       },
+      
       // { item:{key: "orderId", title: "采购订单ID" },
       { 
         item:{ key: "demandCode", title:"采购需求单号",width:150,},
@@ -1245,28 +1269,17 @@ const CommonTabColumns = [
         item:{key: "money", title: "价税合计" ,width:120, },
         attr:{
           isSummary:true,
-          // is: "el-computed-input-v2",
-          // formatter: (prop) => {
-          //   return prop ? (prop * 1).toFixed(2) : prop;
-          // },
         },
       },
+      
       { 
         item:{key: "tax", title: "税率" ,width:120, },
         attr:{
-          // is: "el-computed-input-v2",
-          // formatter: (prop) => {
-          //   return prop ? (prop * 1).toFixed(2) : prop;
-          // },
         },
       },
       { 
         item:{key: "taxDeductMoneya", title: "折扣金额", width:80,  },
         attr:{
-          // is: "el-computed-input-v2",
-          // formatter: (prop) => {
-          //   return prop ? (prop * 1).toFixed(2) : prop;
-          // },
           isSummary:true,
         },
       },
@@ -1290,39 +1303,23 @@ const CommonTabColumns = [
       { 
         item:{key: "arrivalQty", title: "已到货数量" , width:80,},
         attr:{
-          // is: "el-computed-input-v2",
-          // formatter: (prop) => {
-          //   return prop ? (prop * 1).toFixed(2) : prop;
-          // },
           isSummary:true,
         },
       },
       { 
         item:{key: "unarrivedQty", title: "未到货数量" , width:80,},
         attr:{
-          // is: "el-computed-input-v2",
-          // formatter: (prop) => {
-          //   return prop ? (prop * 1).toFixed(2) : prop;
-          // },
           isSummary:true,
         },
       },
       { 
         item:{key: "price", title: "无税单价" , width:120, },
         attr:{
-          // is: "el-computed-input-v2",
-          // formatter: (prop) => {
-          //   return prop ? (prop * 1).toFixed(2) : prop;
-          // },
         },
       },
       { 
         item:{key: "notaxMoney", title: "无税金额" , width:120, },
         attr:{
-          // is: "el-computed-input-v2",
-          // formatter: (prop) => {
-          //   return prop ? (prop * 1).toFixed(2) : prop;
-          // },
           isSummary:true,
         },
       },
@@ -1655,8 +1652,9 @@ const CommonTabColumns = [
           isHidden:true,
         },
       },
+      
       { 
-        item:{ key: "goodsAllocationName", title: "货位",width:100,},
+        item:{ key: "closeReason", title: "行关闭/打开原因",width:100,},
         attr:{
           isHidden:true,
         },

+ 12 - 47
src/views/purchase/purchase-order/edit/index.vue

@@ -96,7 +96,6 @@ export default {
     // },
     "params.billType": {
       handler(nVal, oVal) {
-        // let billList = ['21-Cxx-02','21-Cxx-04','21-Cxx-10','21-Cxx-14','21-Cxx-09','21-Cxx-17','21-Cxx-18'];
         let billList = ["21-Cxx-02", "21-Cxx-04", "21-Cxx-10", "21-Cxx-14"];
 
         if (billList.find((item) => item === nVal)) {
@@ -116,7 +115,6 @@ export default {
     },
     "params.isBack": {
       handler(nVal, oVal) {
-        console.log(nVal, "val");
         if (nVal === "Y") {
           this.rules.retReasonName = [
             { required: true, message: "退换原因不能为空", trigger: "change" },
@@ -319,7 +317,6 @@ export default {
           //     return false
 
           //  }
-          //  console.log(isPrice,'isPrice');
           cb();
         } else {
           _this.$notify.error({
@@ -438,12 +435,14 @@ export default {
           } else if (
             key != "puOrg" &&
             key != "puOrgName" &&
-            key != "buyer" &&
-            key != "buyerName" &&
-            key != "puDept" &&
-            key != "puDeptName" &&
+            // key != "buyer" &&
+            // key != "buyerName" &&
+            // key != "puDept" &&
+            // key != "puDeptName" &&
             key != "status" &&
-            key != "billDate"
+            key != "billDate" &&
+            key != "createTime" &&
+            key != "source"
           ) {
             this.params[key] = "";
           } else {
@@ -656,40 +655,6 @@ export default {
         let { code, data } = await orderApi.orderImport(formData);
 
         if (code == 200) {
-          // this.tabLoading = true;
-          // // puOrderExecuteList puOrderItemList
-
-          // let size = 20;
-          // let num = 1;
-          // let total = Math.ceil(data['puOrderItemList'].length / size);
-
-          // let resultData = {...data};
-
-          // let intervalPush = setInterval(()=>{
-
-          //   if(num > total){
-
-          //     clearInterval(intervalPush);
-
-          //     this.tabLoading = false;
-
-          //     this.handleGetPrice();
-          //   }
-
-          //   for (const key in resultData) {
-
-          //     resultData[key].slice(size*(num-1), (size*num) ).forEach(item =>{
-
-          //       this.params[key].push(item);
-
-          //     })
-
-          //   }
-
-          //   num++;
-
-          // },200);
-
           for (const key in data) {
             this.params[key].push(...data[key]);
           }
@@ -828,7 +793,7 @@ export default {
               <dr-popover-select
                 v-if="column.inputType === 'PopoverSelect'"
                 v-model="params[column.key]"
-                size="mini"
+                :size="size"
                 :value-key="column.valueKey"
                 :source.sync="params"
                 :title="column.title"
@@ -954,7 +919,7 @@ export default {
               show-overflow
               beautify-table
               :ref="column.key"
-              :size="'mini'"
+              :size="size"
               :height="tabHeight"
               style="width: 100%"
               :data="params[column.key].filter((item) => item.delFlag === '0')"
@@ -1017,14 +982,14 @@ export default {
                               pkOrg: params.puOrg,
                             })
                       "
-                      size="mini"
+                      :size="size"
                       @change="handleTabReferChange"
                     ></dr-popover-select>
 
                     <el-select
                       v-if="cColumn.inputType === 'Select'"
                       v-model="scope.row[cColumn.key]"
-                      size="mini"
+                      :size="size"
                       :disabled="cColumn.disabled"
                       :clearable="cColumn.clearable"
                       :placeholder="cColumn.placeholder"
@@ -1080,7 +1045,7 @@ export default {
                       delTableRow(params[tabName], scope.row, tabName)
                     "
                     type="text"
-                    size="small"
+                    :size="size"
                   >
                     删行
                   </el-button>

+ 1 - 1
src/views/purchase/purchase-order/edit/initColumn.js

@@ -43,7 +43,7 @@ export const forbidden = (isEdit,source) => {
         tab.tableColumns.forEach(cColumn => {
 
           // || cColumn.key === 'qty'
-          if(cColumn.key === 'materialName' ){
+          if(cColumn.key === 'materialCode' ){
 
             cColumn.disabled = true;
 

+ 15 - 19
src/views/purchase/purchase-order/index.vue

@@ -40,10 +40,11 @@ export default {
   },
   data() {
     const initTabColumns = () => TabColumns;
+    const page = this.$init.page();
     return {
       loading: false,
       tabLoading: false,
-      page: { pageNum: 1, pageSize: 10, total: 0 },
+      page: page,
       searchColumns: SearchColumns,
       params: initParams(SearchColumns),
       // tableColumns: TableColumns,
@@ -163,6 +164,12 @@ export default {
       try {
         this.loading = true;
 
+        let { date } = data;
+
+        data.startDate = date ? date[0] : "";
+
+        data.endDate = date ? date[1] : "";
+
         params["isAsc"] = "desc";
 
         params["orderByColumn"] = "updateTime";
@@ -241,9 +248,10 @@ export default {
 
     // 刷新操作
     handleRefreshList() {
-      this.page.pageNum = 1;
+      // this.page.pageNum = 1;
 
-      this.page.pageSize = 10;
+      // this.page.pageSize = 10;
+      this.page = this.$init.page();
       this.$refs.purchaseTable.$refs.superTable &&
         this.$refs.purchaseTable.$refs.superTable.clearSelection();
 
@@ -261,21 +269,9 @@ export default {
 
       this.fetchList(this.params, this.page);
     },
-    // 查询操作
-    handleQueryList() {
-      let { date } = this.params;
-
-      this.params.startDate = date ? date[0] : "";
-
-      this.params.endDate = date ? date[1] : "";
-
-      this.fetchList(this.params, this.page);
-    },
     // 重置操作
     handleResetList() {
-      this.page.pageNum = 1;
-
-      this.page.pageSize = 10;
+      this.page = this.$init.page();
 
       this.params = initParams(SearchColumns);
 
@@ -691,7 +687,7 @@ export default {
       :dict="dict"
       :columns="searchColumns"
       @reset="handleResetList"
-      @submit="handleQueryList"
+      @submit="fetchList(params, page)"
     ></el-super-search>
 
     <!-- 操作 -->
@@ -753,7 +749,7 @@ export default {
           <zp-button
             :size="size"
             :select-data="checkedList"
-            @success="handleQueryList"
+            @success="fetchList(params, page)"
           >
           </zp-button>
           <zpjl-button :size="size" :select-data="checkedList"> </zpjl-button>
@@ -838,7 +834,7 @@ export default {
             @click.stop="jumpFlow(scope.row)"
             >流程跳转</el-button
           >
-          <!-- <Retrieve :data="handelRetrieve(scope.row)" @success="handleQueryList"></Retrieve> -->
+          <!-- <Retrieve :data="handelRetrieve(scope.row)" @success="fetchList(params, page)"></Retrieve> -->
         </template>
       </ux-table-column>
     </el-super-ux-table>

+ 12 - 22
src/views/purchase/purchase-order/see/index.vue

@@ -55,6 +55,7 @@ export default {
       tabColumns: NewTabColumns,
       tabName: "puOrderItemList",
       tableData: [], //虚拟滚动加载显示的数据
+      size: "mini",
     };
   },
   computed: {
@@ -120,7 +121,6 @@ export default {
     },
     // 发送NC
     async handleSendNC() {
-      console.log("发送NC");
 
       try {
         let { code } = await orderApi.toNc({ puOrderId: this.params.id });
@@ -203,7 +203,7 @@ export default {
     v-loading="loading"
   >
     <el-form
-      size="mini"
+      :size="size"
       label-position="right"
       label-width="140px"
       :model="params"
@@ -229,9 +229,8 @@ export default {
         >
           <h3>查看</h3>
           <div style="text-align: right">
-            <!-- <FilePrint :id="params.id"></FilePrint> -->
             <FilePrint v-model="printData"></FilePrint>
-            <el-button size="mini" @click="handleRefresh">刷新</el-button>
+            <el-button :size="size" @click="handleRefresh">刷新</el-button>
             <template v-if="judgeIsToNC()">
               <el-tooltip
                 class="box-item"
@@ -243,7 +242,7 @@ export default {
                 <el-button
                   :key="params.deliveryStatus"
                   :disabled="params.deliveryStatus === '1'"
-                  size="mini"
+                  :size="size"
                   type="primary"
                   @click="handleSendNC"
                   >{{
@@ -257,7 +256,7 @@ export default {
               </el-tooltip>
             </template>
 
-            <el-button size="mini" @click="handleCancel">取 消</el-button>
+            <el-button :size="size" @click="handleCancel">取 消</el-button>
           </div>
         </div>
         <el-row style="display: flex; flex-wrap: wrap">
@@ -314,7 +313,7 @@ export default {
                 v-if="column.inputType === 'Select'"
                 v-model="params[column.key]"
                 disabled
-                size="mini"
+                :size="size"
                 :clearable="column.clearable"
                 :placeholder="column.placeholder"
                 style="width: 100%"
@@ -397,14 +396,7 @@ export default {
             :label="column.title"
             :name="column.key"
           >
-            <!-- <virtual-scroll 
-              :data="params[column.key].filter(item => item.delFlag === '0')" 
-              :item-size="53" 
-              :key-prop="column.key === 'puOrderItemList' ? 'rowNo' :'rowno'" 
-              @change="(virtualList) => tableData = virtualList" 
-              :virtualized="true"
-            >
-              <template slot-scope="{ headerCellFixedStyle, cellFixedStyle }"> -->
+           
             <ux-grid
               border
               use-virtual
@@ -412,7 +404,7 @@ export default {
               show-summary
               show-overflow
               beautify-table
-              :size="'mini'"
+              :size="size"
               :ref="column.key"
               :height="tabHeight"
               style="width: 100%"
@@ -453,7 +445,7 @@ export default {
                       :placeholder="cColumn.placeholder"
                       :clearable="cColumn.clearable"
                       readonly
-                      size="mini"
+                      :size="size"
                       style="width: 100%"
                     ></el-input>
 
@@ -470,7 +462,7 @@ export default {
                       :placeholder="cColumn.placeholder"
                       :data-mapping="cColumn.dataMapping"
                       :query-params="cColumn.queryParams"
-                      size="mini"
+                      :size="size"
                     ></dr-popover-select>
 
                     <el-input-number
@@ -481,7 +473,7 @@ export default {
                       :placeholder="cColumn.placeholder"
                       :clearable="cColumn.clearable"
                       disabled
-                      size="mini"
+                      :size="size"
                       style="width: 100%"
                     ></el-input-number>
 
@@ -489,7 +481,7 @@ export default {
                       v-if="cColumn.inputType === 'Select'"
                       v-model="scope.row[cColumn.key]"
                       disabled
-                      size="mini"
+                      :size="size"
                       :clearable="cColumn.clearable"
                       :placeholder="cColumn.placeholder"
                       style="width: 100%"
@@ -513,8 +505,6 @@ export default {
                 </template>
               </ux-table-column>
             </ux-grid>
-            <!-- </template>
-          </virtual-scroll> -->
           </el-tab-pane>
         </el-tabs>
       </el-card>