435881d494e2be4ba5ce8bfccb02d6ef49e07314..7aaff69bb11a4d75882d25bd1bc8e9748c2bd609
2 天以前 spring
完成报工前端页面,除库存接收外
7aaff6 对比 | 目录
2 天以前 spring
添加主页菜单
190dfa 对比 | 目录
已修改5个文件
已添加6个文件
2776 ■■■■■ 文件已修改
components/modal/modal-bg.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/components/saveForm.vue 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/index.scss 122 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/index.vue 684 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/index0.scss 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/index0.vue 489 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/orderList.vue 312 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/sys/home/index.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/moveWareHouse/index.vue 829 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/custom/moda-lbg.png 补丁 | 查看 | 原始文档 | blame | 历史
components/modal/modal-bg.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<template>
  <u-modal v-model="showModal" title="" :show-cancel-button="showCancelButton" @confirm="confirm" @cancel="cancel">
    <view class="slot-content">
      <slot></slot>
    </view>
  </u-modal>
</template>
<script>
export default {
  props: {
    showCancelButton: {
      type: Boolean,
      default: true
    },
    confirm: {
      type: Function,
      default: () => { }
    }
  },
  data() {
    return {
      showModal: false
    }
  },
  methods: {
    open() {
      this.showModal = true;
    },
    cancel() {
      this.showModal = false;
    },
  }
}
</script>
<style lang="scss" scoped>
::v-deep .u-model__title {
  padding-top: 0 !important;
}
.slot-content {
  min-height: 400rpx;
  box-sizing: border-box;
  padding-top: 250rpx;
  background: url(../../static/custom/moda-lbg.png) no-repeat center / 100% 100% !important;
}
</style>
pages.json
@@ -680,6 +680,7 @@
      }
    },
    // ç”Ÿäº§ç›¸å…³
    // æŠ¥å·¥
    {
      "path": "pages/product/report/index",
      "style": {
@@ -689,14 +690,24 @@
          "titleNView": {
            "buttons": [
              {
                "text": "清空",
                "text": "提交",
                "type": "none",
                "color": "#ffffff",
                "fontSize": "14px"
                "fontSize": "14px",
                "marginRight": "10px"
              }
            ]
          }
        }
      }
    },
    // è½¦é—´è®¢å•列表
    {
      "path": "pages/product/report/orderList",
      "style": {
        "navigationStyle": "custom",
        "navigationBarTextStyle": "white",
        "navigationBarBackgroundColor": "#3281FF"
      }
    },
    // æ—¥æŠ¥ç›¸å…³
@@ -789,7 +800,7 @@
        "pagePath": "pages/sys/home/index",
        "iconPath": "static/custom/tabbar/home_1.png",
        "selectedIconPath": "static/custom/tabbar/home_2.png",
        "text": "主页"
        "text": "工作台"
      },
      {
        "pagePath": "pages/sys/user/index",
pages/product/report/components/saveForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,140 @@
<template>
  <u-modal v-model="show" ref="uModal" title="" :show-cancel-button="true" @confirm="confirm" @cancel="cancel"
    :async-close="true">
    <view style="padding: 20rpx;">
      <u-form :model="form" ref="uFormSave" :label-width="280" :rules="rules" :error-type="['toast']">
        <u-form-item label="批号" :border-bottom="false" prop="value0">
          <u-input v-model="form.value0" disabled />
        </u-form-item>
        <u-form-item label="长度" :border-bottom="false" prop="value1">
          <u-input v-model="form.value1" />
        </u-form-item>
        <u-form-item label="库位" :border-bottom="false" prop="value2">
          <u-input v-model="form.value2" disabled />
        </u-form-item>
        <u-form-item label="盘号" :border-bottom="false" prop="value3">
          <u-input v-model="form.value3" />
        </u-form-item>
        <u-form-item label="毛重" :border-bottom="false" prop="value4">
          <u-input v-model="form.value4" />
        </u-form-item>
        <u-form-item label="净重" :border-bottom="false" prop="value5">
          <u-input v-model="form.value5" />
        </u-form-item>
        <u-form-item label="工序" :border-bottom="false" prop="value6">
          <u-input v-model="form.value6" disabled />
        </u-form-item>
        <u-form-item label="成品外径测量值" :border-bottom="false" prop="value7">
          <u-input v-model="form.value7" />
        </u-form-item>
        <u-form-item label="退火电压" :border-bottom="false" prop="value8">
          <u-input v-model="form.value8" />
        </u-form-item>
        <u-form-item label="转速" prop="value9" :border-bottom="false">
          <u-input v-model="form.value9" />
        </u-form-item>
        <u-form-item label="外部气压" prop="value10" :border-bottom="false">
          <u-input v-model="form.value10" />
        </u-form-item>
        <u-form-item label="生产速度" prop="value11" :border-bottom="false">
          <u-input v-model="form.value11" />
        </u-form-item>
      </u-form>
    </view>
  </u-modal>
</template>
<script>
export default {
  data() {
    return {
      show: false,
      form: {
        value0: null,
        value1: null,
        value2: null,
        value3: null,
        value4: null,
        value5: null,
        value6: null,
        value7: null,
        value8: null,
        value9: null,
        value10: null,
        value11: null
      },
      rules: {
        value1: [
          { required: true, message: '请输入长度', trigger: ['blur', 'change'] },
        ],
        value3: [
          { required: true, message: '请输入盘号', trigger: ['blur', 'change'] },
        ],
        value4: [
          { required: true, message: '请输入毛重', trigger: ['blur', 'change'] },
        ],
        value5: [
          { required: true, message: '请输入净重', trigger: ['blur', 'change'] },
        ],
        value7: [
          { required: true, message: '请输入成品外径测量值', trigger: ['blur', 'change'] },
        ],
        value8: [
          { required: true, message: '请输入退火电压', trigger: ['blur', 'change'] },
        ],
        value9: [
          { required: true, message: '请输入转速', trigger: ['blur', 'change'] },
        ],
        value10: [
          { required: true, message: '请输入外部气压', trigger: ['blur', 'change'] }
        ],
        value11: [
          { required: true, message: '请输入生产速度', trigger: ['blur', 'change'] }
        ]
      },
    }
  },
  watch: {
    show(val) {
      if (val) {
        this.$nextTick(() => {
          this.$refs.uFormSave.setRules(this.rules);
        });
      }
    },
  },
  methods: {
    confirm() {
      this.$refs.uFormSave.validate((valid) => {
        if (valid) {
          console.log('验证通过');
          // æ‰§è¡Œæäº¤é€»è¾‘(如API请求)
          // æäº¤æˆåŠŸåŽå…³é—­æ¨¡æ€æ¡†
          this.$refs.uModal.cancel();
        } else {
          console.log('验证失败');
          // æ˜¾ç¤ºé”™è¯¯ä¿¡æ¯
          this.$refs.uModal.clearLoading(); // æ¸…除加载状态
        }
      });
    },
    cancel() {
      this.show = false;
    },
    open() {
      this.show = true;
    }
  },
}
</script>
<style lang="scss" scoped>
::v-deep .u-model__title {
  padding-top: 0 !important;
}
::v-deep .u-input__input {
  text-align: right !important;
}
</style>
pages/product/report/index.scss
@@ -1,113 +1,29 @@
.body {
  background: linear-gradient(to bottom, #e5f0ff, #f6f9ff);
.page {
  box-sizing: border-box;
  padding-top: 26rpx;
  height: 100vh;
  padding: 30rpx;
}
.top_code {
  height: 80rpx;
.u-checkbox-group {
  display: flex;
  align-items: center;
  margin: 0 30rpx;
  margin-bottom: 10rpx;
  flex-direction: column;
}
.top_code_edit {
  text-align: right;
  flex: 1;
  margin-bottom: 18rpx;
}
.main_view {
  margin-top: 5rpx;
  background-image: url("~@/static/custom/home/home_img_bg.png");
  background-repeat: no-repeat;
  background-size: 100% auto;
  border-radius: 15rpx;
  height: 936rpx;
  margin: 0 30rpx;
  box-sizing: border-box;
  padding: 37rpx 25rpx;
.u-form-item {
  padding: 0;
}
.product-number-icon {
  background-image: url("~@/static/custom/daily/icon_number.png");
  background-repeat: no-repeat;
  background-size: cover;
  height: 32rpx;
  width: 32rpx;
  position: relative;
  margin-right: 8rpx;
}
.product-edit-icon {
  background-image: url("~@/static/custom/daily/icon_edit.png");
  background-repeat: no-repeat;
  background-size: cover;
  height: 32rpx;
  width: 32rpx;
  position: relative;
}
.icon_history {
  background-image: url("~@/static/custom/daily/icon_history.png");
  background-repeat: no-repeat;
  background-size: cover;
  height: 26rpx;
  width: 26rpx;
  margin-right: 8rpx;
  position: relative;
}
.icon_save {
  background-image: url("~@/static/custom/daily/icon_save.png");
  background-repeat: no-repeat;
  background-size: cover;
  height: 26rpx;
  width: 26rpx;
  margin-right: 8rpx;
  position: relative;
}
.icon_right {
  background-image: url("~@/static/custom/daily/icon_right.png");
  background-repeat: no-repeat;
  background-size: cover;
  height: 26rpx;
  width: 26rpx;
  margin-right: 8rpx;
  position: relative;
}
.main_top_title {
  font-weight: 800;
  font-size: 34rpx;
  color: #1d2541;
  margin-bottom: 20rpx;
}
.main_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 30rpx;
  line-height: 112rpx;
  border-bottom: 1rpx solid rgba(213, 213, 213, 0.67);
  box-sizing: border-box;
  .value2 {
    width: 450rpx; /*盒子最大宽度*/
    overflow: hidden;
    text-overflow: ellipsis; /* è®¾ç½®æ–‡æœ¬æº¢å‡ºæ—¶æ˜¾ç¤ºçœç•¥å· */
    white-space: nowrap; /* è®¾ç½®ä¸æ¢è¡Œ */
    text-align: right;
    padding-left: 40rpx;
.packer-popup {
  ::v-deep .u-mode-center-box {
    border-radius: 30rpx;
  }
}
.btns {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 33rpx;
  .uni-button {
  .popup-row {
    background-image: url("~@/static/custom/packing/row_bg.png");
    background-size: 100% auto;
    background-repeat: no-repeat;
    height: 89rpx;
    width: 520rpx;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  ::v-deep.u-icon__icon {
    height: 26rpx;
    width: 26rpx;
    justify-content: space-between;
    padding-top: 12rpx;
    padding-left: 14rpx;
    padding-right: 20rpx;
  }
}
pages/product/report/index.vue
@@ -1,486 +1,214 @@
<template>
    <view class="body">
        <view class="top_code">
            <u-icon class="product-number-icon"></u-icon>编号:
            <text selectable>{{ dutyNo }}</text>
            <view class="top_code_edit">
                <u-icon class="product-edit-icon" @click="edit" v-show="true"></u-icon>
            </view>
        </view>
        <view class="main_view">
            <h3 class="main_top_title">工作台</h3>
            <view class="main_item" @click="goPage(0)">
                <span style="color:#4F4F4F">工作站</span>
                <view>
                    <span style="color:#333333;margin-right: 20rpx;">{{ query.workstationName }}</span>
                    <u-icon v-if="isShowButton" name="arrow-right" color="#687792" size="28"></u-icon>
                </view>
            </view>
            <view class="main_item" @click="goPage(1)">
                <span style="color:#4F4F4F">工序</span>
                <view>
                    <span style="color:#333333;margin-right: 20rpx;">{{ query.operationName }}</span>
                    <u-icon v-if="isShowButton" name="arrow-right" color="#687792" size="28"></u-icon>
                </view>
            </view>
            <view class="main_item" @click="goPage(2)">
                <span style="color:#4F4F4F">日期</span>
                <view>
                    <span style="color:#333333;margin-right: 20rpx;">{{ query.updateTime }}</span>
                    <u-icon v-if="isShowButton" name="arrow-right" color="#687792" size="28"></u-icon>
                </view>
            </view>
            <view class="main_item" @click="goPage(3)">
                <span style="color:#4F4F4F">班次</span>
                <view>
                    <span style="color:#333333;margin-right: 20rpx;">{{ query.clazzType }}</span>
                    <u-icon v-if="isShowButton" name="arrow-right" color="#687792" size="28"></u-icon>
                </view>
            </view>
            <view class="main_item" @click="goPage(4)">
                <span style="color:#4F4F4F;width: 118rpx;">生产人员</span>
                <view class="value2">
                    <span style="color:#333333;margin-right: 20rpx;">{{ staffNameJoin }}</span>
                </view>
                <u-icon v-if="isShowButton" name="arrow-right" color="#687792" size="28"></u-icon>
            </view>
            <view class="main_item">
                <span style="color:#4F4F4F">创建人</span>
                <view>
                    <span style="color:#333333;">{{ query.createUser }}</span>
                </view>
            </view>
            <view class="btns">
                <u-button :custom-style="customStyle" @click="goPage(9)">杂工</u-button>
                <u-button :custom-style="customStyle" style="width: 150rpx;" @click="goPage(6)">
                    <u-icon class="icon_history" size="26rpx" />
                    <span style="line-height: 40rpx;">历史</span>
                </u-button>
                <u-button v-if="isShowButton" @click="submit" :custom-style="customStyle"
                    style="background: #30AFFF;color: #fff;border: 0;width: 150rpx;">
                    <u-icon class="icon_save" size="26rpx" />
                    <span style="line-height: 40rpx;">保存</span>
                </u-button>
                <u-button :custom-style="customStyle" style="background: #214DED;color: #fff;border: 0;width: 150rpx;"
                    @click="goPage(8)">
                    <u-icon class="icon_right" size="26rpx" />
                    <span style="line-height: 40rpx;">报工</span></u-button>
            </view>
        </view>
        <u-calendar v-model="calendarShow" :mode="mode" @change="changeCalendar"></u-calendar>
        <!--工序下拉框-->
        <u-select :default-value="[operationIndex]" v-model="selectShowOperation" :list="operationList"
            @confirm="confirmOperation"></u-select>
        <u-select v-model="selectShowClazzType" :list="clazzTypeList" @confirm="confirmClazzType"></u-select>
        <u-toast ref="uToast" />
    </view>
  <!-- æŠ¥å·¥ -->
  <div class="page">
    <u-form :model="form" ref="uForm" :label-width="200" :rules="rules" :error-type="['toast']">
      <u-form-item label="车间" :border-bottom="false" prop="value0">
        <u-radio-group v-model="form.value0">
          <u-radio name="导体">导体</u-radio>
          <u-radio name="铜杆">铜杆</u-radio>
        </u-radio-group>
      </u-form-item>
      <u-form-item label="报工单号" :border-bottom="false" prop="value1">
        <u-input v-model="form.value1" type="select" placeholder="请扫描报工单号" @click="open" />
      </u-form-item>
      <u-form-item label="工序" :border-bottom="false" prop="value2">
        <u-input v-model="form.value2" type="select" placeholder="请扫描报工单号" />
      </u-form-item>
      <u-form-item label="订单号" :border-bottom="false" prop="value3">
        <u-input v-model="form.value3" type="select" placeholder="点击选择" @click="openList" />
      </u-form-item>
      <u-form-item label="零件号" :border-bottom="false" prop="value4">
        <u-input v-model="form.value4" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="零件描述" :border-bottom="false" prop="value5">
        <u-input v-model="form.value5" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="批量大小" :border-bottom="false" prop="value6">
        <u-input v-model="form.value6" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="剩余数量" :border-bottom="false" prop="value7">
        <u-input v-model="form.value7" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="库位" :border-bottom="false" prop="value8">
        <u-input v-model="form.value8" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="报工类型" prop="value9">
        <u-radio-group v-model="form.value9">
          <u-radio name="下机报工">下机报工</u-radio>
          <u-radio name="未下机报工">未下机报工</u-radio>
        </u-radio-group>
      </u-form-item>
      <u-form-item label="接收零件" prop="value10">
        <u-radio-group v-model="form.value10">
          <u-radio name="车间订单">车间订单</u-radio>
          <u-radio name="替代零件">替代零件</u-radio>
        </u-radio-group>
      </u-form-item>
      <u-form-item label="物料和工序" prop="value11">
        <u-checkbox-group>
          <u-checkbox :name="item.name" v-for="(item, index) in checkboxList" :key="index" v-model="item.value"
            @change="changeCheckbox">
            {{ item.name }}
          </u-checkbox>
        </u-checkbox-group>
      </u-form-item>
      <u-form-item label="库存接收" :border-bottom="false" prop="value12"></u-form-item>
    </u-form>
    <!-- å¡«å†™æŠ¥å·¥å• -->
    <modalBg ref="modalBg" :confirm="confirm">
      <u-field v-model="form.value1" label="报工单号" placeholder="请输入" :border-bottom="false">
      </u-field>
    </modalBg>
    <saveForm ref="saveForm" />
  </div>
</template>
<script>
import {
    dateFormat
} from "@/utils/date.js";
import UIcon from "../../../uview-ui/components/u-icon/u-icon.vue";
import modalBg from '@/components/modal/modal-bg.vue'
import saveForm from './components/saveForm.vue'
export default {
    components: {
        UIcon
    },
    data() {
        return {
            customStyle: {
                'background': '#FFFFFF',
                'border-radius': '8rpx',
                'border': '1px solid #D2D2D2',
                'width': '121rpx',
                'height': '65rpx',
                'font-weight': 500,
                'font-size': '28rpx',
                'color': '#333333',
                'pading': '0 30rpx'
            },
            calendarShow: false,
            selectShowOperation: false,
            selectShowClazzType: false,
            mode: 'date',
            id: '',
            dutyNo: '', // ç¼–号
            query: {
                updateTime: dateFormat(
                    new Date(), 'yyyy-MM-dd'),
                workstationName: '', // å·¥ä½œç«™åç§°
                workstationId: '', // å·¥ä½œç«™id
                clazzType: '', // ç­æ¬¡
                productionUser: '',
                operationId: '', // å·¥åºid
                operationName: '', // å·¥åºåç§°
                userList: [],
                createUser: ''
            },
            toId: '',
            operationList: [],
            clazzTypeList: [{
                label: '白班'
            },
            {
                label: '晚班'
            },
            ],
            workstation: '',
            staffNameJoin: '',
            operationIndex: '',
            isEdit: false, // æ˜¯å¦ä¿®æ”¹
            isShowButton: false,
            workCenter: '',
            addOrEdit: '',
            info: {},
            firstOperationId: null,
            lastOperationId: null,
        }
    },
    onShow() {
        // this.getLastDutyRecordFun()
    },
    onLoad() {
        uni.$on('dailyListInfo', (info) => {
            this.dutyNo = info.dutyNo
            this.id = info.id
            this.query.createUser = this.vuex_username
            this.query.clazzType = info.clazzType
            this.query.workstationId = info.workstationId
            this.query.workstationName = info.workstationName
            this.query.productionUser = info.productionUser.split(',').reverse()
            this.query.userList = info.productionUserList.split(',')
            this.query.operationId = info.operationId
            this.getOperation()
        })
        uni.$on('returnData', (data) => {
            // ä¸´æ—¶å­˜å‚¨å·¥ä½œç«™çš„æ•°æ®
            this.workstation = data
            // ç»™é¡µé¢å·¥ä½œç«™èµ‹å€¼
            this.query.workstationName = '(' + data.workCenter + ')' + data.name
            this.query.workstationId = data.id
            // æ¸…空工序选项
            this.query.operationName = ''
            this.query.operationId = ''
            this.operationIndex = 0
            this.getOperationTaskFun(data.workCenter)
        })
        uni.$on('checkedList', (data) => {
            let staffNameList = []
            let staffNoList = []
            data.forEach(i => {
                staffNameList.push(i.staffName)
                staffNoList.push(i.staffNo)
            })
            this.query.productionUser = staffNameList
            this.query.userList = staffNoList
        });
    },
    onReady() {
        // é¦–次进入页面获取当前登录人最后一次提交的日报
        this.getLastDutyRecordFun()
    },
    methods: {
        isNotOperationName(workCenter, operationName, workCenterTwo) {
            // åˆ¤æ–­æ˜¯å¦ä¸ºè¯¥å·¥ä½œç«™
            if (workCenter.includes(workCenterTwo)) {
                // åˆ¤æ–­æ˜¯å¦åŒ…含工序名称
                if (!operationName.includes(this.query.operationName)) {
                    return true
                } else {
                    return false
                }
            } else {
                return false
            }
        },
        // åˆ¤æ–­å·¥å•是否等于,同时判断是否为第一道工序
        isFirstOperationId(workCenter, workCenterTwo) {
            if (workCenter.includes(workCenterTwo)) {
                // åˆ¤æ–­æ˜¯å¦ä¸ä¸ºç¬¬ä¸€é“工序
                if (this.query.operationId !== this.firstOperationId) {
                    return true
                } else {
                    return false
                }
            } else {
                return false
            }
        },
        // é¦–次进入页面获取当前登录人最后一次提交的日报
        getLastDutyRecordFun() {
            this.$u.api.dailyPaper.getLastDutyRecord().then(res => {
                if (res.code === 0) {
                    this.dutyNo = res.data.dutyNo
                    this.id = res.data.id
                    this.query.createUser = this.vuex_username
                    this.query.clazzType = res.data.clazzType
                    this.query.workstationId = res.data.workstationId
                    this.query.workstationName = res.data.workstationName
                    this.query.productionUser = res.data.productionUser.split(',').reverse()
                    this.query.userList = res.data.productionUserList.split(',')
                    this.query.operationId = res.data.operationId
                    this.getOperation()
                } else {
                    this.$u.toast(res.msg)
                }
            })
        },
        // æ¸…空逻辑
        onNavigationBarButtonTap(e) {
            this.isEdit = true
            this.isShowButton = true
            this.addOrEdit = 'add'
            this.query.productionUser = ''
            this.query.productionUserList = []
            this.staffNameJoin = ''
            this.query.updateTime = ''
        },
        edit() {
            this.isEdit = !this.isEdit
            this.isShowButton = this.isEdit
            this.addOrEdit = 'edit'
        },
        goPage(index) {
            switch (index) {
                // è·³è½¬åˆ°åŽ†å²é¡µé¢
                case 6:
                    uni.navigateTo({
                        url: '/pages/daily/daily/daily-list'
                    })
                    break;
                // è·³è½¬åˆ°æŠ¥å·¥é¡µé¢
                case 8:
                    if (this.isEdit) {
                        this.$refs.uToast.show({
                            title: '请先保存修改',
                            type: 'warning '
                        })
                        return
                    }
                    let workCenter = this.query.workstationName.split(')')[0].substring(1)
                    let operation = this.query.workstationName.split(')')[1]
                    console.log(workCenter, operation, this.firstOperationId, this.query.operationId, this.query)
                    if (workCenter == "TM-01" || workCenter == "JG-01" || workCenter == "YB-04" || this.isFirstOperationId('DY-01,GY-01,YB-01,YB-02', workCenter) || this.isNotOperationName('ZZ-02', '二装,注油', workCenter)) {
                        let item = {
                            workstationId: this.query.workstationId,
                            clazzType: this.query.clazzType,
                            dutyNo: this.dutyNo,
                            userStaffNo: this.query.userList,
                            workstationName: this.query.workstationName,
                            staffNameJoin: this.staffNameJoin,
                            workCenter: workCenter,
                            operationId: this.query.operationId,
                            firstOperationId: this.firstOperationId,
                            lastOperationId: this.lastOperationId
                        }
                        uni.navigateTo({
                            url: '/pages/daily/common/work-reporting?info=' + encodeURIComponent(JSON
                                .stringify(item))
                        })
                    } else if (this.query.workstationName.includes("TX-02") && !this.query.operationName.includes("叠装")) {
                        let item = {
                            workstationId: this.query.workstationId,
                            clazzType: this.query.clazzType,
                            dutyNo: this.dutyNo,
                            userStaffNo: this.query.userList,
                            workstationName: this.query.workstationName,
                            staffNameJoin: this.staffNameJoin,
                            workCenter: "TX-02",
                            operationId: this.query.operationId,
                            firstOperationId: this.firstOperationId,
                            lastOperationId: this.lastOperationId
                        }
                        uni.navigateTo({
                            url: '/pages/daily/common/work-reporting?info=' + encodeURIComponent(JSON
                                .stringify(item))
                        })
                    } else {
                        uni.navigateTo({
                            url: `/pages/daily/common/work-order-list?workstationId=${this.query.workstationId}&toId=${this.toId}&clazzType=${this.query.clazzType}&dutyNo=${this.dutyNo}&userStaffNo=${this.query.userList}&workstationName=${this.query.workstationName}&staffNameJoin=${this.staffNameJoin}`
                        })
                    }
                    break;
                // è·³è½¬åˆ°æ‚工页面
                case 9:
                    if (this.isEdit) {
                        this.$refs.uToast.show({
                            title: '请先保存修改',
                            type: 'warning '
                        })
                        return
                    }
                    uni.navigateTo({
                        url: `/pages/daily/handyman/handyman?dutyNo=${this.query.dutyNo}&updateTime=${this.query.updateTime}&userList=${this.query.productionUser}&staffList=${this.query.userList}`
                    })
                    break;
            }
            if (!this.isEdit) {
                return
            } else {
                switch (index) {
                    case 0:
                        uni.navigateTo({
                            url: '/pages/daily/workstation/index'
                        })
                        break;
                    case 1:
                        if (!this.query.workstationName) {
                            this.$refs.uToast.show({
                                title: '请先选择工作站',
                                type: 'warning '
                            })
                        } else {
                            this.selectShowOperation = true;
                        }
                        break;
                    case 2:
                        this.calendarShow = true;
                        break;
                    case 3:
                        this.selectShowClazzType = true;
                        break;
                    case 4:
                        let staffList = this.query.productionUser
                        let staffNoList = this.query.userList
                        const list = []
                        for (const i in staffList) {
                            const obj = {
                                staffName: staffList[i],
                                staffNo: staffNoList[i]
                            }
                            list.push(obj)
                        }
                        uni.navigateTo({
                            url: '/pages/daily/production-person/production-person?list=' + encodeURIComponent(
                                JSON.stringify(list))
                        })
                        break;
                }
            }
        },
        // æäº¤æ—¥æŠ¥ä¿®æ”¹
        submit() {
            if (!this.query.workstationId) {
                this.$u.toast('请选择工作站')
                return
            } else if (!this.query.operationId) {
                this.$u.toast('请选择工序')
                return
            } else if (!this.query.clazzType) {
                this.$u.toast('请选择班次')
                return
            } else if (!this.query.productionUser) {
                this.$u.toast('请选择生产人员')
                return
            } else if (!this.query.updateTime) {
                this.$u.toast('请选择时间')
                return
            }
            let params = JSON.parse(JSON.stringify(this.query))
            this.$delete(params, 'productionUser')
            this.$delete(params, 'productionUserList')
            params.updateTime = params.updateTime + ' 00:00:00'
            params.id = null
            if (this.addOrEdit === 'add') {
                this.$u.api.dailyPaper.addDailyPaper(params).then(res => {
                    if (res.code === 0) {
                        // this.getLastDutyRecordFun()
                        this.query.createUser = this.vuex_username
                        this.$u.toast('保存成功')
                        this.isShowButton = false
                        this.getLastDutyRecordFun()
                    }
                })
            } else {
                params.id = this.id
                this.$u.api.dailyPaper.editDailyPaper(params).then(res => {
                    if (res.code === 0) {
                        // this.getLastDutyRecordFun()
                        this.$u.toast('修改成功')
                        this.isShowButton = false
                    }
                })
            }
            this.isEdit = false
        },
        changeCalendar(e) {
            this.query.updateTime = e.result;
        },
        confirmOperation(e) {
            this.query.operationName = e[0].label
            this.query.operationId = e[0].value
            const index = this.operationList.findIndex(item => item.value === this.query.operationId)
            if (index > -1) {
                this.operationIndex = index
                this.toId = this.operationList[index].value
            }
        },
        confirmClazzType(e) {
            this.query.clazzType = e[0].label
        },
        // æŸ¥è¯¢å·¥ä½œç«™
        getOperation() {
            this.$u.api.dailyPaper.getWorkstation().then(res => {
                if (res.code === 0) {
                    const index = res.data.findIndex(item => item.name === this.query.workstationName)
                    if (index > -1) {
                        this.workCenter = res.data[index].workCenter
                    }
                    this.query.workstationName = '(' + this.workCenter + ')' + this.query.workstationName
                    this.getOperationTaskFun(this.workCenter, this.query.operationId)
                }
            })
        },
        getOperationTaskFun(id, operationId) {
            this.operationList = []
            const params = {
                workCenter: id,
                current: 1,
                size: -1
            }
            // æŸ¥è¯¢å·¥åºåˆ—表
            this.$u.api.dailyPaper.getOperation(params).then(res => {
                if (res.code === 0) {
                    if (res.data.records.length > 0) {
                        res.data.records.forEach(i => {
                            const obj = Object.assign({
                                label: i.name,
                                value: i.id,
                            })
                            this.operationList.push(obj)
                        })
                        if (operationId) {
                            const index = this.operationList.findIndex(item => item.value === operationId)
                            if (index > -1) {
                                this.operationIndex = index
                                this.query.operationName = this.operationList[index].label
                                this.toId = this.operationList[index].value
                            }
                        }
                        this.firstOperationId = this.operationList[0].value
                        this.lastOperationId = this.operationList[this.operationList.length - 1].value
                    }
                }
            })
        }
    },
    watch: {
        'query.productionUser': {
            handler(newName, oldName) {
                if (this.query.productionUser.length > 0) {
                    this.staffNameJoin = this.query.productionUser.join()
                } else {
                    this.staffNameJoin = ''
                }
            },
            immediate: true,
            deep: true
        }
    }
  components: { modalBg, saveForm },
  data() {
    return {
      checkboxList: [
        {
          name: '倒冲',
          value: false
        },
        {
          name: '工序的自动报告',
          value: false
        },
        {
          name: '简化物料检查',
          value: false
        }
      ],
      form: {
        value0: '',
        value1: '',
        value2: '',
        value3: '',
        value4: '',
        value5: '',
        value6: '',
        value7: '',
        value8: '',
        value9: '下机报工',
        value10: '车间订单',
        value11: [], // å¤é€‰æ¡†ç»„的值
        value12: ''
      },
      rules: {
        value0: [
          {
            required: true,
            message: '请选择车间',
            trigger: ['change']
          }
        ],
        value1: [
          {
            required: true,
            message: '请选择报工单号',
            trigger: ['change', 'blur']
          }
        ],
        value2: [
          {
            required: true,
            message: '请选择工序',
            trigger: ['change', 'blur']
          }
        ],
        value3: [
          {
            required: true,
            message: '请选择订单号',
            trigger: ['change', 'blur']
          }
        ],
        value9: [
          {
            required: true,
            message: '请选择报工类型',
            trigger: ['change']
          }
        ],
        value10: [
          {
            required: true,
            message: '请选择接收零件类型',
            trigger: ['change']
          }
        ],
        value11: [
          {
            type: 'array',
            required: true,
            message: '请至少选择一个物料和工序选项',
            trigger: ['change']
          }
        ]
      },
      showSave: false,
    }
  },
  // ç‚¹å‡»æäº¤æŒ‰é’®çš„事件处理函数
  onNavigationBarButtonTap() {
    this.form.value11 = this.checkboxList.filter(item => item.value).map(item => item.name);
    this.$refs.uForm.validate(valid => {
      if (valid) {
        console.log('验证通过');
        // å¤„理提交逻辑
        this.$refs.saveForm.open();
      } else {
        console.log('验证失败');
        // å¯ä»¥èŽ·å–å…·ä½“çš„é”™è¯¯ä¿¡æ¯
        const errors = this.$refs.uForm.getError();
        console.log('错误信息:', errors);
      }
    });
  },
  onReady() {
    this.$refs.uForm.setRules(this.rules);
  },
  methods: {
    // å¤šé€‰å¤„理
    changeCheckbox(val) {
      if (val.name === '倒冲') {
        this.checkboxList[2].value = false
      }
      if (val.name === '简化物料检查') {
        this.checkboxList[0].value = false
      }
    },
    // æ‰“开弹框--后面还需要监听扫码枪扫码结果,赋值给报工单号字段,然后打开弹框选择订单号等操作
    open() {
      this.$refs.modalBg.open();
    },
    // å¼¹æ¡†ä¿å­˜
    confirm() {
      console.log('保存', this.form.value1);
      // è¯·æ±‚接口,根据工单号查询其他信息并赋值
    },
    // é€‰æ‹©è®¢å•号
    openList() {
      if (this.form.value1 === '') {
        uni.showToast({
          title: '请先扫描或输入报工单号',
          icon: 'none'
        })
        return
      }
      uni.navigateTo({
        url: '/pages/product/report/orderList'
      })
    },
    setNo(val) {
      this.form.value3 = val
    }
  }
}
</script>
pages/product/report/index0.scss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,113 @@
.body {
  background: linear-gradient(to bottom, #e5f0ff, #f6f9ff);
  box-sizing: border-box;
  padding-top: 26rpx;
  height: 100vh;
}
.top_code {
  height: 80rpx;
  display: flex;
  align-items: center;
  margin: 0 30rpx;
  margin-bottom: 10rpx;
}
.top_code_edit {
  text-align: right;
  flex: 1;
  margin-bottom: 18rpx;
}
.main_view {
  margin-top: 5rpx;
  background-image: url("~@/static/custom/home/home_img_bg.png");
  background-repeat: no-repeat;
  background-size: 100% auto;
  border-radius: 15rpx;
  height: 936rpx;
  margin: 0 30rpx;
  box-sizing: border-box;
  padding: 37rpx 25rpx;
}
.product-number-icon {
  background-image: url("~@/static/custom/daily/icon_number.png");
  background-repeat: no-repeat;
  background-size: cover;
  height: 32rpx;
  width: 32rpx;
  position: relative;
  margin-right: 8rpx;
}
.product-edit-icon {
  background-image: url("~@/static/custom/daily/icon_edit.png");
  background-repeat: no-repeat;
  background-size: cover;
  height: 32rpx;
  width: 32rpx;
  position: relative;
}
.icon_history {
  background-image: url("~@/static/custom/daily/icon_history.png");
  background-repeat: no-repeat;
  background-size: cover;
  height: 26rpx;
  width: 26rpx;
  margin-right: 8rpx;
  position: relative;
}
.icon_save {
  background-image: url("~@/static/custom/daily/icon_save.png");
  background-repeat: no-repeat;
  background-size: cover;
  height: 26rpx;
  width: 26rpx;
  margin-right: 8rpx;
  position: relative;
}
.icon_right {
  background-image: url("~@/static/custom/daily/icon_right.png");
  background-repeat: no-repeat;
  background-size: cover;
  height: 26rpx;
  width: 26rpx;
  margin-right: 8rpx;
  position: relative;
}
.main_top_title {
  font-weight: 800;
  font-size: 34rpx;
  color: #1d2541;
  margin-bottom: 20rpx;
}
.main_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 30rpx;
  line-height: 112rpx;
  border-bottom: 1rpx solid rgba(213, 213, 213, 0.67);
  box-sizing: border-box;
  .value2 {
    width: 450rpx; /*盒子最大宽度*/
    overflow: hidden;
    text-overflow: ellipsis; /* è®¾ç½®æ–‡æœ¬æº¢å‡ºæ—¶æ˜¾ç¤ºçœç•¥å· */
    white-space: nowrap; /* è®¾ç½®ä¸æ¢è¡Œ */
    text-align: right;
    padding-left: 40rpx;
  }
}
.btns {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 33rpx;
  .uni-button {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  ::v-deep.u-icon__icon {
    height: 26rpx;
    width: 26rpx;
  }
}
pages/product/report/index0.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,489 @@
<template>
    <view class="body">
        <view class="top_code">
            <u-icon class="product-number-icon"></u-icon>编号:
            <text selectable>{{ dutyNo }}</text>
            <view class="top_code_edit">
                <u-icon class="product-edit-icon" @click="edit" v-show="true"></u-icon>
            </view>
        </view>
        <view class="main_view">
            <h3 class="main_top_title">工作台</h3>
            <view class="main_item" @click="goPage(0)">
                <span style="color:#4F4F4F">工作站</span>
                <view>
                    <span style="color:#333333;margin-right: 20rpx;">{{ query.workstationName }}</span>
                    <u-icon v-if="isShowButton" name="arrow-right" color="#687792" size="28"></u-icon>
                </view>
            </view>
            <view class="main_item" @click="goPage(1)">
                <span style="color:#4F4F4F">工序</span>
                <view>
                    <span style="color:#333333;margin-right: 20rpx;">{{ query.operationName }}</span>
                    <u-icon v-if="isShowButton" name="arrow-right" color="#687792" size="28"></u-icon>
                </view>
            </view>
            <view class="main_item" @click="goPage(2)">
                <span style="color:#4F4F4F">日期</span>
                <view>
                    <span style="color:#333333;margin-right: 20rpx;">{{ query.updateTime }}</span>
                    <u-icon v-if="isShowButton" name="arrow-right" color="#687792" size="28"></u-icon>
                </view>
            </view>
            <view class="main_item" @click="goPage(3)">
                <span style="color:#4F4F4F">班次</span>
                <view>
                    <span style="color:#333333;margin-right: 20rpx;">{{ query.clazzType }}</span>
                    <u-icon v-if="isShowButton" name="arrow-right" color="#687792" size="28"></u-icon>
                </view>
            </view>
            <view class="main_item" @click="goPage(4)">
                <span style="color:#4F4F4F;width: 118rpx;">生产人员</span>
                <view class="value2">
                    <span style="color:#333333;margin-right: 20rpx;">{{ staffNameJoin }}</span>
                </view>
                <u-icon v-if="isShowButton" name="arrow-right" color="#687792" size="28"></u-icon>
            </view>
            <view class="main_item">
                <span style="color:#4F4F4F">创建人</span>
                <view>
                    <span style="color:#333333;">{{ query.createUser }}</span>
                </view>
            </view>
            <view class="btns">
                <u-button :custom-style="customStyle" @click="goPage(9)">杂工</u-button>
                <u-button :custom-style="customStyle" style="width: 150rpx;" @click="goPage(6)">
                    <u-icon class="icon_history" size="26rpx" />
                    <span style="line-height: 40rpx;">历史</span>
                </u-button>
                <u-button v-if="isShowButton" @click="submit" :custom-style="customStyle"
                    style="background: #30AFFF;color: #fff;border: 0;width: 150rpx;">
                    <u-icon class="icon_save" size="26rpx" />
                    <span style="line-height: 40rpx;">保存</span>
                </u-button>
                <u-button :custom-style="customStyle" style="background: #214DED;color: #fff;border: 0;width: 150rpx;"
                    @click="goPage(8)">
                    <u-icon class="icon_right" size="26rpx" />
                    <span style="line-height: 40rpx;">报工</span></u-button>
            </view>
        </view>
        <u-calendar v-model="calendarShow" :mode="mode" @change="changeCalendar"></u-calendar>
        <!--工序下拉框-->
        <u-select :default-value="[operationIndex]" v-model="selectShowOperation" :list="operationList"
            @confirm="confirmOperation"></u-select>
        <u-select v-model="selectShowClazzType" :list="clazzTypeList" @confirm="confirmClazzType"></u-select>
        <u-toast ref="uToast" />
    </view>
</template>
<script>
import {
    dateFormat
} from "@/utils/date.js";
import UIcon from "../../../uview-ui/components/u-icon/u-icon.vue";
export default {
    components: {
        UIcon
    },
    data() {
        return {
            customStyle: {
                'background': '#FFFFFF',
                'border-radius': '8rpx',
                'border': '1px solid #D2D2D2',
                'width': '121rpx',
                'height': '65rpx',
                'font-weight': 500,
                'font-size': '28rpx',
                'color': '#333333',
                'pading': '0 30rpx'
            },
            calendarShow: false,
            selectShowOperation: false,
            selectShowClazzType: false,
            mode: 'date',
            id: '',
            dutyNo: '', // ç¼–号
            query: {
                updateTime: dateFormat(
                    new Date(), 'yyyy-MM-dd'),
                workstationName: '', // å·¥ä½œç«™åç§°
                workstationId: '', // å·¥ä½œç«™id
                clazzType: '', // ç­æ¬¡
                productionUser: '',
                operationId: '', // å·¥åºid
                operationName: '', // å·¥åºåç§°
                userList: [],
                createUser: ''
            },
            toId: '',
            operationList: [],
            clazzTypeList: [{
                label: '白班'
            },
            {
                label: '晚班'
            },
            ],
            workstation: '',
            staffNameJoin: '',
            operationIndex: '',
            isEdit: false, // æ˜¯å¦ä¿®æ”¹
            isShowButton: false,
            workCenter: '',
            addOrEdit: '',
            info: {},
            firstOperationId: null,
            lastOperationId: null,
        }
    },
    onShow() {
        // this.getLastDutyRecordFun()
    },
    onLoad() {
        uni.$on('dailyListInfo', (info) => {
            this.dutyNo = info.dutyNo
            this.id = info.id
            this.query.createUser = this.vuex_username
            this.query.clazzType = info.clazzType
            this.query.workstationId = info.workstationId
            this.query.workstationName = info.workstationName
            this.query.productionUser = info.productionUser.split(',').reverse()
            this.query.userList = info.productionUserList.split(',')
            this.query.operationId = info.operationId
            this.getOperation()
        })
        uni.$on('returnData', (data) => {
            // ä¸´æ—¶å­˜å‚¨å·¥ä½œç«™çš„æ•°æ®
            this.workstation = data
            // ç»™é¡µé¢å·¥ä½œç«™èµ‹å€¼
            this.query.workstationName = '(' + data.workCenter + ')' + data.name
            this.query.workstationId = data.id
            // æ¸…空工序选项
            this.query.operationName = ''
            this.query.operationId = ''
            this.operationIndex = 0
            this.getOperationTaskFun(data.workCenter)
        })
        uni.$on('checkedList', (data) => {
            let staffNameList = []
            let staffNoList = []
            data.forEach(i => {
                staffNameList.push(i.staffName)
                staffNoList.push(i.staffNo)
            })
            this.query.productionUser = staffNameList
            this.query.userList = staffNoList
        });
    },
    onReady() {
        // é¦–次进入页面获取当前登录人最后一次提交的日报
        this.getLastDutyRecordFun()
    },
    methods: {
        isNotOperationName(workCenter, operationName, workCenterTwo) {
            // åˆ¤æ–­æ˜¯å¦ä¸ºè¯¥å·¥ä½œç«™
            if (workCenter.includes(workCenterTwo)) {
                // åˆ¤æ–­æ˜¯å¦åŒ…含工序名称
                if (!operationName.includes(this.query.operationName)) {
                    return true
                } else {
                    return false
                }
            } else {
                return false
            }
        },
        // åˆ¤æ–­å·¥å•是否等于,同时判断是否为第一道工序
        isFirstOperationId(workCenter, workCenterTwo) {
            if (workCenter.includes(workCenterTwo)) {
                // åˆ¤æ–­æ˜¯å¦ä¸ä¸ºç¬¬ä¸€é“工序
                if (this.query.operationId !== this.firstOperationId) {
                    return true
                } else {
                    return false
                }
            } else {
                return false
            }
        },
        // é¦–次进入页面获取当前登录人最后一次提交的日报
        getLastDutyRecordFun() {
            this.$u.api.dailyPaper.getLastDutyRecord().then(res => {
                if (res.code === 0) {
                    this.dutyNo = res.data.dutyNo
                    this.id = res.data.id
                    this.query.createUser = this.vuex_username
                    this.query.clazzType = res.data.clazzType
                    this.query.workstationId = res.data.workstationId
                    this.query.workstationName = res.data.workstationName
                    this.query.productionUser = res.data.productionUser.split(',').reverse()
                    this.query.userList = res.data.productionUserList.split(',')
                    this.query.operationId = res.data.operationId
                    this.getOperation()
                } else {
                    this.$u.toast(res.msg)
                }
            })
        },
        // æ¸…空逻辑
        onNavigationBarButtonTap(e) {
            this.isEdit = true
            this.isShowButton = true
            this.addOrEdit = 'add'
            this.query.productionUser = ''
            this.query.productionUserList = []
            this.staffNameJoin = ''
            this.query.updateTime = ''
        },
        edit() {
            this.isEdit = !this.isEdit
            this.isShowButton = this.isEdit
            this.addOrEdit = 'edit'
        },
        goPage(index) {
            switch (index) {
                // è·³è½¬åˆ°åŽ†å²é¡µé¢
                case 6:
                    uni.navigateTo({
                        url: '/pages/daily/daily/daily-list'
                    })
                    break;
                // è·³è½¬åˆ°æŠ¥å·¥é¡µé¢
                case 8:
                    if (this.isEdit) {
                        this.$refs.uToast.show({
                            title: '请先保存修改',
                            type: 'warning '
                        })
                        return
                    }
                    let workCenter = this.query.workstationName.split(')')[0].substring(1)
                    let operation = this.query.workstationName.split(')')[1]
                    console.log(workCenter, operation, this.firstOperationId, this.query.operationId, this.query)
                    if (workCenter == "TM-01" || workCenter == "JG-01" || workCenter == "YB-04" || this.isFirstOperationId('DY-01,GY-01,YB-01,YB-02', workCenter) || this.isNotOperationName('ZZ-02', '二装,注油', workCenter)) {
                        let item = {
                            workstationId: this.query.workstationId,
                            clazzType: this.query.clazzType,
                            dutyNo: this.dutyNo,
                            userStaffNo: this.query.userList,
                            workstationName: this.query.workstationName,
                            staffNameJoin: this.staffNameJoin,
                            workCenter: workCenter,
                            operationId: this.query.operationId,
                            firstOperationId: this.firstOperationId,
                            lastOperationId: this.lastOperationId
                        }
                        uni.navigateTo({
                            url: '/pages/daily/common/work-reporting?info=' + encodeURIComponent(JSON
                                .stringify(item))
                        })
                    } else if (this.query.workstationName.includes("TX-02") && !this.query.operationName.includes("叠装")) {
                        let item = {
                            workstationId: this.query.workstationId,
                            clazzType: this.query.clazzType,
                            dutyNo: this.dutyNo,
                            userStaffNo: this.query.userList,
                            workstationName: this.query.workstationName,
                            staffNameJoin: this.staffNameJoin,
                            workCenter: "TX-02",
                            operationId: this.query.operationId,
                            firstOperationId: this.firstOperationId,
                            lastOperationId: this.lastOperationId
                        }
                        uni.navigateTo({
                            url: '/pages/daily/common/work-reporting?info=' + encodeURIComponent(JSON
                                .stringify(item))
                        })
                    } else {
                        uni.navigateTo({
                            url: `/pages/daily/common/work-order-list?workstationId=${this.query.workstationId}&toId=${this.toId}&clazzType=${this.query.clazzType}&dutyNo=${this.dutyNo}&userStaffNo=${this.query.userList}&workstationName=${this.query.workstationName}&staffNameJoin=${this.staffNameJoin}`
                        })
                    }
                    break;
                // è·³è½¬åˆ°æ‚工页面
                case 9:
                    if (this.isEdit) {
                        this.$refs.uToast.show({
                            title: '请先保存修改',
                            type: 'warning '
                        })
                        return
                    }
                    uni.navigateTo({
                        url: `/pages/daily/handyman/handyman?dutyNo=${this.query.dutyNo}&updateTime=${this.query.updateTime}&userList=${this.query.productionUser}&staffList=${this.query.userList}`
                    })
                    break;
            }
            if (!this.isEdit) {
                return
            } else {
                switch (index) {
                    case 0:
                        uni.navigateTo({
                            url: '/pages/daily/workstation/index'
                        })
                        break;
                    case 1:
                        if (!this.query.workstationName) {
                            this.$refs.uToast.show({
                                title: '请先选择工作站',
                                type: 'warning '
                            })
                        } else {
                            this.selectShowOperation = true;
                        }
                        break;
                    case 2:
                        this.calendarShow = true;
                        break;
                    case 3:
                        this.selectShowClazzType = true;
                        break;
                    case 4:
                        let staffList = this.query.productionUser
                        let staffNoList = this.query.userList
                        const list = []
                        for (const i in staffList) {
                            const obj = {
                                staffName: staffList[i],
                                staffNo: staffNoList[i]
                            }
                            list.push(obj)
                        }
                        uni.navigateTo({
                            url: '/pages/daily/production-person/production-person?list=' + encodeURIComponent(
                                JSON.stringify(list))
                        })
                        break;
                }
            }
        },
        // æäº¤æ—¥æŠ¥ä¿®æ”¹
        submit() {
            if (!this.query.workstationId) {
                this.$u.toast('请选择工作站')
                return
            } else if (!this.query.operationId) {
                this.$u.toast('请选择工序')
                return
            } else if (!this.query.clazzType) {
                this.$u.toast('请选择班次')
                return
            } else if (!this.query.productionUser) {
                this.$u.toast('请选择生产人员')
                return
            } else if (!this.query.updateTime) {
                this.$u.toast('请选择时间')
                return
            }
            let params = JSON.parse(JSON.stringify(this.query))
            this.$delete(params, 'productionUser')
            this.$delete(params, 'productionUserList')
            params.updateTime = params.updateTime + ' 00:00:00'
            params.id = null
            if (this.addOrEdit === 'add') {
                this.$u.api.dailyPaper.addDailyPaper(params).then(res => {
                    if (res.code === 0) {
                        // this.getLastDutyRecordFun()
                        this.query.createUser = this.vuex_username
                        this.$u.toast('保存成功')
                        this.isShowButton = false
                        this.getLastDutyRecordFun()
                    }
                })
            } else {
                params.id = this.id
                this.$u.api.dailyPaper.editDailyPaper(params).then(res => {
                    if (res.code === 0) {
                        // this.getLastDutyRecordFun()
                        this.$u.toast('修改成功')
                        this.isShowButton = false
                    }
                })
            }
            this.isEdit = false
        },
        changeCalendar(e) {
            this.query.updateTime = e.result;
        },
        confirmOperation(e) {
            this.query.operationName = e[0].label
            this.query.operationId = e[0].value
            const index = this.operationList.findIndex(item => item.value === this.query.operationId)
            if (index > -1) {
                this.operationIndex = index
                this.toId = this.operationList[index].value
            }
        },
        confirmClazzType(e) {
            this.query.clazzType = e[0].label
        },
        // æŸ¥è¯¢å·¥ä½œç«™
        getOperation() {
            this.$u.api.dailyPaper.getWorkstation().then(res => {
                if (res.code === 0) {
                    const index = res.data.findIndex(item => item.name === this.query.workstationName)
                    if (index > -1) {
                        this.workCenter = res.data[index].workCenter
                    }
                    this.query.workstationName = '(' + this.workCenter + ')' + this.query.workstationName
                    this.getOperationTaskFun(this.workCenter, this.query.operationId)
                }
            })
        },
        getOperationTaskFun(id, operationId) {
            this.operationList = []
            const params = {
                workCenter: id,
                current: 1,
                size: -1
            }
            // æŸ¥è¯¢å·¥åºåˆ—表
            this.$u.api.dailyPaper.getOperation(params).then(res => {
                if (res.code === 0) {
                    if (res.data.records.length > 0) {
                        res.data.records.forEach(i => {
                            const obj = Object.assign({
                                label: i.name,
                                value: i.id,
                            })
                            this.operationList.push(obj)
                        })
                        if (operationId) {
                            const index = this.operationList.findIndex(item => item.value === operationId)
                            if (index > -1) {
                                this.operationIndex = index
                                this.query.operationName = this.operationList[index].label
                                this.toId = this.operationList[index].value
                            }
                        }
                        this.firstOperationId = this.operationList[0].value
                        this.lastOperationId = this.operationList[this.operationList.length - 1].value
                    }
                }
            })
        }
    },
    watch: {
        'query.productionUser': {
            handler(newName, oldName) {
                if (this.query.productionUser.length > 0) {
                    this.staffNameJoin = this.query.productionUser.join()
                } else {
                    this.staffNameJoin = ''
                }
            },
            immediate: true,
            deep: true
        }
    }
}
</script>
<style lang="scss">
@import 'index0.scss';
</style>
pages/product/report/orderList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,312 @@
<template>
  <view class="page">
    <view class="finishProductIn-locno-bg" />
    <u-navbar title="车间订单列表" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
      back-icon-color="#000" />
    <view class="finishProductIn-locno-search">
      <u-search v-model="keywords" shape="square" bg-color="rgba(250,252,255,0.36)" :show-action="false"
        placeholder="请输入车间订单号" @clear="search" @custom="search" @search="search">
      </u-search>
    </view>
    <view class="wrap">
      <scroll-view class="finishProductIn-locno-scroll-list" scroll-y="true" @scrolltolower="loadMore">
        <u-cell-group class="finishProductIn-locno-scroll-list-group" :border="false">
          <view class="content" v-for="(item, index) in list" :key="item.locNo" :index="index"
            @click="selectNo(item.index)">
            <view class="content-header">
              <view class="content-header-title">{{ item.index }}</view>
            </view>
            <view class="content-body">
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-1">
                  </view>
                  <view class="_label-name">订单号:</view>
                </view>
                <view class="_content">
                  {{ item.value0 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-2">
                  </view>
                  <view class="_label-name">零件号:</view>
                </view>
                <view class="_content">
                  {{ item.value1 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-3">
                  </view>
                  <view class="_label-name">零件描述:</view>
                </view>
                <view class="_content">
                  {{ item.value2 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-1">
                  </view>
                  <view class="_label-name">批量大小:</view>
                </view>
                <view class="_content">
                  {{ item.value3 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-2">
                  </view>
                  <view class="_label-name">开始日期:</view>
                </view>
                <view class="_content">
                  {{ item.value4 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-3">
                  </view>
                  <view class="_label-name">结束日期:</view>
                </view>
                <view class="_content">
                  {{ item.value5 }}
                </view>
              </view>
            </view>
          </view>
        </u-cell-group>
        <view class="loadmore" @click="loadMore">
          <u-loadmore :status="loadStatus"></u-loadmore>
        </view>
      </scroll-view>
    </view>
  </view>
</template>
<script>
import content_bg from '@/static/custom/finishProductIn/locNoBg.png'
export default {
  data() {
    return {
      background: {
        backgroundImage: `url(${content_bg})`,
        backgroundAttachment: 'fixed',
        backgroundSize: '100% auto',
        backgroundRepeat: 'no-repeat',
      },
      keywords: '',
      alllist: [],
      originList: [],
      query: {
        current: 1,
        size: 10
      },
      list: [
        {
          index: 1,
          value0: '123456789',
          value1: '123456789',
          value2: '123456789',
          value3: '123456789',
          value4: '123456789',
          value5: '123456789'
        }
      ],
      count: 0,
      loadStatus: 'loading'
    };
  },
  onLoad() {
    this.$u.api.finishProductIn.fetchList().then(res => {
      this.alllist = res.data
      this.originList = res.data
      this.loadList()
    })
  },
  methods: {
    loadMore() {
      if (this.loadStatus == "nomore" || this.loadStatus == "loading") {
        return
      }
      this.loadStatus = "loading";
      setTimeout(() => {
        this.query.current += 1;
        this.loadList();
      }, 100);
    },
    loadList() {
      const data = this.originList.slice((this.query.current - 1) * this.query.size, this.query.current * this.query.size)
      this.list = this.list.concat(data);
      this.loadStatus = "loadmore";
      if (!data || data.length < this.query.size) {
        this.loadStatus = "nomore";
      }
    },
    search(value) {
      this.list = [];
      this.query.current = 1;
      if (value) {
        this.originList = this.alllist.filter(item => item.locNo.includes(value))
      } else {
        this.originList = this.alllist
      }
      this.loadList()
    },
    selectNo(no) {
      this.refreshLastPage(no)
    },
    //刷新上一个页面
    refreshLastPage(no) {
      // å‘ŠçŸ¥ A.vue æ›´æ–°æ•°æ®
      // èŽ·å–é¡µé¢æ ˆ
      let pages = getCurrentPages()
      // èŽ·å–ä¸Šä¸€é¡µæ ˆ
      let prevPage = pages[pages.length - 2]
      // è§¦å‘上一页 upData å‡½æ•°(并携带参数)
      prevPage.$vm.setNo(no)
      // è¿”回上一页
      uni.navigateBack({
        delta: 1
      })
    },
  }
};
</script>
<style lang="scss">
.finishProductIn-locno-bg {
  background-color: #F6F9FF;
  background-image: url('~@/static/custom/finishProductIn/locNoBg.png');
  // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
  padding: 0 20rpx;
  background-attachment: fixed;
  background-size: 100% auto;
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  bottom: 0;
  width: 100%;
  z-index: -1;
}
.finishProductIn-locno-search {
  padding: 40rpx 30rpx 20rpx 30rpx;
}
.wrap .finishProductIn-locno-scroll-list {
  height: calc(100vh - var(--window-top) - var(--window-bottom) - 242rpx);
  width: 100%;
}
.finishProductIn-locno-scroll-list-group {
  ::v-deep .u-cell-item-box {
    background-color: rgba(250, 252, 255, 0.36) !important;
    padding: 0rpx 30rpx;
  }
  .content {
    font-size: 12px;
    background-color: #FFFFFF;
    box-sizing: border-box;
    border-radius: 10rpx;
    margin: 0rpx 0rpx 16rpx;
    padding: 20rpx 8rpx;
    box-shadow: none;
    display: flex;
    align-items: center;
    .content-header {
      width: 40rpx;
      height: 90rpx;
      display: flex;
      align-items: center;
      .content-header-icon {
        background-image: url('~@/static/custom/moveWareHouse/header_icon.png');
        background-size: 100% auto;
        background-repeat: no-repeat;
        height: 28rpx;
        width: 28rpx;
      }
      .content-header-title {
        margin-left: 11rpx;
        font-size: 26rpx;
        font-weight: bold;
        color: #333333;
      }
    }
    .content-body {
      flex: 1;
      background: #F5F9FF;
      border-radius: 10rpx;
      padding: 0rpx 23rpx;
      .row-list {
        height: 60rpx;
        display: flex;
        flex-direction: row;
        padding: 0px;
        align-items: center;
      }
      .row-list ._label {
        display: flex;
        flex: 0.8;
        color: #909399;
        align-items: center;
        ._label-icon-1 {
          background-image: url('~@/static/custom/moveWareHouse/label-icon-1.png');
          background-size: 100% auto;
          background-repeat: no-repeat;
          height: 26rpx;
          width: 26rpx;
        }
        ._label-icon-2 {
          background-image: url('~@/static/custom/moveWareHouse/label-icon-2.png');
          background-size: 100% auto;
          background-repeat: no-repeat;
          height: 26rpx;
          width: 26rpx;
        }
        ._label-icon-3 {
          background-image: url('~@/static/custom/moveWareHouse/label-icon-3.png');
          background-size: 100% auto;
          background-repeat: no-repeat;
          height: 26rpx;
          width: 26rpx;
        }
        ._label-name {
          margin-left: 11rpx;
          font-size: 26rpx;
          font-weight: 500;
          color: #666666;
        }
      }
      .row-list ._content {
        flex: 1.5;
        text-align: right;
        color: #909399;
        font-size: 24rpx;
      }
      .row-list .s1 {
        color: #D35651;
      }
    }
  }
}
</style>
pages/sys/home/index.vue
@@ -41,6 +41,16 @@
                            url: '/',
                            icon: 'feeding'
                        },
                        {
                            name: '车间订单下发',
                            url: '/',
                            icon: 'feeding'
                        },
                        {
                            name: '车间取消下发',
                            url: '/',
                            icon: 'feeding'
                        },
                    ]
                },
                {
@@ -59,6 +69,16 @@
                        {
                            name: '核磅录入',
                            url: '/pages/wareHouse/packing/registration',
                            icon: 'feeding'
                        },
                        {
                            name: '库存件盘点',
                            url: '/pages/wareHouse/inventory/index',
                            icon: 'feeding'
                        },
                        {
                            name: '导体备货盘点',
                            url: '/pages/wareHouse/inventory/index',
                            icon: 'feeding'
                        },
                    ]
@@ -98,6 +118,7 @@
.wrap {
    height: calc(100vh - 200rpx);
    background: linear-gradient(to bottom, #e5f0ff, #f6f9ff);
    overflow-y: auto;
}
.work-stage-title {
pages/wareHouse/moveWareHouse/index.vue
@@ -1,22 +1,23 @@
<template>
    <view class="page">
        <view class="movewarehouse-index-bg"/>
        <u-navbar title="移库" :background="background" :border-bottom="false" :title-bold="true" title-color="#000" back-icon-color="#000"/>
        <view class="movewarehouse-index-bg" />
        <u-navbar title="移库" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
            back-icon-color="#000" />
        <view class="movewarehouse-index-search">
            <!--<u-search v-model="keywords" shape="square" bg-color="rgba(250,252,255,0.36)" :show-action="false" placeholder="请输入库位号" @clear="search" @custom="search" @search="search">
            </u-search>-->
            <view class="movewarehouse-index-search-view">
                <view class="movewarehouse-index-search-view-item">
                  <text class="item-one">至库位号</text>
                  <text class="item-one-content">{{tolocationNo}}</text>
                </view>
                    <text class="item-one">至库位号</text>
                    <text class="item-one-content">{{ tolocationNo }}</text>
                </view>
                <view class="movewarehouse-index-search-view-item" @click="seachLocationNo()">
                   <text class="item-two">请选择</text>
                   <u-icon name="arrow-right" color="#2979ff" size="28"></u-icon>
                    <text class="item-two">请选择</text>
                    <u-icon name="arrow-right" color="#2979ff" size="28"></u-icon>
                </view>
            </view>
        </view>
         <view class="wrap">
        <view class="wrap">
            <scroll-view class="movewarehouse-index-scroll-list" scroll-y="true">
                <u-cell-group class="movewarehouse-index-scroll-list-group" :border="false">
                    <view class="content" v-for="(item, index) in list" :key="item.id" :index="index">
@@ -31,7 +32,7 @@
                            </view>
                            <view class="header-item-toolbar" @click="deleteHandle(item)">
                                <view class="header-item-toolbar-del-icon">
                                </view>
                                <view class="header-item-toolbar-del-text">
                                    åˆ é™¤
@@ -72,7 +73,7 @@
                                </view>
                                <view class="_content">
                                    <text class="_content-text">{{ item.availableStockQuantity }}</text>
                                     ({{ item.unit }})
                                    ({{ item.unit }})
                                </view>
                            </view>
                            <view class="row-list">
@@ -89,437 +90,459 @@
                </u-cell-group>
            </scroll-view>
            <scan></scan>
            <view class="new-form-footer" v-if="list.length>0">
            <view class="new-form-footer" v-if="list.length > 0">
                <u-button class="btn" type="primary" @click="submit">提交</u-button>
            </view>
        </view>
    </view>
    </view>
</template>
<script>
    import scan from "@/components/scan/scan.vue";
    import content_bg from '@/static/custom/moveWareHouse/locNoBg.png'
    export default {
        components: {
            scan
        },
        data() {
            return {
                background:{
                    backgroundImage: `url(${content_bg})`,
                    backgroundAttachment: 'fixed',
                    backgroundSize: '100% auto',
                    backgroundRepeat: 'no-repeat',
                },
                list: [],
                tolocationNo: "",
                keywords:''
            };
        },
        onLoad() {
            // this.loadList("221206000739N");
            // let data = '{"part_no":"88.118.1/A0047954","lot_batch_no":"221112000082N","qty_arrived":0.5,"wdr":"221112000082N"}'
            // let data = '221206000739N'
            // let sn = ''
            // if (data.indexOf('{') >= 0) {
            //     //大标签二位码
            //     sn = JSON.parse(data).lot_batch_no
            // } else {
            //     //小标签条码
            //     sn = data
            // }
            // console.log(sn);
        },
        onShow() {
import scan from "@/components/scan/scan.vue";
import content_bg from '@/static/custom/moveWareHouse/locNoBg.png'
export default {
    components: {
        scan
    },
    data() {
        return {
            background: {
                backgroundImage: `url(${content_bg})`,
                backgroundAttachment: 'fixed',
                backgroundSize: '100% auto',
                backgroundRepeat: 'no-repeat',
            },
            list: [],
            tolocationNo: "",
            keywords: ''
        };
    },
    onLoad() {
        // this.loadList("221206000739N");
        // let data = '{"part_no":"88.118.1/A0047954","lot_batch_no":"221112000082N","qty_arrived":0.5,"wdr":"221112000082N"}'
        // let data = '221206000739N'
        // let sn = ''
        // if (data.indexOf('{') >= 0) {
        //     //大标签二位码
        //     sn = JSON.parse(data).lot_batch_no
        // } else {
        //     //小标签条码
        //     sn = data
        // }
        // console.log(sn);
    },
    onShow() {
        let that = this
        uni.$off('scan') // æ¯æ¬¡è¿›æ¥å…ˆ ç§»é™¤å…¨å±€è‡ªå®šä¹‰äº‹ä»¶ç›‘听器
        uni.$on('scan', function (data) {
            console.log('onscan');
            //扫码成功后的回调,你可以写自己的逻辑代码在这里
            console.log('扫码结果:', data.code);
            if (data.code != "" && (that.tolocationNo == "")) {
                uni.showToast({
                    title: '请选择至库位号',
                    icon: 'none'
                })
                return
            }
            let sn = ''
            if (data.code.indexOf('{') >= 0) {
                //大标签二位码
                let snNoIndex = data.code.indexOf('sn_no')
                if (snNoIndex > -1) {
                    sn = JSON.parse(data.code).sn_no
                } else {
                    sn = JSON.parse(data.code).lot_batch_no
                }
            } else {
                //小标签条码
                sn = data.code
            }
            //判断数组中是否存在  SN æ˜¯å¦å·²ç»å­˜åœ¨
            let initList = that.list.filter(item => item
                .partBatchNo == sn)
            if (initList.length > 0) {
                uni.showToast({
                    title: "SN:" + sn + ",已存在,请选择另一个SN号",
                    icon: "none"
                });
                return
            }
            that.loadList(sn);
        })
    },
    onNavigationBarButtonTap(e) {
        uni.scanCode({
            success: res => {
                try {
                    const result = JSON.parse(res.result)
                } catch (e) { }
            }
        });
    },
    methods: {
        //至库位
        seachLocationNo() {
            uni.navigateTo({
                url: '/pages/wareHouse/moveWareHouse/locNoList'
            })
        },
        loadList(sanCode) {
            uni.showLoading({
                mask: true,
                title: "加载中",
            });
            let that = this
            uni.$off('scan') // æ¯æ¬¡è¿›æ¥å…ˆ ç§»é™¤å…¨å±€è‡ªå®šä¹‰äº‹ä»¶ç›‘听器
            uni.$on('scan', function(data) {
                console.log('onscan');
                //扫码成功后的回调,你可以写自己的逻辑代码在这里
                console.log('扫码结果:', data.code);
                if (data.code != "" && (that.tolocationNo == "")) {
                    uni.showToast({
                        title: '请选择至库位号',
                        icon: 'none'
                    })
                    return
                }
                let sn = ''
                if (data.code.indexOf('{') >= 0) {
                    //大标签二位码
                    let snNoIndex=data.code.indexOf('sn_no')
                    if(snNoIndex>-1){
                        sn = JSON.parse(data.code).sn_no
                    }else{
                        sn = JSON.parse(data.code).lot_batch_no
                    }
                } else {
                    //小标签条码
                    sn = data.code
            if (sanCode != "") {
                let data = {
                    sn: sanCode
                }
                //判断数组中是否存在  SN æ˜¯å¦å·²ç»å­˜åœ¨
                let initList = that.list.filter(item => item
                    .partBatchNo == sn)
                //判断数组中是否存在 è‡³åº“位号 SN
                let initList = that.list.filter(item => item.arriveLocationNo == that.tolocationNo).filter(item => item
                    .partBatchNo == sanCode)
                if (initList.length > 0) {
                    uni.showToast({
                        title: "SN:" + sn + ",已存在,请选择另一个SN号",
                        title: "库位号:" + that.tolocationNo + ",SN:" + sanCode + ",已经扫过码",
                        icon: "none"
                    });
                    return
                }
                that.loadList(sn);
            })
        },
        onNavigationBarButtonTap(e) {
            uni.scanCode({
                success: res => {
                    try {
                        const result = JSON.parse(res.result)
                // æŸ¥è¯¢ç§»åº“信息
                that.$u.api.pigxWareHouse.list(data).then(res => {
                    let reList = []
                    reList = res.data
                    } catch (e) {}
                    if (reList.length == 0) {
                        uni.showToast({
                            title: "库位号:" + that.tolocationNo + ",SN:" + sanCode + ",未扫到移库信息",
                            icon: "none"
                        });
                    } else {
                        for (let i = 0; i < reList.length; i++) {
                            if (reList[i].locationNo !== that.tolocationNo) {
                                let item = {
                                    id: reList[i].id,
                                    partNo: reList[i].partNo,
                                    partName: reList[i].partName,
                                    partBatchNo: reList[i].partBatchNo,
                                    ifsBatchNo: reList[i].ifsBatchNo,
                                    unit: reList[i].unit,
                                    locationNo: reList[i].locationNo,
                                    availableStockQuantity: reList[i].availableStockQuantity,
                                    arriveLocationNo: that.tolocationNo,
                                    moveQty: 0
                                }
                                that.list.push(item)
                            }
                        }
                    }
                    uni.hideLoading();
                })
            }
        },
        //至库位号设置
        setNo(no) {
            this.tolocationNo = no
        },
        deleteHandle(obj) {
            let that = this
            uni.showModal({
                title: '提示',
                content: '此操作将删除该移库信息, æ˜¯å¦ç»§ç»­?',
                success: function (res) {
                    if (res.confirm) {
                        that.list.map((item, index) => {
                            if (obj.id == item.id) {
                                that.list.splice(index, 1)
                            }
                        });
                    }
                }
            });
        },
        methods: {
            //至库位
            seachLocationNo() {
                uni.navigateTo({
                    url: '/pages/wareHouse/moveWareHouse/locNoList'
                })
            },
            loadList(sanCode) {
                uni.showLoading({
                    mask: true,
                    title: "加载中",
                });
                let that = this
        submit() {
            let that = this
                if (sanCode != "") {
                    let data = {
                        sn: sanCode
                    }
            that.list.map((item) => {
                    //判断数组中是否存在 è‡³åº“位号 SN
                    let initList = that.list.filter(item => item.arriveLocationNo == that.tolocationNo).filter(item => item
                        .partBatchNo == sanCode)
                    if (initList.length > 0) {
                        uni.showToast({
                            title: "库位号:" + that.tolocationNo + ",SN:" + sanCode + ",已经扫过码",
                            icon: "none"
                        });
                        return
                    }
                    // æŸ¥è¯¢ç§»åº“信息
                    that.$u.api.pigxWareHouse.list(data).then(res => {
                        let reList = []
                        reList = res.data
                if (item.moveQty <= 0) {
                    uni.showToast({
                        title: '请移库数量必须大于0',
                        icon: "none"
                    });
                    return
                }
                        if (reList.length == 0) {
                            uni.showToast({
                                title: "库位号:" + that.tolocationNo + ",SN:" + sanCode + ",未扫到移库信息",
                                icon: "none"
                            });
                        } else {
                            for (let i = 0; i < reList.length; i++) {
                                if (reList[i].locationNo !== that.tolocationNo) {
                                    let item = {
                                        id: reList[i].id,
                                        partNo: reList[i].partNo,
                                        partName: reList[i].partName,
                                        partBatchNo: reList[i].partBatchNo,
                                        ifsBatchNo: reList[i].ifsBatchNo,
                                        unit: reList[i].unit,
                                        locationNo: reList[i].locationNo,
                                        availableStockQuantity: reList[i].availableStockQuantity,
                                        arriveLocationNo: that.tolocationNo,
                                        moveQty: 0
                                    }
                                    that.list.push(item)
                                }
                            }
                if (item.moveQty > item.availableStockQuantity) {
                    uni.showToast({
                        title: '移库数量不能大于可用库存数量',
                        icon: "none"
                    });
                    return
                }
            });
            let subList = []
            that.list.map((item) => {
                let sub = {
                    stockId: item.id,
                    arriveLocationNo: item.arriveLocationNo,
                    moveQty: item.moveQty
                }
                subList.push(sub)
            });
            that.$u.api.pigxWareHouse.addList(subList).then(res => {
                if (res.code == 0) {
                    uni.showModal({
                        title: '提示',
                        content: '提交成功',
                        showCancel: false,
                        success: function () {
                            that.list = []
                            that.tolocationNo = ""
                        }
                    })
                } else {
                    uni.showModal({
                        title: '提示',
                        content: '提交失败',
                        showCancel: false,
                        success: function () {
                        uni.hideLoading();
                        }
                    })
                }
            },
            //至库位号设置
            setNo(no) {
                this.tolocationNo = no
            },
            deleteHandle(obj) {
                let that = this
                uni.showModal({
                    title: '提示',
                    content: '此操作将删除该移库信息, æ˜¯å¦ç»§ç»­?',
                    success: function(res) {
                        if (res.confirm) {
                            that.list.map((item, index) => {
                                if (obj.id == item.id) {
                                    that.list.splice(index, 1)
                                }
                            });
                        }
                    }
                });
            },
            submit() {
                let that = this
                that.list.map((item) => {
            })
                    if (item.moveQty <= 0) {
                        uni.showToast({
                            title: '请移库数量必须大于0',
                            icon: "none"
                        });
                        return
                    }
                    if (item.moveQty > item.availableStockQuantity) {
                        uni.showToast({
                            title: '移库数量不能大于可用库存数量',
                            icon: "none"
                        });
                        return
                    }
                });
                let subList = []
                that.list.map((item) => {
                    let sub = {
                        stockId: item.id,
                        arriveLocationNo: item.arriveLocationNo,
                        moveQty: item.moveQty
                    }
                    subList.push(sub)
                });
                that.$u.api.pigxWareHouse.addList(subList).then(res => {
                    if (res.code == 0) {
                        uni.showModal({
                            title: '提示',
                            content: '提交成功',
                            showCancel: false,
                            success: function() {
                                that.list = []
                                that.tolocationNo = ""
                            }
                        })
                    } else {
                        uni.showModal({
                            title: '提示',
                            content: '提交失败',
                            showCancel: false,
                            success: function() {
                            }
                        })
                    }
                })
            },
        }
    };
        },
    }
};
</script>
<style lang="scss" scoped>
    .movewarehouse-index-bg{
        background-color: #F6F9FF;
        background-image: url('~@/static/custom/moveWareHouse/locNoBg.png');
        // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
        padding: 0 20rpx;
        background-attachment: fixed;
        background-size: 100% auto;
        background-repeat: no-repeat;
        position: fixed;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: -1;
    }
    .movewarehouse-index-search{
        padding: 40rpx 30rpx 20rpx 30rpx;
    }
    .movewarehouse-index-search-view{
        height: 66rpx;
        border: 1px solid #ADC8E4;
        border-radius: 8rpx;
        background: rgba(250,252,255,0.36);
        line-height: 66rpx;
        padding-left:33rpx;
        padding-right:10rpx;
        display:flex;
        justify-content: space-between;
        .movewarehouse-index-search-view-item{
            .item-one{
                font-size: 30rpx;
                color: #283E65;
            }
            .item-one-content{
                margin-left: 10rpx;
                color: #909399;
                font-size: 26rpx;
            }
            .item-two{
                font-size: 30rpx;
                color: #A6B4CC;
            }
.movewarehouse-index-bg {
    background-color: #F6F9FF;
    background-image: url('~@/static/custom/moveWareHouse/locNoBg.png');
    // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
    padding: 0 20rpx;
    background-attachment: fixed;
    background-size: 100% auto;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: -1;
}
.movewarehouse-index-search {
    padding: 40rpx 30rpx 20rpx 30rpx;
}
.movewarehouse-index-search-view {
    height: 66rpx;
    border: 1px solid #ADC8E4;
    border-radius: 8rpx;
    background: rgba(250, 252, 255, 0.36);
    line-height: 66rpx;
    padding-left: 33rpx;
    padding-right: 10rpx;
    display: flex;
    justify-content: space-between;
    .movewarehouse-index-search-view-item {
        .item-one {
            font-size: 30rpx;
            color: #283E65;
        }
        .item-one-content {
            margin-left: 10rpx;
            color: #909399;
            font-size: 26rpx;
        }
        .item-two {
            font-size: 30rpx;
            color: #A6B4CC;
        }
    }
    .wrap .movewarehouse-index-scroll-list{
        height:calc(100vh - var(--window-top) - var(--window-bottom) - 378rpx);
        width:100%;
    }
    .movewarehouse-index-scroll-list-group{
        ::v-deep .u-cell-item-box {
            background-color:rgba(250,252,255,0.36) !important;
            padding:0rpx 30rpx ;
        }
        .content {
            font-size: 12px;
            background-color: #FFFFFF;
            box-sizing: border-box;
            border-radius: 10rpx;
            margin: 0rpx 0rpx 16rpx;
            height: 432rpx;
            padding: 10rpx 20rpx;
            box-shadow:0rpx 6rpx 12rpx 2rpx rgba(127, 127, 127, 0.1) !important;
            position:relative;
            .content-header{
                .header-item{
                    height: 50rpx;
                    display: flex;
                    align-items:center;
                    .content-header-icon-one{
                        background-image: url('~@/static/custom/moveWareHouse/label-icon-1.png');
                        background-size: 100% auto;
                        background-repeat: no-repeat;
                        height:28rpx;
                        width:28rpx;
                    }
                    .content-header-icon-two{
                        background-image: url('~@/static/custom/moveWareHouse/header_icon.png');
                        background-size: 100% auto;
                        background-repeat: no-repeat;
                        height:28rpx;
                        width:28rpx;
                    }
                    .content-header-title{
                        margin-left: 11rpx;
                        font-size: 26rpx;
                        font-weight: bold;
                        color: #333333;
                    }
                }
                .header-item-toolbar{
                    position: absolute;
                    background-image: url('~@/static/custom/moveWareHouse/del-icon.png');
                    background-size: 100% auto;
                    background-repeat: no-repeat;
                    height:60rpx;
                    width:140rpx;
                    right:0;
                    top:0;
                    display: flex;
                    justify-content: flex-end;
                    padding-top: 10rpx;
                    padding-right: 18rpx;
                    .header-item-toolbar-del-icon{
                        background-image: url('~@/static/custom/moveWareHouse/icon_dele.png');
                        background-size: 100% auto;
                        background-repeat: no-repeat;
                        height:25rpx;
                        width:22rpx;
                        margin-top: 5rpx;
                    }
                    .header-item-toolbar-del-text{
                        margin-left:7rpx;
                        height: 23rpx;
                        font-size: 24rpx;
                        color: #FFFFFF;
                    }
                }
            }
            .content-body{
                height:300rpx;
                background: #F5F9FF;
                border-radius: 10rpx;
                padding: 25rpx 23rpx;
                .row-list {
                    height: 50rpx;
                    display: flex;
                    flex-direction: row;
                    padding: 0px;
                    align-items: center;
                    justify-content: space-between;
                }
                .row-list ._label {
                    display: flex;
                    color: #666666;
                    font-size:26rpx;
                    align-items: center;
                    width: 170rpx;
                }
                .row-list ._content {
                    text-align: right;
                    color: #909399;
                    font-size: 24rpx;
                    ._content-text{
                        color:#214ded;
                    }
                }
                .row-list ._input {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    border-bottom: 1px solid #4FA0FF;
                    height: 56rpx;
                    .edit_icon{
                        background-image: url('~@/static/custom/finishProductIn/icon_edit.png');
                        background-size: 100% auto;
                        background-repeat: no-repeat;
                        height:26rpx;
                        width:26rpx;
                    }
                    ::v-deep .uni-input-input{
                        color:#D35651;
                    }
                }
            }
        }
}
.wrap .movewarehouse-index-scroll-list {
    height: calc(100vh - var(--window-top) - var(--window-bottom) - 378rpx);
    width: 100%;
}
.movewarehouse-index-scroll-list-group {
    ::v-deep .u-cell-item-box {
        background-color: rgba(250, 252, 255, 0.36) !important;
        padding: 0rpx 30rpx;
    }
    .new-form-footer{
        display: flex;
        margin-top: 10rpx;
        margin-bottom: 10rpx;
        margin-left: 20rpx;
        margin-right: 20rpx;
        padding-bottom: 14rpx;
        .btn {
          flex: 1;
          margin: 10rpx;
          background: #214DED;
          box-shadow: 0rpx 6rpx 8rpx 0rpx rgba(4,49,212,0.3);
          font-weight: bold;
          color: #FEFEFE;
          font-family: PingFang SC;
    .content {
        font-size: 12px;
        background-color: #FFFFFF;
        box-sizing: border-box;
        border-radius: 10rpx;
        margin: 0rpx 0rpx 16rpx;
        height: 432rpx;
        padding: 10rpx 20rpx;
        box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(127, 127, 127, 0.1) !important;
        position: relative;
        .content-header {
            .header-item {
                height: 50rpx;
                display: flex;
                align-items: center;
                .content-header-icon-one {
                    background-image: url('~@/static/custom/moveWareHouse/label-icon-1.png');
                    background-size: 100% auto;
                    background-repeat: no-repeat;
                    height: 28rpx;
                    width: 28rpx;
                }
                .content-header-icon-two {
                    background-image: url('~@/static/custom/moveWareHouse/header_icon.png');
                    background-size: 100% auto;
                    background-repeat: no-repeat;
                    height: 28rpx;
                    width: 28rpx;
                }
                .content-header-title {
                    margin-left: 11rpx;
                    font-size: 26rpx;
                    font-weight: bold;
                    color: #333333;
                }
            }
            .header-item-toolbar {
                position: absolute;
                background-image: url('~@/static/custom/moveWareHouse/del-icon.png');
                background-size: 100% auto;
                background-repeat: no-repeat;
                height: 60rpx;
                width: 140rpx;
                right: 0;
                top: 0;
                display: flex;
                justify-content: flex-end;
                padding-top: 10rpx;
                padding-right: 18rpx;
                .header-item-toolbar-del-icon {
                    background-image: url('~@/static/custom/moveWareHouse/icon_dele.png');
                    background-size: 100% auto;
                    background-repeat: no-repeat;
                    height: 25rpx;
                    width: 22rpx;
                    margin-top: 5rpx;
                }
                .header-item-toolbar-del-text {
                    margin-left: 7rpx;
                    height: 23rpx;
                    font-size: 24rpx;
                    color: #FFFFFF;
                }
            }
        }
        .content-body {
            height: 300rpx;
            background: #F5F9FF;
            border-radius: 10rpx;
            padding: 25rpx 23rpx;
            .row-list {
                height: 50rpx;
                display: flex;
                flex-direction: row;
                padding: 0px;
                align-items: center;
                justify-content: space-between;
            }
            .row-list ._label {
                display: flex;
                color: #666666;
                font-size: 26rpx;
                align-items: center;
                width: 170rpx;
            }
            .row-list ._content {
                text-align: right;
                color: #909399;
                font-size: 24rpx;
                ._content-text {
                    color: #214ded;
                }
            }
            .row-list ._input {
                display: flex;
                justify-content: space-between;
                align-items: center;
                border-bottom: 1px solid #4FA0FF;
                height: 56rpx;
                .edit_icon {
                    background-image: url('~@/static/custom/finishProductIn/icon_edit.png');
                    background-size: 100% auto;
                    background-repeat: no-repeat;
                    height: 26rpx;
                    width: 26rpx;
                }
                ::v-deep .uni-input-input {
                    color: #D35651;
                }
            }
        }
    }
}
.new-form-footer {
    display: flex;
    margin-top: 10rpx;
    margin-bottom: 10rpx;
    margin-left: 20rpx;
    margin-right: 20rpx;
    padding-bottom: 14rpx;
    .btn {
        flex: 1;
        margin: 10rpx;
        background: #214DED;
        box-shadow: 0rpx 6rpx 8rpx 0rpx rgba(4, 49, 212, 0.3);
        font-weight: bold;
        color: #FEFEFE;
        font-family: PingFang SC;
    }
}
</style>
static/custom/moda-lbg.png