Преглед на файлове

Merge branch 'master' of http://119.23.210.103:3000/wy/lh_firm_former

liujiayin преди 3 години
родител
ревизия
6959baa01c

+ 1 - 1
src/assets/styles/components/selector-dialog.scss

@@ -4,7 +4,7 @@
     border: dashed 1px #CCC;
     overflow: auto;
     box-sizing: border-box;
-    margin: 5px 2px;
+    // margin: 5px 2px;
   }
   .ibps-selector-header .el-tag,.selector-list .el-tag{
     vertical-align: middle;

+ 262 - 250
src/business/platform/data/templaterender/preview/types/dialog.vue

@@ -1,264 +1,276 @@
 <template>
-  <!--自定义对话框-->
-  <ibps-selector-dialog
-    :visible="dialogVisible"
-    :value="selectedValue"
-    :title="title"
-    :width="width"
-    :height="height"
-    :margin-top="marginTop"
-    :multiple="multiple"
-    :label-key="showLabel"
-    :default-button="false"
-    :buttons="toolbars"
-    class="preview-type-dialog"
-    @input="handleSelectChange"
-    @remove-select="setSelectRow"
-    @close="closeDialog"
-  >
-    <template v-slot>
-      <ibps-data-template-render
-        v-if="dialogVisible"
-        ref="dataTemplate"
+    <!--自定义对话框-->
+    <ibps-selector-dialog
+        :visible="dialogVisible"
         :value="selectedValue"
-        :data="dataTemplate"
-        :dynamic-params="dynamicParams"
+        :title="title"
+        :width="width"
+        :height="height"
+        :margin-top="marginTop"
         :multiple="multiple"
-        :height="dialogHeight"
-        :preview="preview"
+        :label-key="showLabel"
+        :default-button="false"
+        :buttons="toolbars"
+        class="preview-type-dialog"
+        @input="handleSelectChange"
+        @remove-select="setSelectRow"
         @close="closeDialog"
-        @selected="handleSelectChange"
-      />
-    </template>
-  </ibps-selector-dialog>
+    >
+        <template v-slot>
+            <ibps-data-template-render
+                v-if="dialogVisible"
+                ref="dataTemplate"
+                :value="selectedValue"
+                :data="dataTemplate"
+                :dynamic-params="dynamicParams"
+                :multiple="multiple"
+                :height="dialogHeight"
+                :preview="preview"
+                @close="closeDialog"
+                @selected="handleSelectChange"
+            />
+        </template>
+    </ibps-selector-dialog>
 </template>
 <script>
-import TypeMixin from '../mixins/types'
-import { buildLabelTitle } from '../../utils'
-import JDialog from '../../utils/JDialogTemplate'// 自定义脚本
-// import ActionUtils from '@/utils/action'
+    import TypeMixin from '../mixins/types'
+    import { buildLabelTitle } from '../../utils'
+    import JDialog from '../../utils/JDialogTemplate' // 自定义脚本
+    // import ActionUtils from '@/utils/action'
 
-import IbpsSelectorDialog from '@/components/ibps-selector/dialog'
-import Vue from 'vue'
-Vue.component('ibps-data-template-render', () => import('@/business/platform/data/templaterender/index.vue'))
+    import IbpsSelectorDialog from '@/components/ibps-selector/dialog'
+    import Vue from 'vue'
+    Vue.component('ibps-data-template-render', () =>
+        import('@/business/platform/data/templaterender/index.vue')
+    )
 
-export default {
-  components: {
-    IbpsSelectorDialog
-  },
-  mixins: [TypeMixin],
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    data: {
-      type: Object
-    },
-    dynamicParams: {
-      type: Object
-    },
-    value: {
-      type: [Object, Array]
-    },
-    title: String,
-    width: {
-      type: [String, Number],
-      default: '80%'
-    },
-    height: {
-      type: [String, Number],
-      default: '80%'
-    },
-    dialogHeight: {
-      type: [String, Number],
-      default: 400
-    },
-    multiple: {
-      type: Boolean,
-      default: false
-    },
-    toolbars: {
-      type: Array
-    },
-    labelKey: {
-      type: [String, Function]
-    },
-    preview: {
-      type: Boolean,
-      default: false
-    }
-  },
-  data() {
-    return {
-      dialogVisible: this.visible,
-      selectedValue: this.multiple ? [] : {},
-      dataTemplate: {},
-      initialization: false,
-      showLabel: this.labelKey
-    }
-  },
-  computed: {
-    marginTop() {
-      if (this.height === '100%' || this.height === 100) {
-        return '0'
-      } else {
-        return '5vh'
-      }
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = val
-        if (val) {
-          this.initUI()
-          this.getFormData()
-        }
-      },
-      immediate: true
-    },
-    value(val) {
-      this.selectedValue = val
-    },
-    selectedValue: {
-      handler(val, oldVal) {
-        if (val !== oldVal) {
-          this.$emit('update:value', val)
-        }
-      },
-      deep: true
-    },
-    labelKey: {
-      handler: function(val, oldVal) {
-        if (val) {
-          this.showLabel = val
-        }
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    // 关闭当前窗口
-    closeDialog() {
-      this.JDialogTemplate()
-      this.$emit('close', false)
-      this.$emit('update:value', {})
-    },
-    getFormData() {
-      this.initData(JSON.parse(JSON.stringify(this.data)))
-    },
-    setSelectRow() {
-      this.$refs['dataTemplate'].setSelectRow()
-    },
-    handleSelectChange(val, dataTemplate) {
-      // if (typeof this.labelKey === 'function') {
-      // if (this.$utils.isNotEmpty(val)) {
-      //   ActionUtils.warning('配置错误,请设置一个返回字段')
-      //   this.clearSelection()
-      //   return
-      // }
-      // } else if (typeof this.labelKey === 'string') {
-      //   return data[config]
-      // } else if (typeof this.labelKey === 'undefined') {
+    export default {
+        components: {
+            IbpsSelectorDialog
+        },
+        mixins: [TypeMixin],
+        props: {
+            visible: {
+                type: Boolean,
+                default: false
+            },
+            data: {
+                type: Object
+            },
+            dynamicParams: {
+                type: Object
+            },
+            value: {
+                type: [Object, Array]
+            },
+            title: String,
+            width: {
+                type: [String, Number],
+                default: '80%'
+            },
+            height: {
+                type: [String, Number],
+                default: '100%'
+            },
+            dialogHeight: {
+                type: [String, Number],
+                default: 400
+            },
+            multiple: {
+                type: Boolean,
+                default: false
+            },
+            toolbars: {
+                type: Array
+            },
+            labelKey: {
+                type: [String, Function]
+            },
+            preview: {
+                type: Boolean,
+                default: false
+            }
+        },
+        data() {
+            return {
+                dialogVisible: this.visible,
+                selectedValue: this.multiple ? [] : {},
+                dataTemplate: {},
+                initialization: false,
+                showLabel: this.labelKey
+            }
+        },
+        computed: {
+            marginTop() {
+                if (this.height === '100%' || this.height === 100) {
+                    return '0'
+                } else {
+                    return '5vh'
+                }
+            }
+        },
+        watch: {
+            visible: {
+                handler: function (val, oldVal) {
+                    this.dialogVisible = val
+                    if (val) {
+                        this.initUI()
+                        this.getFormData()
+                    }
+                },
+                immediate: true
+            },
+            value(val) {
+                this.selectedValue = val
+            },
+            selectedValue: {
+                handler(val, oldVal) {
+                    if (val !== oldVal) {
+                        this.$emit('update:value', val)
+                    }
+                },
+                deep: true
+            },
+            labelKey: {
+                handler: function (val, oldVal) {
+                    if (val) {
+                        this.showLabel = val
+                    }
+                },
+                immediate: true
+            }
+        },
+        methods: {
+            // 关闭当前窗口
+            closeDialog() {
+                this.JDialogTemplate()
+                this.$emit('close', false)
+                this.$emit('update:value', {})
+            },
+            getFormData() {
+                this.initData(JSON.parse(JSON.stringify(this.data)))
+            },
+            setSelectRow() {
+                this.$refs['dataTemplate'].setSelectRow()
+            },
+            handleSelectChange(val, dataTemplate) {
+                // if (typeof this.labelKey === 'function') {
+                //     if (this.$utils.isNotEmpty(val)) {
+                //         ActionUtils.warning('配置错误,请设置一个返回字段')
+                //         this.clearSelection()
+                //         return
+                //     }
+                // } else if (typeof this.labelKey === 'string') {
+                //     return data[config]
+                // } else if (typeof this.labelKey === 'undefined') {
 
-      // }
-      if (this.dataTemplate.type !== 'dialog' && !this.dataTemplate.templates[0].result_columns) {
-        this.$message({
-          message: '请检查是否设置返回字段!',
-          type: 'warning'
-        })
-        return
-      } else if (dataTemplate) {
-        if (!dataTemplate.templates[0].result_columns) {
-          this.$message({
-            message: '请检查是否设置返回字段!',
-            type: 'warning'
-          })
-          return
-        } else {
-          this.showLabel = buildLabelTitle(dataTemplate)
-        }
-      }
-      this.selectedValue = val
-    },
-    clearSelection() {
-      this.$refs['dataTemplate'].clearSelection()
-    },
-    initUI() {
-      this.initialization = false
-      if (!this.initialization) {
-        this.JDialogTemplate()
-        this.initialization = true
-      }
-    },
-    /**
-     * 初始化脚本
-     */
-    JDialogTemplate() {
-      const dialogId = 'JDialog'
-      let script = document.getElementById(dialogId)
-      if (script) {
-        script.parentNode.removeChild(script)
-      }
-      if (this.data.dialogs.attrs && this.data.dialogs.attrs.script) {
-        const codeScript = this.data.dialogs.attrs.script
-        script = document.createElement('script')
-        script.type = 'text/javascript'
-        script.id = dialogId
-        document.body.appendChild(script)
-        try {
-          script.appendChild(document.createTextNode(codeScript))
-        } catch (ex) {
-          console.error(ex)
-          script.text = codeScript
+                // }
+                if (this.dataTemplate.type !== 'dialog' && !this.dataTemplate.templates[0].result_columns) {
+                    this.$message({
+                        message: '请检查是否设置返回字段!',
+                        type: 'warning'
+                    })
+                    return
+                } else if (dataTemplate) {
+                    if (!dataTemplate.templates[0].result_columns) {
+                        this.$message({
+                            message: '请检查是否设置返回字段!',
+                            type: 'warning'
+                        })
+                        return
+                    } else {
+                        this.showLabel = buildLabelTitle(dataTemplate)
+                    }
+                }
+                this.selectedValue = val
+            },
+            clearSelection() {
+                this.$refs['dataTemplate'].clearSelection()
+            },
+            initUI() {
+                this.initialization = false
+                if (!this.initialization) {
+                    this.JDialogTemplate()
+                    this.initialization = true
+                }
+            },
+            /**
+             * 初始化脚本
+             */
+            JDialogTemplate() {
+                const dialogId = 'JDialog'
+                let script = document.getElementById(dialogId)
+                if (script) {
+                    script.parentNode.removeChild(script)
+                }
+                if (this.data.dialogs.attrs && this.data.dialogs.attrs.script) {
+                    const codeScript = this.data.dialogs.attrs.script
+                    script = document.createElement('script')
+                    script.type = 'text/javascript'
+                    script.id = dialogId
+                    document.body.appendChild(script)
+                    try {
+                        script.appendChild(document.createTextNode(codeScript))
+                    } catch (ex) {
+                        console.error(ex)
+                        script.text = codeScript
+                    }
+                    document.body.appendChild(script)
+                    setTimeout(() => {
+                        this.loadScript()
+                    }, 10)
+                }
+            },
+            // 处理脚本
+            hasScript() {
+                return true
+            },
+            // 加载脚本
+            loadScript() {
+                if (!this.hasScript()) {
+                    return
+                }
+                JDialog._onLoad(this)
+            },
+            // 前置脚本
+            beforeScript(action, position, selection, data, callback) {
+                if (!this.hasScript()) {
+                    const flag = true
+                    callback(flag)
+                    return
+                }
+                JDialog._beforeSubmit(this, action, position, selection, data, callback)
+            },
+            // 后置脚本
+            afterScript(action, position, selection, data, callback) {
+                if (!this.hasScript()) {
+                    const flag = true
+                    callback(flag)
+                    return
+                }
+                JDialog._afterSubmit(this, action, position, selection, data, callback)
+            }
         }
-        document.body.appendChild(script)
-        setTimeout(() => {
-          this.loadScript()
-        }, 10)
-      }
-    },
-    // 处理脚本
-    hasScript() {
-      return true
-    },
-    // 加载脚本
-    loadScript() {
-      if (!this.hasScript()) {
-        return
-      }
-      JDialog._onLoad(this)
-    },
-    // 前置脚本
-    beforeScript(action, position, selection, data, callback) {
-      if (!this.hasScript()) {
-        const flag = true
-        callback(flag)
-        return
-      }
-      JDialog._beforeSubmit(this, action, position, selection, data, callback)
-    },
-    // 后置脚本
-    afterScript(action, position, selection, data, callback) {
-      if (!this.hasScript()) {
-        const flag = true
-        callback(flag)
-        return
-      }
-      JDialog._afterSubmit(this, action, position, selection, data, callback)
     }
-
-  }
-}
 </script>
 <style lang="scss">
-.preview-type-dialog{
-  .el-dialog__body{
-    height:  calc(80vh - 110px) !important;
-  }
-  .el-dialog__body> div:nth-of-type(2){
-    position:relative
-  }
-}
+    .preview-type-dialog {
+        height: 100%;
+        display: flex;
+        justify-content: center;
+        .el-dialog {
+            margin: 5vh 0;
+        }
+        .el-dialog__body {
+            height: calc(100% - 90px) !important;
+            > div:nth-of-type(2) {
+                position: relative;
+                height: calc(100% - 35px);
+                .el-table--small {
+                    // 此处无法自适应,260为搜索栏换行时大致高度,不可修改
+                    min-height: calc(90vh - 260px);
+                }
+            }
+        }
+    }
 </style>

+ 281 - 282
src/business/platform/file/uploader/index.vue

@@ -1,291 +1,290 @@
 <template>
-  <el-dialog
-    v-if="dialogVisible"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    :title="title"
-    :top="marginTop"
-    append-to-body
-    custom-class="ibps-uploader-dialog"
-    @close="closeDialog"
-  >
-    <el-tabs
-      v-model="activeName"
-      class="uploader-tab"
-      @tab-click="onTabClick"
+    <el-dialog
+        v-if="dialogVisible"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :title="title"
+        :top="marginTop"
+        append-to-body
+        custom-class="ibps-uploader-dialog"
+        @close="closeDialog"
     >
-      <el-tab-pane label="当前上传附件" name="upload">
-        <upload
-          ref="upload"
-          :multiple="multiple"
-          :file-size="size"
-          :accept="acceptRule"
-          :height="height"
-          :init="dialogVisible"
-          :limit="limit"
-          @callback="uploadCallback"
-        />
-      </el-tab-pane>
-      <el-tab-pane label="选择历史上传附件" name="online">
-        <online
-          ref="online"
-          :multiple="multiple"
-          :file-size="size"
-          :height="height"
-          :accept="acceptRule"
-          :limit="limit"
-          :load="onlineLoad"
-          @format="onFormat"
-          @callback="onlineCallback"
-        />
-      </el-tab-pane>
-    </el-tabs>
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar
-        :actions="toolbars"
-        @action-event="handleActionEvent"
-      />
-    </div>
-  </el-dialog>
+        <el-tabs
+            v-model="activeName"
+            class="uploader-tab"
+            @tab-click="onTabClick"
+        >
+            <el-tab-pane label="当前上传附件" name="upload">
+                <upload
+                    ref="upload"
+                    :multiple="multiple"
+                    :file-size="size"
+                    :accept="acceptRule"
+                    :height="height"
+                    :init="dialogVisible"
+                    :limit="limit"
+                    @callback="uploadCallback"
+                />
+            </el-tab-pane>
+            <el-tab-pane label="选择历史上传附件" name="online">
+                <online
+                    ref="online"
+                    :multiple="multiple"
+                    :file-size="size"
+                    :height="height"
+                    :accept="acceptRule"
+                    :limit="limit"
+                    :load="onlineLoad"
+                    @format="onFormat"
+                    @callback="onlineCallback"
+                />
+            </el-tab-pane>
+        </el-tabs>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar
+                :actions="toolbars"
+                @action-event="handleActionEvent"
+            />
+        </div>
+    </el-dialog>
 </template>
 
 <script>
-import { fileTypes, allFileTypes, accept as acceptTypes } from '@/business/platform/file/constants/fileTypes'
-import upload from './upload'
-import online from './online'
+    import { fileTypes, allFileTypes, accept as acceptTypes} from '@/business/platform/file/constants/fileTypes'
+    import upload from './upload'
+    import online from './online'
 
-export default {
-  components: {
-    upload,
-    online
-  },
-  props: {
-    value: {
-      type: [String, Number, Array, Object]
-    },
-    multiple: {
-      type: Boolean,
-      default: false
-    },
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    title: {
-      type: String,
-      default: '文件上传'
-    },
-    marginTop: {
-      type: String,
-      default: '5vh'
-    },
-    height: {
-      type: String,
-      default: '400px'
-    },
-    fileSize: [Number, String],
-    limit: {
-      type: Number
-    },
-    accept: {
-      type: String,
-      default: ''
-    },
-    fileExt: {
-      type: Array,
-      default: () => []
-    }
-  },
-  data() {
-    return {
-      dialogVisible: this.visible,
-      activeName: 'upload',
-      buttonKey: 'confirm',
-      onlineLoad: false,
-      format: true,
-
-      fileTypes: fileTypes,
-      allFileTypes: allFileTypes,
-      acceptTypes: acceptTypes,
-      size: null,
-      targetExt: false,
-      acceptRule: '',
-      uploadFileList: [],
-      onlineFileList: [],
-      fileList: this.multiple ? [] : {},
-      toolbars: [
-        { key: 'confirm' ,type: 'primary', label:'文件上传'},
-        { key: 'cancel' }
-      ]
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = this.visible
-        this.activeName = 'upload'
-        this.uploadFileList = []
-      },
-      immediate: true
-    },
-    accept: {
-      handler: function(val, oldVal) {
-        if (val === '*' && this.fileExt.length !== 0) {
-          const str = '.' + this.fileExt.join(',').replace(/,/g, ',.')
-          this.acceptRule = str
-        } else {
-          this.acceptRule = val
-        }
-      },
-      immediate: true
-    },
-    fileSize: {
-      handler: function(val, oldVal) {
-        if (this.$utils.isNotEmpty(val)) {
-          this.size = typeof val === 'number' ? val * 1024 * 1024 : parseFloat(val) * 1024 * 1024
-        }
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    handleActionEvent({ key }) {
-      switch (key) {
-        case 'confirm':
-          this.handleConfirm()
-          break
-        case 'cancel':
-          this.closeDialog()
-          break
-        default:
-          break
-      }
-    },
-    uploadCallback(data) {
-      this.uploadFileList = data
-      if (this.multiple) {
-        this.fileList = this.$utils.isNotEmpty(this.value) ? [...this.value, ...this.uploadFileList] : this.uploadFileList
-      } else {
-        this.onlineFileList = []
-        this.fileList = this.uploadFileList
-      }
-    },
-    onlineCallback(data) {
-      this.onlineFileList = data
-      if (this.multiple) {
-        this.fileList = this.$utils.isNotEmpty(this.value) ? [...this.uploadFileList, ...data, ...this.value] : data
-      } else {
-        this.uploadFileList = []
-        this.fileList = data
-      }
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      this.uploadFileList = []
-      this.onlineFileList = []
-      this.$emit('close', false)
-    },
-    onTabClick(tab) {
-      if (tab.name === 'online') {
-        this.onlineLoad = !this.onlineLoad
-      }
-    },
-    onFormat(format) {
-      this.format = format
-    },
-    /**
-     * 文件类型的限制
-     */
-    fileExtType() {
-      const accept = this.accept
-      const acceptTypes = this.acceptTypes
-      const fileTypes = this.fileTypes
-      let type = ''
-      let targetFileTypes = []
-      this.targetExt = false
-      for (const i in acceptTypes) {
-        if (acceptTypes[i] === accept) {
-          type = i
-          targetFileTypes = fileTypes[i]
-        } else {
-          if (accept === '*') {
-            // 不限制
-            targetFileTypes = '*'
-          } else {
-            // 自定义
-            targetFileTypes = accept.split(',')
-          }
-        }
-      }
-      const fileList = this.multiple ? this.fileList : [this.fileList]
-      if (targetFileTypes !== '*') {
-        this.targetExt = fileList.every(i => {
-          // console.log(targetFileTypes, `.${i.ext}`) // 控件类型集,过滤文件得后缀
-          if (type === 'compress') {
-            return targetFileTypes.includes(`${i.ext}`)
-          } else {
-            return targetFileTypes.includes(`.${i.ext}`)
-          }
-        })
-      } else {
-        this.targetExt = true
-      }
-      // console.log(fileList, this.targetExt, 'lll') // 已上传文件,过滤结果
-      return this.targetExt
-    },
-    handleConfirm() {
-      const arr = []
-      if (!this.multiple) {
-        if (this.$utils.isNotEmpty(this.uploadFileList)) {
-          arr.push(this.uploadFileList)
-          this.fileList = this.uploadFileList
-        }
-        if (this.$utils.isNotEmpty(this.onlineFileList)) {
-          arr.push(this.onlineFileList)
-          this.fileList = this.onlineFileList
-        }
-      }
-      // console.log(this.fileList, 'fileList')
-      if (this.$utils.isNotEmpty(arr) && arr.length > 1) {
-        this.$message.closeAll()
-        this.$message({
-          message: '附件上传设置为单选,选择文件数量只能为1个',
-          type: 'warning'
-        })
-        return
-      }
-      if (this.$utils.isNotEmpty(this.limit) && this.limit < this.fileList.length) {
-        this.$message.closeAll()
-        this.$message({
-          message: '超过设置最大上传数量限制' + this.limit,
-          type: 'warning'
-        })
-        return
-      }
-      if (!this.fileExtType()) {
-        this.$message.closeAll()
-        this.$message({
-          message: '选择的附件中存在不符合规定类型的文件,请重新选择!',
-          type: 'warning'
-        })
-        return
-      }
-      if (!this.format) {
-        this.$message.closeAll()
-        this.$message.error('选择文件格式不允许!')
-      } else {
-        if (this.$utils.isEmpty(this.fileList)) {
-          this.$message.closeAll()
-          this.$message({
-            message: '请上传或选择文件,或待文件上传成功后在继续操作!',
-            type: 'warning'
-          })
-          return
+    export default {
+        components: {
+            upload,
+            online
+        },
+        props: {
+            value: {
+                type: [String, Number, Array, Object]
+            },
+            multiple: {
+                type: Boolean,
+                default: false
+            },
+            visible: {
+                type: Boolean,
+                default: false
+            },
+            title: {
+                type: String,
+                default: '文件上传'
+            },
+            marginTop: {
+                type: String,
+                default: '5vh'
+            },
+            height: {
+                type: String,
+                default: '400px'
+            },
+            fileSize: [Number, String],
+            limit: {
+                type: Number
+            },
+            accept: {
+                type: String,
+                default: ''
+            },
+            fileExt: {
+                type: Array,
+                default: () => []
+            }
+        },
+        data() {
+            return {
+                dialogVisible: this.visible,
+                activeName: 'upload',
+                buttonKey: 'confirm',
+                onlineLoad: false,
+                format: true,
+                fileTypes: fileTypes,
+                allFileTypes: allFileTypes,
+                acceptTypes: acceptTypes,
+                size: null,
+                targetExt: false,
+                acceptRule: '',
+                uploadFileList: [],
+                onlineFileList: [],
+                fileList: this.multiple ? [] : {},
+                toolbars: [
+                    { key: 'confirm', type: 'primary', label: '文件上传' },
+                    { key: 'cancel' }
+                ]
+            }
+        },
+        watch: {
+            visible: {
+                handler: function (val, oldVal) {
+                    this.dialogVisible = this.visible
+                    this.activeName = 'upload'
+                    this.uploadFileList = []
+                },
+                immediate: true
+            },
+            accept: {
+                handler: function (val, oldVal) {
+                    if (val === '*' && this.fileExt.length !== 0) {
+                        const str = '.' + this.fileExt.join(',').replace(/,/g, ',.')
+                        this.acceptRule = str
+                    } else {
+                        this.acceptRule = val
+                    }
+                },
+                immediate: true
+            },
+            fileSize: {
+                handler: function (val, oldVal) {
+                    if (this.$utils.isNotEmpty(val)) {
+                        this.size = typeof val === 'number' ? val * 1024 * 1024 : parseFloat(val) * 1024 * 1024
+                    }
+                },
+                immediate: true
+            }
+        },
+        methods: {
+            handleActionEvent({ key }) {
+                switch (key) {
+                    case 'confirm':
+                        this.handleConfirm()
+                        break
+                    case 'cancel':
+                        this.closeDialog()
+                        break
+                    default:
+                        break
+                }
+            },
+            uploadCallback(data) {
+                this.uploadFileList = data
+                if (this.multiple) {
+                    this.fileList = this.$utils.isNotEmpty(this.value) ? [...this.value, ...this.uploadFileList] : this.uploadFileList
+                } else {
+                    this.onlineFileList = []
+                    this.fileList = this.uploadFileList
+                }
+            },
+            onlineCallback(data) {
+                this.onlineFileList = data
+                if (this.multiple) {
+                    this.fileList = this.$utils.isNotEmpty(this.value) ? [...this.uploadFileList, ...data, ...this.value] : data
+                } else {
+                    this.uploadFileList = []
+                    this.fileList = data
+                }
+            },
+            // 关闭当前窗口
+            closeDialog() {
+                this.uploadFileList = []
+                this.onlineFileList = []
+                this.$emit('close', false)
+            },
+            onTabClick(tab) {
+                if (tab.name === 'online') {
+                    this.onlineLoad = !this.onlineLoad
+                }
+            },
+            onFormat(format) {
+                this.format = format
+            },
+            /**
+             * 文件类型的限制
+             */
+            fileExtType() {
+                const accept = this.accept
+                const acceptTypes = this.acceptTypes
+                const fileTypes = this.fileTypes
+                let type = ''
+                let targetFileTypes = []
+                this.targetExt = false
+                for (const i in acceptTypes) {
+                    if (acceptTypes[i] === accept) {
+                        type = i
+                        targetFileTypes = fileTypes[i]
+                    } else {
+                        if (accept === '*') {
+                            // 不限制
+                            targetFileTypes = '*'
+                        } else {
+                            // 自定义
+                            targetFileTypes = accept.split(',')
+                        }
+                    }
+                }
+                const fileList = this.multiple ? this.fileList : [this.fileList]
+                if (targetFileTypes !== '*') {
+                    this.targetExt = fileList.every(i => {
+                        // console.log(targetFileTypes, `.${i.ext}`) // 控件类型集,过滤文件得后缀
+                        if (type === 'compress') {
+                            return targetFileTypes.includes(`${i.ext}`)
+                        } else {
+                            return targetFileTypes.includes(`${i.ext}`)
+                        }
+                    })
+                } else {
+                    this.targetExt = true
+                }
+                // console.log(fileList, this.targetExt, 'lll') // 已上传文件,过滤结果
+                return this.targetExt
+            },
+            handleConfirm() {
+                const arr = []
+                if (!this.multiple) {
+                    if (this.$utils.isNotEmpty(this.uploadFileList)) {
+                        arr.push(this.uploadFileList)
+                        this.fileList = this.uploadFileList
+                    }
+                    if (this.$utils.isNotEmpty(this.onlineFileList)) {
+                        arr.push(this.onlineFileList)
+                        this.fileList = this.onlineFileList
+                    }
+                }
+                // console.log(this.fileList, 'fileList')
+                if (this.$utils.isNotEmpty(arr) && arr.length > 1) {
+                    this.$message.closeAll()
+                    this.$message({
+                        message: '附件上传设置为单选,选择文件数量只能为1个',
+                        type: 'warning'
+                    })
+                    return
+                }
+                if (this.$utils.isNotEmpty(this.limit) && this.limit < this.fileList.length) {
+                    this.$message.closeAll()
+                    this.$message({
+                        message: '超过设置最大上传数量限制' + this.limit,
+                        type: 'warning'
+                    })
+                    return
+                }
+                if (!this.fileExtType()) {
+                    this.$message.closeAll()
+                    this.$message({
+                        message: '选择的附件中存在不符合规定类型的文件,请重新选择!',
+                        type: 'warning'
+                    })
+                    return
+                }
+                if (!this.format) {
+                    this.$message.closeAll()
+                    this.$message.error('选择文件格式不允许!')
+                } else {
+                    if (this.$utils.isEmpty(this.fileList)) {
+                        this.$message.closeAll()
+                        this.$message({
+                            message: '请上传或选择文件,或待文件上传成功后在继续操作!',
+                            type: 'warning'
+                        })
+                        return
+                    }
+                    this.$emit('action-event', this.buttonKey, this.fileList)
+                }
+            }
         }
-        this.$emit('action-event', this.buttonKey, this.fileList)
-      }
     }
-  }
-}
 </script>

+ 312 - 312
src/business/platform/file/uploader/online.vue

@@ -1,319 +1,319 @@
 <template>
-  <div
-    :style="{
-      height:height
-    }"
-  >
-    <el-form :model="form" :inline="true" @keyup.enter.native="onSearch" @submit.native.prevent>
-      <el-form-item label="文件名" prop="name">
-        <el-input v-model="form.name" placeholder="文件名" @keyup.enter.native="onSearch" />
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" @click="onSearch">查询</el-button>
-      </el-form-item>
-    </el-form>
-    <el-table
-      ref="elTable"
-      :data="listData"
-      :row-key="getRowKey"
-      height="340"
-      border
-      @row-click="handleRowClick"
-      @selection-change="handleSelectionChange"
-    >
-      <!--选择列 多选-->
-      <el-table-column
-        v-if="(selectionRow || selectionRow === '') && selectionType === 'checkbox'"
-        v-bind="typeof selectionRow === 'Object'?selectionRow:null"
-        :label="handleAttribute(selectionRow.label, '')"
-        :reserve-selection="true"
-        type="selection"
-      />
-      <!--选择列 单选-->
-      <el-table-column
-        v-if="(selectionRow || selectionRow === '') && selectionType === 'radio'"
-        :label="selectionRow.label||''"
-        :width="selectionRow.width||55"
-      >
-        <template slot-scope="scope">
-          <div @click.stop>
-            <el-radio v-model="selectionRadio" :label="scope.row[pkKey]" @change="changeRowRadio(scope.row)"><span>&nbsp;</span></el-radio>
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column label="文件名" prop="fileName" />
-      <el-table-column label="扩展名" prop="ext" />
-    </el-table>
-    <el-pagination
-      :current-page="currentPage"
-      :page-size="pageSize"
-      :page-count="pagination[pageCountKey]"
-      :total="pagination[totalKey]"
-      @size-change="handlePaginationSizeChange"
-      @current-change="handlePaginationCurrentChange"
-      @prev-click="handlePaginationPrevClick"
-      @next-click="handlePaginationNextClick"
-    />
-  </div>
+    <div :style="{ height: height }">
+        <el-form :model="form" :inline="true" @keyup.enter.native="onSearch" @submit.native.prevent>
+            <el-form-item label="文件名" prop="name">
+                <el-input v-model="form.name" placeholder="文件名" @keyup.enter.native="onSearch" />
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" @click="onSearch">查询</el-button>
+            </el-form-item>
+        </el-form>
+        <el-table
+            ref="elTable"
+            :data="listData"
+            :row-key="getRowKey"
+            height="340"
+            border
+            @row-click="handleRowClick"
+            @selection-change="handleSelectionChange"
+        >
+            <!--选择列 多选-->
+            <el-table-column
+                v-if="(selectionRow || selectionRow === '') && selectionType === 'checkbox'"
+                v-bind="typeof selectionRow === 'Object' ? selectionRow : null"
+                :label="handleAttribute(selectionRow.label, '')"
+                :reserve-selection="true"
+                type="selection"
+            />
+            <!--选择列 单选-->
+            <el-table-column
+                v-if="(selectionRow || selectionRow === '') && selectionType === 'radio'"
+                :label="selectionRow.label || ''"
+                :width="selectionRow.width || 55"
+            >
+                <template slot-scope="scope">
+                    <div @click.stop>
+                        <el-radio v-model="selectionRadio" :label="scope.row[pkKey]" @change="changeRowRadio(scope.row)">
+                            <span>&nbsp;</span>
+                        </el-radio>
+                    </div>
+                </template>
+            </el-table-column>
+            <el-table-column label="文件名" prop="fileName" />
+            <el-table-column label="扩展名" prop="ext" />
+        </el-table>
+        <el-pagination
+            :current-page="currentPage"
+            :page-size="pageSize"
+            :page-count="pagination[pageCountKey]"
+            :total="pagination[totalKey]"
+            @size-change="handlePaginationSizeChange"
+            @current-change="handlePaginationCurrentChange"
+            @prev-click="handlePaginationPrevClick"
+            @next-click="handlePaginationNextClick"
+        />
+    </div>
 </template>
 <script>
-import { fileTypes, allFileTypes, accept as acceptTypes } from '@/business/platform/file/constants/fileTypes'
-import { queryPageList } from '@/api/platform/file/attachment'
-import ActionUtils from '@/utils/action'
-export default {
-  props: {
-    height: String,
-    load: Boolean,
-    multiple: Boolean,
-    fileSize: { // 上传尺寸
-      type: Number
-    },
-    value: [Object, Array],
-    limit: {
-      type: Number
-    },
-    accept: String
-  },
-  data() {
-    return {
-      listData: [],
-      pagination: {},
-      sorts: {},
-      selectionRadio: '',
-      pkKey: 'id',
-      currentPage: 0,
-      pageSizes: [10, 20, 50, 100],
-      pageSize: 20,
-      totalKey: 'totalCount',
-      pageKey: 'page',
-      pageCountKey: 'totalPages',
-      selectionRow: true,
-      format: true,
-      form: {
-        name: ''
-      },
-      fileList: [],
-      multipleSelection: [],
-      targetExt: false,
-      fileTypes: fileTypes,
-      allFileTypes: allFileTypes,
-      acceptTypes: acceptTypes
-    }
-  },
-  computed: {
-    selectionType() {
-      return this.multiple ? 'checkbox' : 'radio'
-    }
-  },
-  watch: {
-    load: {
-      handler() {
-        this.loadData()
-      },
-      immediate: true
-    },
-    selectionRadio(val, oldVal) {
-      if (this.$utils.isNotEmpty(val)) {
-        this.$emit('callback', this.listData.find((data) => {
-          if (data.id === val) {
-            return data
-          }
-        }))
-      }
-    }
-  },
-  methods: {
-    getRowKey(row) {
-      return row.id
-    },
-    handleSelectionChange(val) {
-      if (this.limit && this.limit === 0) {
-        this.$message({
-          message: '上传个数不能为0',
-          type: 'warning'
-        })
-        return
-      }
-      var pass = true
-      val.forEach(i => {
-        if (this.$utils.isNotEmpty(this.fileSize) && this.fileSize < i.totalBytes) {
-          this.$message({
-            message: '上传文件的大小大于' + this.$utils.formatSize(this.fileSize),
-            type: 'warning'
-          })
-          pass = false
-          this.$refs.elTable.toggleRowSelection(i, pass)
-        }
+    import { fileTypes, allFileTypes, accept as acceptTypes } from '@/business/platform/file/constants/fileTypes'
+    import { queryPageList } from '@/api/platform/file/attachment'
+    import ActionUtils from '@/utils/action'
+    export default {
+        props: {
+            height: String,
+            load: Boolean,
+            multiple: Boolean,
+            fileSize: {
+                // 上传尺寸
+                type: Number
+            },
+            value: [Object, Array],
+            limit: {
+                type: Number
+            },
+            accept: String
+        },
+        data() {
+            return {
+                listData: [],
+                pagination: {},
+                sorts: {},
+                selectionRadio: '',
+                pkKey: 'id',
+                currentPage: 0,
+                pageSizes: [10, 20, 50, 100],
+                pageSize: 20,
+                totalKey: 'totalCount',
+                pageKey: 'page',
+                pageCountKey: 'totalPages',
+                selectionRow: true,
+                format: true,
+                form: {
+                    name: ''
+                },
+                fileList: [],
+                multipleSelection: [],
+                targetExt: false,
+                fileTypes: fileTypes,
+                allFileTypes: allFileTypes,
+                acceptTypes: acceptTypes
+            }
+        },
+        computed: {
+            selectionType() {
+                return this.multiple ? 'checkbox' : 'radio'
+            }
+        },
+        watch: {
+            load: {
+                handler() {
+                    this.loadData()
+                },
+                immediate: true
+            },
+            selectionRadio(val, oldVal) {
+                if (this.$utils.isNotEmpty(val)) {
+                    this.$emit('callback', this.listData.find(data => {
+                        if (data.id === val) {
+                            return data
+                        }
+                    }))
+                }
+            }
+        },
+        methods: {
+            getRowKey(row) {
+                return row.id
+            },
+            handleSelectionChange(val) {
+                if (this.limit && this.limit === 0) {
+                    this.$message({
+                        message: '上传个数不能为0',
+                        type: 'warning'
+                    })
+                    return
+                }
+                var pass = true
+                val.forEach(i => {
+                    if (this.$utils.isNotEmpty(this.fileSize) && this.fileSize < i.totalBytes) {
+                        this.$message({
+                            message: '上传文件的大小大于' + this.$utils.formatSize(this.fileSize),
+                            type: 'warning'
+                        })
+                        pass = false
+                        this.$refs.elTable.toggleRowSelection(i, pass)
+                    }
 
-        if (this.$utils.isNotEmpty(this.accept) && this.accept && !this.fileExtType({ name: `${i.fileName}.${i.ext}` })) {
-          this.$message.closeAll()
-          this.$message({
-            message: '不允许的文件类型',
-            type: 'warning'
-          })
-          pass = false
-          this.$refs.elTable.toggleRowSelection(i, pass)
-        }
-      })
-      if (!pass) {
-        return
-      }
-      this.multipleSelection = val
-      this.$emit('callback', val)
-    },
-    /**
-     * @description 行点击时触发的事件
-     */
-    handleRowClick(row, event, column) {
-      // 点击行,触发选中
-      if (this.$utils.isNotEmpty(this.fileSize) && this.fileSize < row.totalBytes) {
-        this.$message({
-          message: '上传文件的大小大于' + this.$utils.formatSize(this.fileSize),
-          type: 'warning'
-        })
-        return
-      }
-      if (this.$utils.isNotEmpty(this.accept) && this.accept && !this.fileExtType({ name: `${row.fileName}.${row.ext}` })) {
-        this.$message.closeAll()
-        this.$message({
-          message: '不允许的文件类型',
-          type: 'warning'
-        })
-        return false
-      }
-      if (this.selectionType === 'radio') {
-        this.selectionRadio = row[this.pkKey]
-      } else {
-        this.$refs.elTable.toggleRowSelection(row)
-      }
-      this.format = true
-      this.$emit('row-click', row, event, column)
-      this.$emit('format', this.format)
-    },
-    /**
-     * 文件类型的检测
-     */
-    fileExtType(file) {
-      const accept = this.accept
-      const acceptTypes = this.acceptTypes
-      const fileTypes = this.fileTypes
-      const arr = file.name.split('.')
-      const result = arr[arr.length - 1]
-      let type = ''
-      this.targetExt = false
-      for (const i in acceptTypes) {
-        if (acceptTypes[i] === accept) {
-          type = i
-        }
-      }
-      if (type !== '' && this.accept !== '*') {
-        // 现存的附件类型
-        const targetFileTypes = fileTypes[type]
-        this.targetExt = targetFileTypes.includes(result)
-      } else {
-        if (this.accept === '*') {
-        // 不限制
-          this.targetExt = true
-        } else {
-        // 自定义
-          const targetFileTypes = this.accept.split(',')
-          this.targetExt = targetFileTypes.includes('.' + result)
+                    if (this.$utils.isNotEmpty(this.accept) && this.accept && !this.fileExtType({ name: `${i.fileName}.${i.ext}` })) {
+                        this.$message.closeAll()
+                        this.$message({
+                            message: '不允许的文件类型',
+                            type: 'warning'
+                        })
+                        pass = false
+                        this.$refs.elTable.toggleRowSelection(i, pass)
+                    }
+                })
+                if (!pass) {
+                    return
+                }
+                this.multipleSelection = val
+                this.$emit('callback', val)
+            },
+            /**
+             * @description 行点击时触发的事件
+             */
+            handleRowClick(row, event, column) {
+                // 点击行,触发选中
+                if (this.$utils.isNotEmpty(this.fileSize) && this.fileSize < row.totalBytes) {
+                    this.$message({
+                        message: '上传文件的大小大于' + this.$utils.formatSize(this.fileSize),
+                        type: 'warning'
+                    })
+                    return
+                }
+
+                if (this.$utils.isNotEmpty(this.accept) && this.accept && !this.fileExtType({ name: `${row.fileName}.${row.ext}` })) {
+                    this.$message.closeAll()
+                    this.$message({
+                        message: '不允许的文件类型',
+                        type: 'warning'
+                    })
+                    return false
+                }
+                if (this.selectionType === 'radio') {
+                    this.selectionRadio = row[this.pkKey]
+                } else {
+                    this.$refs.elTable.toggleRowSelection(row)
+                }
+                this.format = true
+                this.$emit('row-click', row, event, column)
+                this.$emit('format', this.format)
+            },
+            /**
+             * 文件类型的检测
+             */
+            fileExtType(file) {
+                const accept = this.accept
+                const acceptTypes = this.acceptTypes
+                const fileTypes = this.fileTypes
+                const arr = file.name.split('.')
+                const result = arr[arr.length - 1]
+                let type = ''
+                this.targetExt = false
+                for (const i in acceptTypes) {
+                    if (acceptTypes[i] === accept) {
+                        type = i
+                    }
+                }
+                if (type !== '' && this.accept !== '*') {
+                    // 现存的附件类型
+                    const targetFileTypes = fileTypes[type]
+                    this.targetExt = targetFileTypes.includes(result)
+                } else {
+                    if (this.accept === '*') {
+                        // 不限制
+                        this.targetExt = true
+                    } else {
+                        // 自定义
+                        const targetFileTypes = this.accept.split(',')
+                        this.targetExt = targetFileTypes.includes('.' + result)
+                    }
+                }
+                return this.targetExt
+            },
+            /**
+             * @description 单选点击时触发的事件[阻止冒泡后单选值补充]
+             */
+            changeRowRadio(row) {
+                if (this.$utils.isNotEmpty(this.fileSize) && this.fileSize < row.totalBytes) {
+                    this.$message({
+                        message: '上传文件的大小大于' + this.$utils.formatSize(this.fileSize),
+                        type: 'warning'
+                    })
+                    return
+                }
+                if (this.$utils.isNotEmpty(this.accept) && this.accept && !this.fileExtType({ name: `${row.fileName}.${row.ext}` })) {
+                    this.$message.closeAll()
+                    this.$message({
+                        message: '不允许的文件类型',
+                        type: 'warning'
+                    })
+                    return
+                }
+                this.selectionRadio = row[this.pkKey]
+            },
+            toggleRowSelection(row, selected) {
+                if (this.selectionType === 'radio') {
+                    this.selectionRadio = row ? row[this.pkKey] : ''
+                } else {
+                    this.$refs.elTable.toggleRowSelection(row, selected)
+                }
+            },
+            loadData() {
+                this.loading = true
+                queryPageList(this.getSearcFormData()).then(response => {
+                    ActionUtils.handleListData(this, response.data)
+                    this.loading = false
+                }).catch(() => {
+                    this.loading = false
+                })
+            },
+            getSearcFormData() {
+                return ActionUtils.formatParams(
+                    {
+                        'Q^FILE_NAME_^SL': this.form.name
+                    },
+                    this.pagination,
+                    this.sorts
+                )
+            },
+            onSearch() {
+                this.loadData()
+            },
+            /**
+             * @description 每页条数改变
+             */
+            handlePaginationSizeChange(pageSize) {
+                this.handlePaginationChange({ pageSize: pageSize })
+            },
+            /**
+             * @description 当前页码改变
+             */
+            handlePaginationCurrentChange(currentPage) {
+                this.handlePaginationChange({ currentPage: currentPage })
+            },
+            /**
+             * @description 上一页
+             */
+            handlePaginationPrevClick(currentPage) {
+                this.handlePaginationChange({ currentPage: currentPage })
+            },
+            /**
+             * @description 下一页
+             */
+            handlePaginationNextClick(currentPage) {
+                this.handlePaginationChange({ currentPage: currentPage })
+            },
+            /**
+             * 处理分页事件
+             */
+            handlePaginationChange({ pageSize, currentPage }) {
+                ActionUtils.setPagination(this.pagination, {
+                    limit: pageSize || this.pageSize,
+                    page: currentPage || this.currentPage
+                })
+                this.loadData()
+            },
+            /**
+             * @description 组件属性默认值
+             */
+            handleAttribute(attribute, defaultValue) {
+                if (attribute === false || attribute === 0 || attribute === '') {
+                    return attribute
+                }
+                return attribute || defaultValue
+            }
         }
-      }
-      return this.targetExt
-    },
-    /**
-     * @description 单选点击时触发的事件[阻止冒泡后单选值补充]
-     */
-    changeRowRadio(row) {
-      if (this.$utils.isNotEmpty(this.fileSize) && this.fileSize < row.totalBytes) {
-        this.$message({
-          message: '上传文件的大小大于' + this.$utils.formatSize(this.fileSize),
-          type: 'warning'
-        })
-        return
-      }
-      if (this.$utils.isNotEmpty(this.accept) && this.accept && !this.fileExtType({ name: `${row.fileName}.${row.ext}` })) {
-        this.$message.closeAll()
-        this.$message({
-          message: '不允许的文件类型',
-          type: 'warning'
-        })
-        return
-      }
-      this.selectionRadio = row[this.pkKey]
-    },
-    toggleRowSelection(row, selected) {
-      if (this.selectionType === 'radio') {
-        this.selectionRadio = row ? row[this.pkKey] : ''
-      } else {
-        this.$refs.elTable.toggleRowSelection(row, selected)
-      }
-    },
-    loadData() {
-      this.loading = true
-      queryPageList(this.getSearcFormData()).then(response => {
-        ActionUtils.handleListData(this, response.data)
-        this.loading = false
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    getSearcFormData() {
-      return ActionUtils.formatParams(
-        {
-          'Q^FILE_NAME_^SL': this.form.name
-        },
-        this.pagination,
-        this.sorts)
-    },
-    onSearch() {
-      this.loadData()
-    },
-    /**
-     * @description 每页条数改变
-     */
-    handlePaginationSizeChange(pageSize) {
-      this.handlePaginationChange({ pageSize: pageSize })
-    },
-    /**
-     * @description 当前页码改变
-     */
-    handlePaginationCurrentChange(currentPage) {
-      this.handlePaginationChange({ currentPage: currentPage })
-    },
-    /**
-     * @description 上一页
-     */
-    handlePaginationPrevClick(currentPage) {
-      this.handlePaginationChange({ currentPage: currentPage })
-    },
-    /**
-     * @description 下一页
-     */
-    handlePaginationNextClick(currentPage) {
-      this.handlePaginationChange({ currentPage: currentPage })
-    },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange({ pageSize, currentPage }) {
-      ActionUtils.setPagination(this.pagination, {
-        limit: pageSize || this.pageSize,
-        page: currentPage || this.currentPage
-      })
-      this.loadData()
-    },
-    /**
-     * @description 组件属性默认值
-     */
-    handleAttribute(attribute, defaultValue) {
-      if (attribute === false || attribute === 0 || attribute === '') {
-        return attribute
-      }
-      return attribute || defaultValue
     }
-  }
-
-}
 </script>

+ 6 - 4
src/views/peopleManages/personComcont/RingChart.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="pieView">
-    <div style="height: 20%;line-height: 30px;text-align: left;padding-left: 10px;color: white;">{{info.config.title||""}}</div>
-    <div style="width:100%;height:80%;display: inline-block; overflow: hidden;">
+    <div style="height: 16%;line-height: 30px;text-align: left;padding-left: 10px;color: white;">{{info.config.title||""}}</div>
+    <div style="width:100%;height:86%;display: inline-block; overflow: hidden;">
       <div :id="info.config.idSelector" style="width:100%;height:95%;overflow: hidden;"> </div>
     </div>
   </div>
@@ -47,8 +47,9 @@ export default {
         color: this.info.color,
         legend: {
           // show: true,
-          z: 3,
-          orient: 'vertical',
+          z: 2,
+          top:'-2%',
+          // orient: 'vertical',
           left: 'right',
           textStyle:{
             color: '#fff'
@@ -62,6 +63,7 @@ export default {
             // name: "Access From",
             type: "pie",
             radius: ["40%", "70%"],
+            top:'2%',
             avoidLabelOverlap: false,
             label: {
               show: true,

+ 2 - 2
src/views/peopleManages/taskStatistics/index.vue

@@ -145,7 +145,7 @@ export default {
         },
         legend: {
           // show: true,
-          left: "0%",
+          right: "0%",
           itemGap: 2,
           itemWidth: 16,
           textStyle: {
@@ -274,7 +274,7 @@ export default {
         },
         legend: {
           // show: true,
-          left: "0%",
+          right: "0%",
           itemGap: 2,
           itemWidth: 16,
           textStyle: {

+ 407 - 453
src/views/platform/bpmn/bpmAgent/edit.vue

@@ -1,202 +1,109 @@
 <template>
-  <el-dialog
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    class="bpmn-agent-dialog"
-    width="80%"
-    top="10vh"
-    @open="getFormData"
-    @close="closeDialog"
-  >
-    <el-form
-      ref="agentForm"
-      v-loading="dialogLoading"
-      :element-loading-text="$t('common.loading')"
-      :model="bpmAgent"
-      :rules="rules"
-      :label-width="formLabelWidth"
-      @submit.native.prevent
-    >
-      <el-form-item label="标题:" prop="title">
-        <el-input v-if="!readonly" v-model="bpmAgent.title" />
-        <span v-else>{{ bpmAgent.title }}</span>
-      </el-form-item>
-      <el-row>
-        <el-col :span="12" col>
-          <el-form-item label="代理类型:" prop="agentType">
-            <el-radio-group v-if="!readonly" v-model="bpmAgent.agentType">
-              <el-radio
-                v-for="option in agentTypeOptions"
-                :key="option.value"
-                :label="option.value"
-              >{{ option.label }}</el-radio>
-            </el-radio-group>
-            <el-tag v-else :type="bpmAgent.agentType|optionsFilter(agentTypeOptions,'type')">{{ bpmAgent.agentType|optionsFilter(agentTypeOptions,'label') }}</el-tag>
-          </el-form-item>
+    <el-dialog :title="title" :visible.sync="dialogVisible" :close-on-click-modal="false" :close-on-press-escape="false" append-to-body class="bpmn-agent-dialog" width="80%" top="10vh" @open="getFormData" @close="closeDialog">
+        <el-form ref="agentForm" v-loading="dialogLoading" :element-loading-text="$t('common.loading')" :model="bpmAgent" :rules="rules" :label-width="formLabelWidth" @submit.native.prevent>
+            <el-image style="width: 400px; height: 500px;margin-left: 100px" :src="url" :preview-src-list="srcList"> </el-image>
+            <el-form-item label="标题:" prop="title">
+                <el-input v-if="!readonly" v-model="bpmAgent.title" />
+                <span v-else>{{ bpmAgent.title }}</span>
+            </el-form-item>
+            <el-row>
+                <el-col :span="12" col>
+                    <el-form-item label="代理类型:" prop="agentType">
+                        <el-radio-group v-if="!readonly" v-model="bpmAgent.agentType">
+                            <el-radio v-for="option in agentTypeOptions" :key="option.value" :label="option.value">{{ option.label }}</el-radio>
+                        </el-radio-group>
+                        <el-tag v-else :type="bpmAgent.agentType | optionsFilter(agentTypeOptions, 'type')">{{ bpmAgent.agentType | optionsFilter(agentTypeOptions, 'label') }}</el-tag>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12" col>
+                    <el-form-item label="是否启用:" prop="isEnabled">
+                        <el-switch v-if="!readonly" v-model="bpmAgent.isEnabled" active-value="enabled" inactive-value="disabled" />
+                        <el-tag v-else :type="bpmAgent.isEnabled | optionsFilter(statusOptions, 'type')">{{ bpmAgent.isEnabled | optionsFilter(statusOptions, 'label') }}</el-tag>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-form-item label="委托人:" prop="delegatorId">
+                <ibps-employee-selector v-if="!readonly" v-model="bpmAgent.delegatorId" @callback="callbackDelegatorrInfo" />
+                <span v-else>{{ bpmAgent.delegatorName }}</span>
+            </el-form-item>
+            <el-row>
+                <el-col :span="12" col>
+                    <el-form-item label="生效时间:" prop="effectiveTime">
+                        <el-date-picker v-if="!readonly" v-model="bpmAgent.effectiveTime" type="date" value-format="yyyy-MM-dd" style="width:100%;" />
+                        <span v-else>{{ bpmAgent.effectiveTime }}</span>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12" col>
+                    <el-form-item label="失效时间:" prop="expiryTime">
+                        <el-date-picker v-if="!readonly" v-model="bpmAgent.expiryTime" type="date" value-format="yyyy-MM-dd" style="width:100%;" />
+                        <span v-else>{{ bpmAgent.expiryTime }}</span>
+                    </el-form-item>
+                </el-col>
+            </el-row>
 
-        </el-col>
-        <el-col :span="12" col>
-          <el-form-item label="是否启用:" prop="isEnabled">
-            <el-switch
-              v-if="!readonly"
-              v-model="bpmAgent.isEnabled"
-              active-value="enabled"
-              inactive-value="disabled"
-            />
-            <el-tag v-else :type="bpmAgent.isEnabled|optionsFilter(statusOptions,'type')">{{ bpmAgent.isEnabled|optionsFilter(statusOptions,'label') }}</el-tag>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-form-item label="委托人:" prop="delegatorId">
-        <ibps-employee-selector
-          v-if="!readonly"
-          v-model="bpmAgent.delegatorId"
-          @callback="callbackDelegatorrInfo"
-        />
-        <span v-else>{{ bpmAgent.delegatorName }}</span>
-      </el-form-item>
-      <el-row>
-        <el-col :span="12" col>
-          <el-form-item label="生效时间:" prop="effectiveTime">
-            <el-date-picker v-if="!readonly" v-model="bpmAgent.effectiveTime" type="date" value-format="yyyy-MM-dd" style="width:100%;" />
-            <span v-else>{{ bpmAgent.effectiveTime }}</span>
-          </el-form-item>
+            <!-- 全部代理 || 部分代理 -->
+            <el-form-item v-if="bpmAgent.agentType === 'all' || bpmAgent.agentType === 'part'" label="代理人:" prop="agenterId">
+                <ibps-employee-selector v-if="!readonly" v-model="bpmAgent.agenterId" @callback="callbackAgenterInfo" />
+                <span v-else>{{ bpmAgent.agenterName }}</span>
+            </el-form-item>
 
-        </el-col>
-        <el-col :span="12" col>
-          <el-form-item label="失效时间:" prop="expiryTime">
-            <el-date-picker v-if="!readonly" v-model="bpmAgent.expiryTime" type="date" value-format="yyyy-MM-dd" style="width:100%;" />
-            <span v-else>{{ bpmAgent.expiryTime }}</span>
-          </el-form-item>
+            <div v-if="bpmAgent.agentType === 'part'">
+                <el-form-item label="流程定义">
+                    <div v-if="!readonly" class="dialog-right">
+                        <bpm-definition-selector button multiple @callback="updateDefine" />
+                        <el-button class="ibps-icon-remove ibps-ml-10" type="danger" @click="handleAllDelete(multipleSelection)">删除</el-button>
+                    </div>
+                </el-form-item>
+                <el-form-item v-loading="rowLoading" label-width="20px" :element-loading-text="$t('common.loading')">
+                    <el-table ref="multipleTable" border :data="bpmAgent.bpmAgentDefPoList" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
+                        <el-table-column v-if="!readonly" type="selection" width="45" />
+                        <el-table-column label="流程名称">
+                            <template slot-scope="scope">{{ scope.row.procDefName ? scope.row.procDefName : scope.row.name }}</template>
+                        </el-table-column>
+                        <el-table-column v-if="!readonly" label="操作" width="55">
+                            <template slot-scope="scope">
+                                <el-button type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.$index, scope.row)" />
+                            </template>
+                        </el-table-column>
+                    </el-table>
+                </el-form-item>
+            </div>
 
-        </el-col>
-      </el-row>
+            <!-- 条件代理 -->
+            <div v-if="bpmAgent.agentType === 'condition'">
+                <el-form-item label="流程名称:">
+                    <bpm-definition-selector v-model="bpmAgent.procDefId" :disabled="readonly" />
+                </el-form-item>
+                <el-form-item label="流程代理条件">
+                    <div v-if="!readonly" class="dialog-right">
+                        <el-button class="ibps-icon-add" type="primary" @click="openConditionDialog">添加</el-button>
+                        <el-button class="ibps-icon-remove ibps-ml-5" type="danger">删除</el-button>
+                    </div>
+                </el-form-item>
+                <el-form-item v-loading="rowLoading" label-width="20px" :element-loading-text="$t('common.loading')">
+                    <el-table ref="multipleTable" :data="bpmAgent.bpmAgentConditionPoList" tooltip-effect="dark" style="width: 100%" @selection-change="handleConditionChange">
+                        <el-table-column type="selection" width="55" />
+                        <el-table-column label="代理人">
+                            <template slot-scope="scope">{{ scope.row.agenterName }}</template>
+                        </el-table-column>
+                        <el-table-column label="条件名称">
+                            <template slot-scope="scope">{{ scope.row.name }}</template>
+                        </el-table-column>
+                        <el-table-column prop="address" label="管理" width="100px" show-overflow-tooltip>
+                            <el-button type="primary" icon="el-icon-edit" circle @click="handleEdit(scope.$index, scope.row)" />
+                            <el-button type="danger" icon="el-icon-delete" circle @click="handleRemove(scope.$index, scope.row)" />
+                        </el-table-column>
+                    </el-table>
+                </el-form-item>
+            </div>
+        </el-form>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
+        </div>
 
-      <!-- 全部代理 || 部分代理 -->
-      <el-form-item v-if="bpmAgent.agentType === 'all' || bpmAgent.agentType === 'part'" label="代理人:" prop="agenterId">
-        <ibps-employee-selector
-          v-if="!readonly"
-          v-model="bpmAgent.agenterId"
-          @callback="callbackAgenterInfo"
-        />
-        <span v-else>{{ bpmAgent.agenterName }}</span>
-      </el-form-item>
-
-      <div v-if="bpmAgent.agentType === 'part'">
-        <el-form-item label="流程定义">
-          <div v-if="!readonly" class="dialog-right">
-            <bpm-definition-selector
-              button
-              multiple
-              @callback="updateDefine"
-            />
-            <el-button class="ibps-icon-remove ibps-ml-10" type="danger" @click="handleAllDelete(multipleSelection)">删除</el-button>
-          </div>
-        </el-form-item>
-        <el-form-item
-          v-loading="rowLoading"
-          label-width="20px"
-          :element-loading-text="$t('common.loading')"
-        >
-          <el-table
-            ref="multipleTable"
-            border
-            :data="bpmAgent.bpmAgentDefPoList"
-            tooltip-effect="dark"
-            style="width: 100%"
-            @selection-change="handleSelectionChange"
-          >
-            <el-table-column
-              v-if="!readonly"
-              type="selection"
-              width="45"
-            />
-            <el-table-column
-              label="流程名称"
-            >
-              <template slot-scope="scope">{{ scope.row.procDefName?scope.row.procDefName:scope.row.name }}</template>
-            </el-table-column>
-            <el-table-column v-if="!readonly" label="操作" width="55">
-              <template slot-scope="scope">
-                <el-button type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.$index, scope.row)" />
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form-item>
-      </div>
-
-      <!-- 条件代理 -->
-      <div v-if="bpmAgent.agentType === 'condition'">
-        <el-form-item label="流程名称:">
-          <bpm-definition-selector
-            v-model="bpmAgent.procDefId"
-            :disabled="readonly"
-          />
-        </el-form-item>
-        <el-form-item label="流程代理条件">
-          <div v-if="!readonly" class="dialog-right">
-            <el-button class="ibps-icon-add" type="primary" @click="openConditionDialog">添加</el-button>
-            <el-button class="ibps-icon-remove ibps-ml-5" type="danger">删除</el-button>
-          </div>
-        </el-form-item>
-        <el-form-item
-          v-loading="rowLoading"
-          label-width="20px"
-          :element-loading-text="$t('common.loading')"
-        >
-          <el-table
-            ref="multipleTable"
-            :data="bpmAgent.bpmAgentConditionPoList"
-            tooltip-effect="dark"
-            style="width: 100%"
-            @selection-change="handleConditionChange"
-          >
-            <el-table-column
-              type="selection"
-              width="55"
-            />
-            <el-table-column
-              label="代理人"
-            >
-              <template slot-scope="scope">{{ scope.row.agenterName }}</template>
-            </el-table-column>
-            <el-table-column
-              label="条件名称"
-            >
-              <template slot-scope="scope">{{ scope.row.name }}</template>
-            </el-table-column>
-            <el-table-column
-              prop="address"
-              label="管理"
-              width="100px"
-              show-overflow-tooltip
-            >
-              <el-button type="primary" icon="el-icon-edit" circle @click="handleEdit(scope.$index, scope.row)" />
-              <el-button type="danger" icon="el-icon-delete" circle @click="handleRemove(scope.$index, scope.row)" />
-            </el-table-column>
-          </el-table>
-        </el-form-item>
-
-      </div>
-    </el-form>
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar
-        :actions="toolbars"
-        @action-event="handleActionEvent"
-      />
-    </div>
-
-    <!-- 添加规则弹窗 -->
-    <condition
-      :def-id="bpmAgent.procDefId"
-      :visible="conditionDialogVisible"
-      @callback="callbackBpmAgentConditionPoList"
-      @close="visible => conditionDialogVisible = visible"
-    />
-  </el-dialog>
+        <!-- 添加规则弹窗 -->
+        <condition :def-id="bpmAgent.procDefId" :visible="conditionDialogVisible" @callback="callbackBpmAgentConditionPoList" @close="(visible) => (conditionDialogVisible = visible)" />
+    </el-dialog>
 </template>
 
 <script>
@@ -205,285 +112,332 @@ import { agentTypeOptions, statusOptions } from './constants'
 import ActionUtils from '@/utils/action'
 import IbpsEmployeeSelector from '@/business/platform/org/employee/selector'
 import BpmDefinitionSelector from '@/business/platform/bpmn/definition/selector'
+import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
 import Condition from './condition'
 import { setTimeout } from 'timers'
 
 export default {
-  components: {
-    IbpsEmployeeSelector,
-    BpmDefinitionSelector,
-    Condition
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    readonly: {
-      type: Boolean,
-      default: false
-    },
-    id: String,
-    title: String
-  },
-  data() {
-    return {
-      formName: 'agentForm',
-      formLabelWidth: '120px',
-      dialogVisible: this.visible,
-      conditionDialogVisible: false, // 条件规则界面
-      dialogLoading: false,
-      rowLoading: false,
-      statusOptions: statusOptions,
-      agentTypeOptions: agentTypeOptions,
-      defaultForm: {},
-      multipleSelection: [],
-      conditionSelection: [],
-      bpmAgent: {
-        title: '',
-        procDefId: '',
-        procDefKey: '',
-        delegatorId: this.$store.getters.userId,
-        delegatorName: this.$store.getters.name,
-        effectiveTime: '',
-        expiryTime: '',
-        agenterId: '',
-        agenterName: '',
-        agentType: 'all',
-        isEnabled: 'enabled',
-        bpmAgentDefPoList: [],
-        bpmAgentConditionPoList: []
-      },
-      rules: {
-        title: [{ required: true, message: this.$t('validate.required') },
-          { min: 1, max: 64, message: '长度不能超过64个字符', trigger: 'blur' }],
-        delegatorId: [{ required: true, message: this.$t('validate.required') }],
-        agenterId: [{ required: true, message: this.$t('validate.required') }],
-        effectiveTime: [{ required: true, message: this.$t('validate.required') }],
-        expiryTime: [{ required: true, message: this.$t('validate.required') }]
-      },
-      toolbars: [
-        { key: 'save', hidden: () => { return this.readonly } },
-        { key: 'cancel' }
-      ]
-    }
-  },
-  computed: {
-    formId() {
-      return this.id
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = this.visible
-      },
-      immediate: true
-    }
-  },
-  created() {
-    this.defaultForm = JSON.parse(JSON.stringify(this.bpmAgent))
-  },
-  mounted() {
-    this.$nextTick(() => {
-      if (this.$refs.multipleTable) {
-        this.$refs.multipleTable.doLayout()
-      }
-    })
-  },
-  methods: {
-    handleEdit() {
-      this.rowLoading = true
-      setTimeout(() => {
-        this.rowLoading = false
-        // TODO:
-      })
+    components: {
+        IbpsEmployeeSelector,
+        BpmDefinitionSelector,
+        Condition
     },
-    handleRemove() {
-      this.rowLoading = true
-      setTimeout(() => {
-        this.rowLoading = false
-        // TODO:
-      })
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
+        },
+        readonly: {
+            type: Boolean,
+            default: false
+        },
+        id: String,
+        title: String
     },
-    callbackBpmAgentConditionPoList(data) {
-      console.log(data)
-    },
-    handleDelete(index, arr) {
-      this.rowLoading = true
-      setTimeout(() => {
-        if (arr !== []) {
-          this.bpmAgent.bpmAgentDefPoList.splice(index, 1)
-        } else {
-          arr.forEach(i => {
-            this.bpmAgent.bpmAgentDefPoList.forEach(l => {
-              if (i.procDefKey === l.procDefKey) {
-                this.bpmAgent.bpmAgentDefPoList.splice(l, 1)
-              }
-            })
-          })
+    data() {
+        return {
+            formName: 'agentForm',
+            formLabelWidth: '120px',
+            dialogVisible: this.visible,
+            conditionDialogVisible: false, // 条件规则界面
+            dialogLoading: false,
+            rowLoading: false,
+            statusOptions: statusOptions,
+            agentTypeOptions: agentTypeOptions,
+            defaultForm: {},
+            multipleSelection: [],
+            conditionSelection: [],
+            bpmAgent: {
+                title: '',
+                procDefId: '',
+                procDefKey: '',
+                delegatorId: this.$store.getters.userId,
+                delegatorName: this.$store.getters.name,
+                effectiveTime: '',
+                expiryTime: '',
+                agenterId: '',
+                agenterName: '',
+                agentType: 'all',
+                isEnabled: 'enabled',
+                bpmAgentDefPoList: [],
+                bpmAgentConditionPoList: []
+            },
+            rules: {
+                title: [
+                    { required: true, message: this.$t('validate.required') },
+                    { min: 1, max: 64, message: '长度不能超过64个字符', trigger: 'blur' }
+                ],
+                delegatorId: [{ required: true, message: this.$t('validate.required') }],
+                agenterId: [{ required: true, message: this.$t('validate.required') }],
+                effectiveTime: [{ required: true, message: this.$t('validate.required') }],
+                expiryTime: [{ required: true, message: this.$t('validate.required') }]
+            },
+            toolbars: [
+                {
+                    key: 'save',
+                    hidden: () => {
+                        return this.readonly
+                    }
+                },
+                { key: 'cancel' }
+            ],
+            url: '',
+            srcList: []
         }
-        this.rowLoading = false
-      })
     },
-    handleAllDelete(arr) {
-      this.rowLoading = true
-      setTimeout(() => {
-        if (!this.$utils.isEmpty(arr)) {
-          arr.forEach(i => {
-            this.bpmAgent.bpmAgentDefPoList.forEach(l => {
-              if (i.procDefKey === l.procDefKey) {
-                this.bpmAgent.bpmAgentDefPoList.splice(l, 1)
-              }
-            })
-          })
+    computed: {
+        formId() {
+            return this.id
         }
-        this.rowLoading = false
-      })
-    },
-    handleSelectionChange(val) {
-      this.multipleSelection = val
-    },
-    handleConditionChange(val) {
-      this.conditionSelection = val
     },
-    handleActionEvent({ key }) {
-      switch (key) {
-        case 'save':
-          this.handleSave()
-          break
-        case 'cancel':
-          this.closeDialog()
-          break
-        default:
-          break
-      }
-    },
-    // 保存数据
-    handleSave() {
-      this.$refs[this.formName].validate(valid => {
-        if (valid) {
-          this.saveData()
-        } else {
-          ActionUtils.saveErrorMessage()
+    watch: {
+        visible: {
+            handler: function (val, oldVal) {
+                this.dialogVisible = this.visible
+            },
+            immediate: true
         }
-      })
-    },
-    // 提交保存数据
-    saveData() {
-      const data = JSON.parse(JSON.stringify(this.bpmAgent))
-      data.effectiveTime = new Date(this.bpmAgent.effectiveTime).getTime() || ''
-      data.expiryTime = new Date(this.bpmAgent.expiryTime).getTime() || ''
-      // 检测生效时间日期是否发布日期在之前。
-      if (data.effectiveTime > data.expiryTime) {
-        ActionUtils.error('生效时间与失效时间范围不合法!')
-        return
-      }
-      if (this.$utils.isEmpty(this.bpmAgent.bpmAgentDefPoList) && this.bpmAgent.agentType === 'part') {
-        ActionUtils.error('流程定义数据不能为空!')
-        return
-      }
-      save(this.bpmAgent).then(response => {
-        this.$emit('callback', this)
-        ActionUtils.saveSuccessMessage(response.message, (rtn) => {
-          if (this.$utils.isEmpty(this.formId)) {
-            this.$refs[this.formName].resetFields()
-          }
-          if (rtn) {
-            this.closeDialog()
-          }
-        })
-      }).catch((err) => {
-        console.error(err)
-      })
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      this.$emit('close', false)
-      this.$refs[this.formName].resetFields()
-    },
-    /**
-     * 表单验证
-     */
-    formValidate() {
-      if (this.readonly) return
-      this.$nextTick(() => {
-        this.$refs[this.formName].validate(() => {})
-      })
-    },
-    /**
-     * 获取表单数据
-     */
-    getFormData() {
-      if (this.$utils.isEmpty(this.formId)) {
-        // 重置表单
-        this.bpmAgent = JSON.parse(JSON.stringify(this.defaultForm))
-        this.formValidate()
-        return
-      }
-      this.dialogLoading = true
-      get({
-        id: this.formId
-      }).then(response => {
-        this.bpmAgent = response.data
-        console.log(this.bpmAgent)
-        this.formValidate()
-        this.dialogLoading = false
-      }).catch(() => {
-        this.dialogLoading = false
-      })
-    },
-    addDef() {
-      alert('打开流程选择器')
     },
-    callbackDelegatorrInfo(data) {
-      this.bpmAgent.delegatorName = data.name
+    created() {
+        this.defaultForm = JSON.parse(JSON.stringify(this.bpmAgent))
+        this.getImage()
     },
-    callbackAgenterInfo(data) {
-      this.bpmAgent.agenterName = data.name
+    mounted() {
+        this.$nextTick(() => {
+            if (this.$refs.multipleTable) {
+                this.$refs.multipleTable.doLayout()
+            }
+        })
     },
-    updateDefine(data) {
-      this.rowLoading = true
-      const arr = data.map(item => {
-        return {
-          id: '',
-          agentId: '',
-          procDefKey: item.defKey,
-          nodeId: '',
-          name: item.name
-        }
-      })
-      setTimeout(() => {
-        if (this.$utils.isEmpty(this.bpmAgent.bpmAgentDefPoList)) {
-          this.bpmAgent.bpmAgentDefPoList = arr
-        } else {
-          this.bpmAgent.bpmAgentDefPoList = this.bpmAgent.bpmAgentDefPoList.concat(arr)
+    methods: {
+        handleEdit() {
+            this.rowLoading = true
+            setTimeout(() => {
+                this.rowLoading = false
+                // TODO:
+            })
+        },
+        handleRemove() {
+            this.rowLoading = true
+            setTimeout(() => {
+                this.rowLoading = false
+                // TODO:
+            })
+        },
+        callbackBpmAgentConditionPoList(data) {
+            console.log(data)
+        },
+        handleDelete(index, arr) {
+            this.rowLoading = true
+            setTimeout(() => {
+                if (arr !== []) {
+                    this.bpmAgent.bpmAgentDefPoList.splice(index, 1)
+                } else {
+                    arr.forEach((i) => {
+                        this.bpmAgent.bpmAgentDefPoList.forEach((l) => {
+                            if (i.procDefKey === l.procDefKey) {
+                                this.bpmAgent.bpmAgentDefPoList.splice(l, 1)
+                            }
+                        })
+                    })
+                }
+                this.rowLoading = false
+            })
+        },
+        handleAllDelete(arr) {
+            this.rowLoading = true
+            setTimeout(() => {
+                if (!this.$utils.isEmpty(arr)) {
+                    arr.forEach((i) => {
+                        this.bpmAgent.bpmAgentDefPoList.forEach((l) => {
+                            if (i.procDefKey === l.procDefKey) {
+                                this.bpmAgent.bpmAgentDefPoList.splice(l, 1)
+                            }
+                        })
+                    })
+                }
+                this.rowLoading = false
+            })
+        },
+        handleSelectionChange(val) {
+            this.multipleSelection = val
+        },
+        handleConditionChange(val) {
+            this.conditionSelection = val
+        },
+        handleActionEvent({ key }) {
+            switch (key) {
+                case 'save':
+                    this.handleSave()
+                    break
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        // 保存数据
+        handleSave() {
+            this.$refs[this.formName].validate((valid) => {
+                if (valid) {
+                    this.saveData()
+                } else {
+                    ActionUtils.saveErrorMessage()
+                }
+            })
+        },
+        // 提交保存数据
+        saveData() {
+            const data = JSON.parse(JSON.stringify(this.bpmAgent))
+            data.effectiveTime = new Date(this.bpmAgent.effectiveTime).getTime() || ''
+            data.expiryTime = new Date(this.bpmAgent.expiryTime).getTime() || ''
+            // 检测生效时间日期是否发布日期在之前。
+            if (data.effectiveTime > data.expiryTime) {
+                ActionUtils.error('生效时间与失效时间范围不合法!')
+                return
+            }
+            if (this.$utils.isEmpty(this.bpmAgent.bpmAgentDefPoList) && this.bpmAgent.agentType === 'part') {
+                ActionUtils.error('流程定义数据不能为空!')
+                return
+            }
+            save(this.bpmAgent)
+                .then((response) => {
+                    this.$emit('callback', this)
+                    ActionUtils.saveSuccessMessage(response.message, (rtn) => {
+                        if (this.$utils.isEmpty(this.formId)) {
+                            this.$refs[this.formName].resetFields()
+                        }
+                        if (rtn) {
+                            this.closeDialog()
+                        }
+                    })
+                })
+                .catch((err) => {
+                    console.error(err)
+                })
+        },
+        // 关闭当前窗口
+        closeDialog() {
+            this.$emit('close', false)
+            this.$refs[this.formName].resetFields()
+        },
+        /**
+         * 表单验证
+         */
+        formValidate() {
+            if (this.readonly) return
+            this.$nextTick(() => {
+                this.$refs[this.formName].validate(() => {})
+            })
+        },
+        /**
+         * 获取表单数据
+         */
+        getFormData() {
+            if (this.$utils.isEmpty(this.formId)) {
+                // 重置表单
+                this.bpmAgent = JSON.parse(JSON.stringify(this.defaultForm))
+                this.formValidate()
+                return
+            }
+            this.dialogLoading = true
+            get({
+                id: this.formId
+            })
+                .then((response) => {
+                    this.bpmAgent = response.data
+                    console.log(this.bpmAgent)
+                    this.formValidate()
+                    this.dialogLoading = false
+                })
+                .catch(() => {
+                    this.dialogLoading = false
+                })
+        },
+        addDef() {
+            alert('打开流程选择器')
+        },
+        callbackDelegatorrInfo(data) {
+            this.bpmAgent.delegatorName = data.name
+        },
+        callbackAgenterInfo(data) {
+            this.bpmAgent.agenterName = data.name
+        },
+        updateDefine(data) {
+            this.rowLoading = true
+            const arr = data.map((item) => {
+                return {
+                    id: '',
+                    agentId: '',
+                    procDefKey: item.defKey,
+                    nodeId: '',
+                    name: item.name
+                }
+            })
+            setTimeout(() => {
+                if (this.$utils.isEmpty(this.bpmAgent.bpmAgentDefPoList)) {
+                    this.bpmAgent.bpmAgentDefPoList = arr
+                } else {
+                    this.bpmAgent.bpmAgentDefPoList = this.bpmAgent.bpmAgentDefPoList.concat(arr)
+                }
+                this.rowLoading = false
+            })
+        },
+        openConditionDialog() {
+            if (this.$utils.isEmpty(this.bpmAgent.procDefId)) {
+                ActionUtils.warning('请选择流程!!')
+                return
+            }
+            this.conditionDialogVisible = true
+        },
+
+        getImage(){
+            let sql = `select * from t_dlpz order by create_time_ desc LIMIT 1`
+            curdPost('sql', sql).then(res => {
+                if(res.state == 200){
+                    let datas = res.variables.data
+                    let image = JSON.parse(datas[0].tu_pian_)
+                    let id = image[0].id
+                    this.getUrl(id)
+                }
+            })
+        },
+        getUrl(id){
+            let sql1 = `select nei_rong_ from t_ipcc where id_ = '1'`
+            let sql2 = `select FILE_PATH_ from ibps_file_attachment where ID_ = '${id}'`
+            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1,res2]) => {
+                if(res1.state == 200 && res2.state == 200){
+                    let datas1 = res1.variables.data
+                    let datas2 = res2.variables.data
+                    let ip = datas1[0].nei_rong_
+                    let image = datas2[0].FILE_PATH_
+                    this.url = ip + '/' + image
+                    this.srcList[0] = this.url
+                }
+            })
         }
-        this.rowLoading = false
-      })
-    },
-    openConditionDialog() {
-      if (this.$utils.isEmpty(this.bpmAgent.procDefId)) {
-        ActionUtils.warning('请选择流程!!')
-        return
-      }
-      this.conditionDialogVisible = true
     }
-  }
-
 }
 </script>
 
 <style lang="scss">
-.bpmn-agent-dialog{
-  .el-dialog__body{
-    height:  calc(70vh - 110px) !important;
-  }
-  .dialog-right{
-    float: right;
-    div{
-      display: inline-block;
+.bpmn-agent-dialog {
+    .el-dialog__body {
+        height: calc(70vh - 110px) !important;
     }
-  }
+    .dialog-right {
+        float: right;
+        div {
+            display: inline-block;
+        }
+    }
+}
+</style>
+
+<style scoped>
+.imageListClass{
+    display: flex;
+    justify-content: center;
 }
 </style>

+ 2 - 2
src/views/platform/bpmn/bpmInstHis/record/CMA.vue

@@ -9,9 +9,9 @@
         data () {
             return {
                 info: {
-                    title: 'CNAS/CMA检测档案',
+                    title: 'CMA检测档案',
                     reportPath: '43罗湖/LHXBJY 检测报告',
-                    type: 'cnas/CMA'
+                    type: 'CMA'
                 }
             }
         }

+ 1 - 1
src/views/platform/bpmn/bpmInstHis/record/CNAS.vue

@@ -11,7 +11,7 @@
                 info: {
                     title: 'CNAS检测档案',
                     reportPath: '43罗湖/LHXBJY 检测报告',
-                    type: 'cnas'
+                    type: 'CNAS'
                 }
             }
         }

+ 1 - 1
src/views/platform/bpmn/bpmInstHis/record/FEI.vue

@@ -9,7 +9,7 @@
         data () {
             return {
                 info: {
-                    title: '非CNAS/CMA检测档案',
+                    title: '非CNASCMA检测档案',
                     reportPath: '43罗湖/LHXBJY 检测报告',
                     type: '非'
                 }

+ 85 - 37
src/views/platform/bpmn/bpmInstHis/record/component/testingRecord.vue

@@ -5,12 +5,23 @@
             <template v-for="(item, index) in searchList">
                 <span class="label">{{item.label}}</span>
                 <el-input
+                    v-if="item.value !== 'sampleTime'"
                     v-model="searchParam[item.value]"
                     class="input"
                     placeholder="请输入内容"
                     clearable
                     @keyup.enter.native="search"
                 ></el-input>
+                <el-date-picker
+                    v-else
+                    v-model="searchParam[item.value]"
+                    type="daterange"
+                    unlink-panels
+                    range-separator="-"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
+                    style="width: 220px;"
+                ></el-date-picker>
             </template>
             <el-button class="btn" type="primary" @click="search">
                 <i class="ibps-icon-search"></i>查询
@@ -26,31 +37,25 @@
                 header-cell-class-name="table-header"
             >
                 <!-- <el-table-column type="selection" width="55"></el-table-column> -->
-                <!-- <el-table-column prop="year" label="年份" width="80">
-                    <template slot-scope="scope">{{ scope.row.jian_ce_kai_shi_s | getYear }}</template>
-                </el-table-column> -->
                 <el-table-column prop="he_tong_id_" label="合同编号" width="100">
                     <template slot-scope="scope">{{ scope.row.he_tong_id_ | getID(contractList) }}</template>
                 </el-table-column>
-                <el-table-column prop="bao_gao_bian_hao_" label="报告编号" width="150"></el-table-column>
-                <el-table-column prop="jian_ce_kai_shi_s" label="检测时间" width="100">
-                    <template slot-scope="scope">{{ scope.row.jian_ce_kai_shi_s.slice(0, 10) }}</template>
-                </el-table-column>
-                <el-table-column prop="wei_tuo_id_" label="检测委托单号" width="150">
+                <el-table-column prop="wei_tuo_id_" label="委托单号" width="110">
                     <template slot-scope="scope">{{ scope.row.wei_tuo_id_ | getID(trustList) }}</template>
                 </el-table-column>
-                <el-table-column prop="wei_tuo_fang_" label="委托单位"></el-table-column>
-                <el-table-column prop="wan_cheng_shi_jia" label="委托日期" width="100"></el-table-column>
-                <el-table-column prop="yang_pin_bian_hao" label="样品编号" width="150"></el-table-column>
+                <el-table-column prop="bao_gao_bian_hao_" label="报告编号" width="110"></el-table-column>
+                <!-- <el-table-column prop="wei_tuo_fang_" label="委托单位"></el-table-column> -->
+                <!-- <el-table-column prop="wan_cheng_shi_jia" label="委托日期" width="100"></el-table-column> -->
+                <el-table-column prop="yang_pin_bian_hao" label="样品编号" width="110"></el-table-column>
                 <el-table-column prop="yang_pin_ming_che" label="样品名称" width="150"></el-table-column>
-                <!-- <el-table-column prop="lian_xi_ren_" label="联系人"> </el-table-column>
-                <el-table-column prop="lian_xi_dian_hua_" label="联系电话"></el-table-column>
-                <el-table-column prop="bao_gao_lei_bie_" label="类别">
-                    <template slot-scope="scope">
-                        {{ scope.row.bao_gao_lei_bie_.toUpperCase() }}
-                    </template>
-                </el-table-column> -->
-                <el-table-column label="操作" align="left">
+                <el-table-column prop="song_jian_" label="送检单位" width="150"></el-table-column>
+                <el-table-column prop="song_jian_shi_jia" label="送检日期" width="100"></el-table-column>
+                <el-table-column label="检测时间" width="100">
+                    <template slot-scope="scope">{{ getTestTime(scope.row) }}</template>
+                </el-table-column>
+                <el-table-column prop="gai_zhang_jian_pd" label="检测项目"></el-table-column>
+
+                <el-table-column label="操作" align="left" width="100">
                     <template slot-scope="scope">
                         <el-popover placement="left" width="200" trigger="click">
                             <div slot="reference" class="more">
@@ -77,7 +82,7 @@
                                 </div>
                                 <div v-else-if="item.key === 'file'">
                                     <el-popover placement="left" width="300" trigger="click">
-                                        <div class="operate-item" slot="reference" @click="getFile(scope.row[item.field])">
+                                        <div class="operate-item" slot="reference" @click="getFile(scope.row, item.field)">
                                             <i class="el-icon-s-order"></i> {{item.name}}
                                         </div>
                                         <div class="three-item">
@@ -156,6 +161,14 @@
         {
             label: '样品名称',
             value: 'sampleName'
+        },
+        {
+            label: '检测项目',
+            value: 'projectName'
+        },
+        {
+            label: '送检日期',
+            value: 'sampleTime'
         }
     ]
     let reportList = [
@@ -187,7 +200,7 @@
             name: '附件',
             key: 'file',
             path: '',
-            field: 'suo_you_yuan_shi_',
+            field: 'suo_you_yuan_shi_,fu_jian_yi_',
             hasItem: true
         },
         {
@@ -237,7 +250,9 @@
                 searchParam: {
                     report: '',
                     sampleId: '',
-                    sampleName: ''
+                    sampleName: '',
+                    projectName: '',
+                    sampleTime: ''
                 },
                 tableData: [],
                 testingList: [],
@@ -257,9 +272,9 @@
         created () {
             this.globalSql = `select * from t_lhjcbgb where zhuang_tai_ in ('已完成', '待发放') and bao_gao_lei_bie_ = '${this.info.type}'`
             // this.globalSql = `select * from t_lhjcbgb where bao_gao_lei_bie_ = '${this.info.type}'`
-            let sql = `${this.globalSql} order by create_time_ desc limit 0,20`
+            const sql = `${this.globalSql} order by create_time_ desc limit 0,20`
             this.loadData(sql)
-            let sumsql = `select count(*) as total  from t_lhjcbgb where zhuang_tai_ in ('已完成', '待发放') and bao_gao_lei_bie_ = '${this.info.type}'`
+            const sumsql = `select count(*) as total  from t_lhjcbgb where zhuang_tai_ in ('已完成', '待发放') and bao_gao_lei_bie_ = '${this.info.type}'`
             curdPost('sql', sumsql).then((response) => {
                 this.total = response.variables.data[0].total
             })
@@ -287,8 +302,8 @@
                         ids.trust.push(item.wei_tuo_id_)
                     })
                     // 获取合同及委托单数据用于转换ID
-                    let sql1 = `select id_, he_tong_bian_hao_ as name_ from t_bjd where find_in_set(id_, '${ids.contract.join(',')}')`
-                    let sql2 = `select id_, wei_tuo_bian_hao_ as name_ from t_lhwtsqb where find_in_set(id_, '${ids.trust.join(',')}')`
+                    const sql1 = `select id_, he_tong_bian_hao_ as name_ from t_bjd where find_in_set(id_, '${ids.contract.join(',')}')`
+                    const sql2 = `select id_, wei_tuo_bian_hao_ as name_ from t_lhwtsqb where find_in_set(id_, '${ids.trust.join(',')}')`
                     // console.log(sql1, sql2)
                     curdPost('sql', sql1).then(res1 => {
                         this.contractList = res1.variables && res1.variables.data
@@ -298,20 +313,40 @@
                     })
                 })
             },
+            getTestTime ({jian_ce_kai_shi_s, jian_ce_jie_shu_s}) {
+                const start = jian_ce_kai_shi_s ? jian_ce_kai_shi_s.slice(0, 10) : ''
+                const end = jian_ce_jie_shu_s ? jian_ce_jie_shu_s.slice(0, 10) : ''
+                if (!start && !end) {
+                    return ''
+                }
+                if (!end || start === end) {
+                    return start
+                }
+                return `${start}至${end}`
+            },
             // 获取检测项目数据
             getTesting (row) {
-                const { wei_tuo_id_, yang_pin_bian_hao } = row
+                const { wei_tuo_id_, yang_pin_bian_hao, xiu_gai_bao_gao_b } = row
                 this.testingList = []
-                let sql = `select b.id_ as id, a.defkey_ as number, a.jian_ce_xiang_mu_ as projectName from t_mjjcnlfw a, t_lhjczb b where a.id_ = b.jian_ce_xiang_mu_ and b.wei_tuo_id_ = '${wei_tuo_id_}' and b.yang_pin_bian_hao = '${yang_pin_bian_hao}' and jian_ce_lei_xing_ = '${this.info.type}'`
+                const sql = `select b.id_ as id, a.defkey_ as number, a.jian_ce_xiang_mu_ as projectName from t_mjjcnlfw a, t_lhjczb b where a.id_ = b.jian_ce_xiang_mu_ and b.wei_tuo_id_ = '${wei_tuo_id_}' and b.yang_pin_bian_hao = '${yang_pin_bian_hao}' and find_in_set(b.jian_ce_xiang_mu_, '${xiu_gai_bao_gao_b}')`
                 curdPost('sql', sql).then(res => {
                     this.testingList = res.variables && res.variables.data
                     // console.log(this.testingList)
                 })
             },
-            // 获取附件信息,报告表【bao_gao_pdf_, suo_you_yuan_shi_】字段
-            getFile (key) {
+            // 获取附件信息,报告表【bao_gao_pdf_, suo_you_yuan_shi_, fu_jian_yi_】字段
+            getFile (row, key) {
+                let files = ''
+                if (key.includes(',')) {
+                    // 多字段
+                    let a = row.suo_you_yuan_shi_ ? row.suo_you_yuan_shi_.split(',') : []
+                    let b = row.fu_jian_yi_ ? row.fu_jian_yi_.split(',') : []
+                    files = a.concat(b).join(',')
+                } else {
+                    files = row[key]
+                }
                 this.fileList = []
-                let sql = `select id_ as id, file_name_ as fileName, ext_ as ext from ibps_file_attachment where find_in_set(id_, '${key}')`
+                const sql = `select id_ as id, file_name_ as fileName, ext_ as ext from ibps_file_attachment where find_in_set(id_, '${files}')`
                 curdPost('sql', sql).then(res => {
                     this.fileList = res.variables && res.variables.data
                 })
@@ -319,13 +354,26 @@
             consult (data) {
                 this.alertReport(testingPath[data.number], data.id)
             },
+            timeFormat (time) {
+                return new Date(time.getTime() + 28800000).toJSON().slice(0, 10)
+            },
             // 组装查询SQL
             search () {
-                const { report, sampleId, sampleName } = this.searchParam
+                const { report, sampleId, sampleName, projectName, sampleTime } = this.searchParam
+                const start = sampleTime && sampleTime.length ? this.timeFormat(sampleTime[0]) : ''
+                const end = sampleTime && sampleTime.length ? this.timeFormat(sampleTime[1]) : ''
+                var t = ''
+                if (start === end) {
+                    t = `like '%${start}%'`
+                } else {
+                    t = `between '${start}' and '${end}'`
+                }
                 const paramsList = {
                     report: ` and bao_gao_bian_hao_ like '%${report}%'`,
                     sampleId: ` and yang_pin_bian_hao like '%${sampleId}%'`,
-                    sampleName: ` and yang_pin_ming_che like '%${sampleName}%'`
+                    sampleName: ` and yang_pin_ming_che like '%${sampleName}%'`,
+                    projectName: ` and gai_zhang_jian_pd like '%${projectName}%'`,
+                    sampleTime: ` and song_jian_shi_jia ${t}`
                 }
                 let params = ''
                 Object.keys(this.searchParam).forEach(item => {
@@ -333,17 +381,17 @@
                         params += paramsList[item]
                     }
                 })
-                let sql = `${this.globalSql}${params} order by create_time_ desc limit 0,20`
+                const sql = `${this.globalSql}${params} order by create_time_ desc limit 0,20`
                 // console.log(sql)
                 this.loadData(sql)
             },
             handleSizeChange (value) {
                 this.currentPage = 1
-                let sql = `${this.globalSql} order by create_time_ desc limit 0,${value}`
+                const sql = `${this.globalSql} order by create_time_ desc limit 0,${value}`
                 this.loadData(sql)
             },
             handleCurrentChange (value) {
-                let sql = `${this.globalSql} order by create_time_ desc limit ${value},20`
+                const sql = `${this.globalSql} order by create_time_ desc limit ${value},20`
                 this.loadData(sql)
             },
             alertReport (path, id) {
@@ -373,7 +421,7 @@
             },
             openWindow () {
                 let routeData = this.$router.resolve({
-                    path: "/fileView",
+                    path: '/fileView',
                     query: this.fileOption
                 })
                 window.open(routeData.href);

+ 2 - 2
src/views/system/jbdHome/board/checkBoard.vue

@@ -61,7 +61,7 @@
                     tableData: {
                         header: [
                             '检测项目',
-                            '检测类型',
+                            '送检时间',
                             '完成时间',
                             // '状态',
                             '检测员'
@@ -243,7 +243,7 @@
                 // 获取检测数据
                 // const sql1 = `select tm.jian_ce_xiang_mu_, tm.jian_ce_lei_bie_, IFNULL(rw.qi_wang_wan_cheng, '') as qi_wang_wan_cheng, rw.zhuang_tai_, ipe.NAME_ from t_rwfpb rw, ibps_party_employee ipe, t_mjjcnlfw tm where rw.jian_ce_yuan_ = ipe.ID_ and rw.jian_ce_xiang_mu_ = tm.id_ and rw.create_time_ like '${this.month}%'`
                 // const sql1 = `select tm.jian_ce_xiang_mu_, tm.jian_ce_lei_bie_, IFNULL(rwz.create_time_, '') as qi_wang_wan_cheng, rw.zhuang_tai_, ipe.NAME_ from t_lhrwfpb rw, ibps_party_employee ipe, t_mjjcnlfw tm, t_mjrwfpzb rwz where rwz.jian_ce_yuan_ = ipe.ID_ and rwz.jian_ce_xiang_mu_ = tm.id_ and rw.id_ = rwz.wai_jian_ and rw.create_time_ like '${this.month}%'`
-                const sql1 = `select tm.jian_ce_xiang_mu_, tm.jian_ce_lei_bie_, IFNULL(jc.fu_he_ri_qi_, '') as fu_he_ri_qi_, ipe.NAME_ from ibps_party_employee ipe, t_mjjcnlfw tm, t_lhjczb jc where jc.jian_ce_yuan_ = ipe.ID_ and jc.jian_ce_xiang_mu_ = tm.id_ and jc.zhuang_tai_ = '已完成' and jc.create_time_ like '${this.month}%' order by jc.create_time_ desc`
+                const sql1 = `select tm.jian_ce_xiang_mu_, IFNULL(jc.wan_cheng_shi_jia, '') as wan_cheng_shi_jia, IFNULL(jc.fu_he_ri_qi_, '') as fu_he_ri_qi_, ipe.NAME_ from ibps_party_employee ipe, t_mjjcnlfw tm, t_lhjczb jc where jc.jian_ce_yuan_ = ipe.ID_ and jc.jian_ce_xiang_mu_ = tm.id_ and jc.zhuang_tai_ = '已完成' and jc.create_time_ like '${this.month}%' order by jc.create_time_ desc`
                 // 获取检测受理类型数据
                 let sqlStr = ''
                 acceptList.forEach((item, index) => {

+ 6 - 3
src/views/system/jbdHome/board/component/getPieView.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="pieView">
-    <div style="height: 20%;line-height: 30px;text-align: left;padding-left: 10px;color: white;">{{info.config.title||""}}</div>   
-    <div style="width:100%;height:80%;display: inline-block; overflow: hidden;">
+    <div style="height: 14%;line-height: 30px;text-align: left;padding-left: 10px;color: white;">{{info.config.title||""}}</div>   
+    <div style="width:100%;height:86%;display: inline-block; overflow: hidden;">
       <div :id="info.config.idSelector" style="width:100%;height:95%;overflow: hidden;"> </div>
     </div>
   </div>
@@ -47,6 +47,7 @@ export default {
             fontWeight: '600'
         },
         },
+        
         color:this.info.color,
         tooltip: {
           trigger: 'item',
@@ -55,10 +56,12 @@ export default {
         label: {
           formatter: '{b}\n({d}%)'
         },
+        
         legend: {
           show: true,
           z: 3,
-          orient: 'vertical',
+          
+          // orient: 'vertical', 标题横竖//
           left: 'right',
           textStyle:{
             color: '#fff'

+ 10 - 4
src/views/system/jbdScan/goods/liuyangData.vue

@@ -2,8 +2,8 @@
   <div class="sample-content">
     <!-- 表格組件 -->
     <div class="selectPo" @click="positionBtn">
-      <el-input type="text" v-model="placeValue" clearable></el-input>
-      <input type="text" v-model="value" style="opacity: 0; position: fixed" />
+      <el-input type="text" v-model="placeValue" clearable style="color: red; !important"></el-input>
+      <input type="text" v-model="value" style="opacity: 0; position: fixed;color: red; !important" />
     </div>
     <div class="viewArea" v-if="viewShow">
       <h2 class="title">样品间样品存放位置可视图</h2>
@@ -148,7 +148,7 @@ export default {
   mixins: [FixHeight],
   data() {
     return {
-      placeValue: "选择位置",
+      placeValue: "点击选择位置",
       viewShow: false,
       leixingcare: true,
 
@@ -498,7 +498,10 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped>
+<style lang="less" scoped>
+/deep/ .el-input__inner{
+    color: none;
+}
 p {
   padding: 0;
   margin: 0;
@@ -527,6 +530,9 @@ p {
   .selectPo {
     cursor: pointer;
     z-index: 9;
+    /deep/ .el-input__inner{
+        color: red;    
+    }
   }
   .top-content {
     width: 100%;

+ 151 - 50
src/views/system/jbdScan/goods/manualConfirmation.vue

@@ -93,11 +93,36 @@
                             </el-form-item>
                           </el-col>
                         </el-row>
-                          
-                        <el-row>
+                        <!--每种类型对应的留样数量和留样存放位置-->
+                        <el-row >
+                            <el-col :span="6">
+                                <el-form-item label="样品存放位置(一)" required  >
+                                    <template slot-scope="scope">
+                                        <weizhiData  v-model="item.shou_yang_wei_zhi_yi"/>
+                                    </template>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(一)" required class="zzj">
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_yi"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(一)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_yi"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>
+
+
+                        <el-row  v-if="item.flag2">
                           <el-col :span="6">
-                            <el-form-item label="样品类型(二)">
-                              <el-input v-model="item.yang_pin_lei_er_ || '/'" readonly="true"></el-input>
+                            <el-form-item label="样品类型(二)" >
+                              <el-input v-model="item.yang_pin_lei_er_ || '/'" readonly="true" ></el-input>
                             </el-form-item>
                           </el-col>
                           <el-col :span="6">
@@ -106,7 +131,7 @@
                             </el-form-item>
                           </el-col>
                           <el-col :span="6">
-                            <el-form-item label="样品数量(二)">
+                            <el-form-item label="样品数量(二)" >
                               <el-input v-model="item.shu_liang_er_ || '/'" readonly="true"></el-input>
                             </el-form-item>
                           </el-col>
@@ -116,10 +141,34 @@
                             </el-form-item>
                           </el-col>
                         </el-row>
+                        <!--每种类型对应的留样数量和留样存放位置-->
+                        <el-row v-if="item.flag2">
+                            <el-col :span="6">
+                                <el-form-item label="样品存放位置(二)" required>
+                                    <template slot-scope="scope">
+                                        <weizhiData  v-model="item.shou_yang_wei_zhi_er"/>
+                                    </template>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(二)" required class="zzj">
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_er"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(二)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_er"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>
                           
-                        <el-row>
+                        <el-row v-if="item.flag3">
                           <el-col :span="6">
-                            <el-form-item label="样品类型(三)">
+                            <el-form-item label="样品类型(三)" >
                               <el-input v-model="item.yang_pin_lei_san_ || '/'" readonly="true"></el-input>
                             </el-form-item>
                           </el-col>
@@ -138,9 +187,33 @@
                               <el-input v-model="item.yang_pin_gui_ge_s || '/'" readonly="true"></el-input>
                             </el-form-item>
                           </el-col>
+                        </el-row>
+                        <!--每种类型对应的留样数量和留样存放位置-->
+                        <el-row  v-if="item.flag3">
+                            <el-col :span="6">
+                                <el-form-item label="样品存放位置(三)" required>
+                                    <template slot-scope="scope">
+                                        <weizhiData  v-model="item.shou_yang_wei_zhi_san"/>
+                                    </template>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(三)" required class="zzj">
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_san"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(三)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_san"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
                         </el-row>   
 
-                        <el-row>
+                        <el-row  v-if="item.flag4">
                           <el-col :span="6">
                             <el-form-item label="样品类型(四)">
                               <el-input v-model="item.yang_pin_lei_si_ || '/'" readonly="true" ></el-input>
@@ -162,53 +235,65 @@
                             </el-form-item>
                           </el-col>
                         </el-row> 
-                        
-                        <el-row>
-                          <el-col :span="6">
-                            <el-form-item label="是否留样">
-                              <template slot-scope="scope">
-                                 <el-select v-model="item.shi_fou_liu_yang_" placeholder="请选择">
-                                   <el-option
-                                     v-for="item in ifLY"
-                                     :key="item.value"
-                                     :label="item.label"
-                                     :value="item.value">
-                                   </el-option>
-                                 </el-select>
-                              </template>
+                        <!--每种类型对应的留样数量和留样存放位置-->
+                        <el-row  v-if="item.flag4">
+                            <el-col :span="6">
+                                <el-form-item label="样品存放位置(四)" required>
+                                    <template slot-scope="scope">
+                                        <weizhiData  v-model="item.shou_yang_wei_zhi_si"/>
+                                    </template>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(四)" required class="zzj">
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_si"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(四)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_si"/>
+                               </template>
                             </el-form-item>
                           </el-col>
-                          <el-col :span="6">
+                        </el-row>   
+                        
+                        <el-row>
+                          
+                          <!-- <el-col :span="6">
                             <el-form-item label="样品存放位置" required>
                               <template slot-scope="scope">
                                 <weizhiData  v-model="item.shou_yang_wei_zhi"/>
                                </template>
                             </el-form-item>
-                          </el-col>
-                          <el-col :span="6">
+                          </el-col> -->
+                          <!-- <el-col :span="6">
                             <el-form-item label="留样存放位置" required>
                               <template slot-scope="scope">
                                 <liuyangData v-model="item.liu_yang_wei_zhi_"/>
                                </template>
                             </el-form-item>
-                          </el-col>
-                          <el-col :span="6">
-                            <el-form-item label="验收结果">
-                              <template slot-scope="scope">
-                                <el-select v-model="item.yan_shou_jie_guo_" placeholder="请选择">
-                                  <el-option
-                                    v-for="item in checkOptions"
-                                    :key="item.value"
-                                    :label="item.label"
-                                    :value="item.value">
-                                  </el-option>
-                                </el-select>
-                             </template>
-                            </el-form-item>
-                          </el-col>
+                          </el-col> -->
+                         
                         </el-row>  
                         
                         <el-row>
+                            <el-col :span="6">
+                                <el-form-item label="是否留样">
+                                <template slot-scope="scope">
+                                    <el-select v-model="item.shi_fou_liu_yang_" placeholder="请选择">
+                                    <el-option
+                                        v-for="item in ifLY"
+                                        :key="item.value"
+                                        :label="item.label"
+                                        :value="item.value">
+                                    </el-option>
+                                    </el-select>
+                                </template>
+                                </el-form-item>
+                            </el-col>
                           <el-col :span="6">
                             <el-form-item label="留样日期">
                               <template slot-scope="scope">
@@ -225,22 +310,16 @@
                             </template>
                             </el-form-item>
                           </el-col>
-                          <el-col :span="6">
+                          <!-- <el-col :span="6">
                             <el-form-item label="留样数量" required>
                              <template slot-scope="scope">
                               <el-input 
                                 v-model="item.liu_yang_shu_lian"
                                 >
                               </el-input>
-                                <!-- <el-input-number
-                                 v-model="item.liu_yang_shu_lian"
-                                  controls-position="right"
-                                  @change="handleChange"
-                                  :min="1" :max="9999">
-                                 </el-input-number> -->
                              </template>
                             </el-form-item>
-                          </el-col>
+                          </el-col> -->
                           <el-col :span="6">
                             <el-form-item label="留样期限至">
                               <template slot-scope="scope">
@@ -308,6 +387,20 @@
                             <el-input v-model="item.chu_ju_bao_gao_ya" readonly="true" class="jiaji"></el-input>
                           </el-form-item>
                          </el-col>
+                         <el-col :span="6">
+                            <el-form-item label="验收结果">
+                              <template slot-scope="scope">
+                                <el-select v-model="item.yan_shou_jie_guo_" placeholder="请选择">
+                                  <el-option
+                                    v-for="item in checkOptions"
+                                    :key="item.value"
+                                    :label="item.label"
+                                    :value="item.value">
+                                  </el-option>
+                                </el-select>
+                             </template>
+                            </el-form-item>
+                          </el-col>
                           <!-- <el-col :span="6">
                             <el-form-item label="分装留样数量">
                               <template slot-scope="scope">
@@ -529,7 +622,7 @@ import * as dayjs from 'dayjs'
       // mjwtsqbAllResult:[],
       pageCount:1,
       item:'',
-      flag: true
+      flag: true,
     }
   },
   methods:{
@@ -553,6 +646,10 @@ import * as dayjs from 'dayjs'
 
 
 <style lang="less" scoped>
+
+/deep/ .el-form-item__label,/deep/ .el-input__inner{
+    color: none;
+}
  .sample-scan .popContainer{
       position: fixed;
       top: 0;
@@ -572,13 +669,17 @@ import * as dayjs from 'dayjs'
       line-height: 40px;
       font-weight: bold;
     }
+    /**必须设置.el-form-item__label为none */
+    /deep/.zzj .el-form-item__content .el-input__inner{
+        color: #e60c14; 
+    }
     /deep/.el-form-item__content{
     display: inline-block;
   }
   /deep/.el-form-item__label{
     padding: 0;
     margin-right: 5px;
-    width: 100px;
+    width: 120px;
   }
    /deep/.el-input__inner{
    border-top: none !important;

+ 130 - 48
src/views/system/jbdScan/goods/sampleConfirmation.vue

@@ -92,8 +92,32 @@
                             </el-form-item>
                           </el-col>
                         </el-row>
-                          
+                        <!--每种类型对应的留样数量和留样存放位置-->
                         <el-row>
+                            <el-col :span="6">
+                                <el-form-item label="样品存放位置(一)" required>
+                                <template slot-scope="scope">
+                                    <weizhiData  v-model="item.shou_yang_wei_zhi_yi"/>
+                                </template>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(一)" required class="zzj">
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_yi"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(一)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_yi"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>
+                          
+                        <el-row v-if="item.flag2">
                           <el-col :span="6">
                             <el-form-item label="样品类型(二)">
                               <el-input v-model="item.yang_pin_lei_er_ || '/'" readonly="true"></el-input>
@@ -115,8 +139,32 @@
                             </el-form-item>
                           </el-col>
                         </el-row>
-                          
-                        <el-row>
+                        <!--每种类型对应的留样数量和留样存放位置-->
+                        <el-row v-if="item.flag2">
+                             <el-col :span="6">
+                                <el-form-item label="样品存放位置(二)" required>
+                                    <template slot-scope="scope">
+                                        <weizhiData  v-model="item.shou_yang_wei_zhi_er"/>
+                                    </template>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(二)" required class="zzj">
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_er"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(二)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_er"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>
+
+                        <el-row v-if="item.flag3">
                           <el-col :span="6">
                             <el-form-item label="样品类型(三)">
                               <el-input v-model="item.yang_pin_lei_san_ || '/'" readonly="true"></el-input>
@@ -138,8 +186,33 @@
                             </el-form-item>
                           </el-col>
                         </el-row>   
+                         <!--每种类型对应的留样数量和留样存放位置-->
+                         <el-row  v-if="item.flag3">
+                            <el-col :span="6">
+                                <el-form-item label="样品存放位置(三)" required>
+                                    <template slot-scope="scope">
+                                        <weizhiData  v-model="item.shou_yang_wei_zhi_san"/>
+                                    </template>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(三)" required class="zzj">
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_san"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(三)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_san"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>   
 
-                        <el-row>
+
+                        <el-row v-if="item.flag4">
                           <el-col :span="6">
                             <el-form-item label="样品类型(四)">
                               <el-input v-model="item.yang_pin_lei_si_ || '/'" readonly="true" ></el-input>
@@ -161,7 +234,31 @@
                             </el-form-item>
                           </el-col>
                         </el-row> 
-                        
+                        <!--每种类型对应的留样数量和留样存放位置-->
+                        <el-row  v-if="item.flag4">
+                            <el-col :span="6">
+                                <el-form-item label="样品存放位置(四)" required>
+                                    <template slot-scope="scope">
+                                        <weizhiData  v-model="item.shou_yang_wei_zhi_si"/>
+                                    </template>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="6">
+                            <el-form-item label="留样数量(四)" required class="zzj">
+                                <template slot-scope="scope">
+                                    <el-input v-model="item.liu_yang_shu_lian_si"></el-input>
+                                </template>
+                            </el-form-item>
+                          </el-col>
+                          <el-col :span="6">
+                            <el-form-item label="留样存放位置(四)" required>
+                                <template slot-scope="scope">
+                                    <liuyangData v-model="item.liu_yang_wei_zhi_si"/>
+                               </template>
+                            </el-form-item>
+                          </el-col>
+                        </el-row>   
+
                         <el-row>
                           <el-col :span="6">
                             <el-form-item label="是否留样">
@@ -177,37 +274,14 @@
                               </template>
                             </el-form-item>
                           </el-col>
-                          <el-col :span="6">
-                            <el-form-item label="样品存放位置" required>
-                              <template slot-scope="scope">
-                                <weizhiData  v-model="item.shou_yang_wei_zhi"/>
-                               </template>
-                            </el-form-item>
-                          </el-col>
-                          <el-col :span="6">
+                         
+                          <!-- <el-col :span="6">
                             <el-form-item label="留样存放位置" required>
                               <template slot-scope="scope">
                                 <liuyangData v-model="item.liu_yang_wei_zhi_"/>
                                </template>
                             </el-form-item>
-                          </el-col>
-                          <el-col :span="6">
-                            <el-form-item label="验收结果">
-                              <template slot-scope="scope">
-                                <el-select v-model="item.yan_shou_jie_guo_" placeholder="请选择">
-                                  <el-option
-                                    v-for="item in checkOptions"
-                                    :key="item.value"
-                                    :label="item.label"
-                                    :value="item.value">
-                                  </el-option>
-                                </el-select>
-                             </template>
-                            </el-form-item>
-                          </el-col>
-                        </el-row>  
-                        
-                        <el-row>
+                          </el-col> -->
                           <el-col :span="6">
                             <el-form-item label="留样日期">
                               <template slot-scope="scope">
@@ -224,21 +298,6 @@
                             </template>
                             </el-form-item>
                           </el-col>
-                          <el-col :span="6">
-                            <el-form-item label="留样数量"  required>
-                             <template slot-scope="scope">
-                              <el-input 
-                                v-model="item.liu_yang_shu_lian">
-                              </el-input>
-                                <!-- <el-input-number
-                                 v-model="item.liu_yang_shu_lian"
-                                  controls-position="right"
-                                  @change="handleChange"
-                                  :min="1" :max="9999">
-                                 </el-input-number> -->
-                             </template>
-                            </el-form-item>
-                          </el-col>
                           <el-col :span="6">
                             <el-form-item label="留样期限至">
                               <template slot-scope="scope">
@@ -269,7 +328,9 @@
                               </template>
                             </el-form-item>
                           </el-col>
-                        </el-row>
+                          
+                        </el-row>  
+                        
 
                         <el-row>
                           <el-col :span="6">
@@ -306,6 +367,20 @@
                             <el-input v-model="item.chu_ju_bao_gao_ya" readonly="true"></el-input>
                           </el-form-item>
                          </el-col>
+                         <el-col :span="6">
+                            <el-form-item label="验收结果">
+                              <template slot-scope="scope">
+                                <el-select v-model="item.yan_shou_jie_guo_" placeholder="请选择">
+                                  <el-option
+                                    v-for="item in checkOptions"
+                                    :key="item.value"
+                                    :label="item.label"
+                                    :value="item.value">
+                                  </el-option>
+                                </el-select>
+                             </template>
+                            </el-form-item>
+                          </el-col>
                           <!-- <el-col :span="6">
                             <el-form-item label="分装留样数量">
                               <template slot-scope="scope">
@@ -541,6 +616,9 @@ import * as dayjs from 'dayjs'
 
 
 <style lang="less" scoped>
+/deep/ .el-form-item__label,/deep/ .el-input__inner{
+    color: none;
+}
  .sample-scan .popContainer{
       position: fixed;
       top: 0;
@@ -559,6 +637,10 @@ import * as dayjs from 'dayjs'
       font-size: 18px;
       line-height: 40px;
       font-weight: bold;
+    }
+        /**必须设置.el-form-item__label为none */
+    /deep/.zzj .el-form-item__content .el-input__inner{
+        color: #e60c14; 
     }
     /deep/.el-form-item__content{
     display: inline-block;
@@ -566,7 +648,7 @@ import * as dayjs from 'dayjs'
   /deep/.el-form-item__label{
     padding: 0;
     margin-right: 5px;
-    width: 100px;
+    width: 120px;
   }
    /deep/.el-input__inner{
    border-top: none !important;

+ 10 - 4
src/views/system/jbdScan/goods/weizhiData.vue

@@ -2,8 +2,8 @@
   <div class="sample-content">
     <!-- 表格組件 -->
     <div class="selectPo" @click="positionBtn">
-      <el-input type="text" v-model="placeValue" clearable></el-input>
-      <input type="text" v-model="value" style="opacity: 0; position: fixed" />
+      <el-input type="text" v-model="placeValue" clearable style="color: red; !important"></el-input>
+      <input type="text" v-model="value" style="opacity: 0; position: fixed;color: red; !important" />
     </div>
     <div class="viewArea" v-if="viewShow">
       <h2 class="title">样品间样品存放位置可视图</h2>
@@ -148,7 +148,7 @@ export default {
   mixins: [FixHeight],
   data() {
     return {
-      placeValue: "选择位置",
+      placeValue: "点击选择位置",
       viewShow: false,
       leixingcare: true,
 
@@ -498,7 +498,10 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped>
+<style lang="less" scoped>
+/deep/ .el-input__inner{
+    color: none;
+}
 p {
   padding: 0;
   margin: 0;
@@ -527,6 +530,9 @@ p {
   .selectPo {
     cursor: pointer;
     z-index: 9;
+    /deep/ .el-input__inner{
+        color: red;    
+    }
   }
   .top-content {
     width: 100%;

+ 303 - 466
src/views/system/jbdScan/js/manualConfirmationJS.js

@@ -1,6 +1,5 @@
 import repostCurd from '@/business/platform/form/utils/custom/joinCURD.js'
 // import * as dayjs from 'dayjs'
-
 export default {
   props:{
     obj:{
@@ -22,19 +21,27 @@ export default {
       repostCurd('sql',sql).then(response=>{
         if (response.variables.data && response.variables.data.length > 0) {
           let temp = response.variables.data
-          this.listData = []
-          for (let i in temp) {
-            temp[i].jie_yang_shu_lian = temp[i].yang_pin_zong_shu
-            temp[i].jie_yang_zhuang_t = '已确认'
-            temp[i].biao_zhi_uuid_ = this.uuid()
-            temp[i].shi_fou_liu_yang_ = '是'
-            temp[i].yan_shou_jie_guo_ = '完好'
-            temp[i].liu_yang_shu_lian = ' ml/支×1支'
-            temp[i].liu_yang_ri_qi_ = this.dateFormat()
-            // temp[i].liu_yang_qi_xian = dayjs(temp[i].song_jian_shi_jia).add(3,'month').format("YYYY-MM-DD")
-            // temp[i].xiao_hui_ri_qi_ = dayjs(temp[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD")
-            this.listData.push(temp[i])
-          }
+          temp.forEach(item => {
+            item.jie_yang_shu_lian = item.yang_pin_zong_shu
+            item.jie_yang_zhuang_t = '已确认'
+            item.biao_zhi_uuid_1 = this.uuid()
+            item.biao_zhi_uuid_2 = this.uuid()
+            item.biao_zhi_uuid_3 = this.uuid()
+            item.biao_zhi_uuid_4 = this.uuid()
+            item.shi_fou_liu_yang_ = '是'
+            item.yan_shou_jie_guo_ = '完好'
+            item.liu_yang_shu_lian_yi = ' ml/支×1支'
+            item.yang_pin_lei_er_ ? item.liu_yang_shu_lian_er = ' ml/支×1支' : null
+            item.yang_pin_lei_san_ ? item.liu_yang_shu_lian_san = ' ml/支×1支' : null
+            item.yang_pin_lei_si_  ? item.liu_yang_shu_lian_si = ' ml/支×1支' : null
+            item.liu_yang_ri_qi_ = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 10).replace('T', ' ')
+            item.yang_pin_lei_er_ ? this.$set(item,'flag2',true) : this.$set(item,'flag2',false)
+            item.yang_pin_lei_san_ ? this.$set(item,'flag3',true) : this.$set(item,'flag3',false)
+            item.yang_pin_lei_si_  ? this.$set(item,'flag4',true) : this.$set(item,'flag4',false)
+          })
+          this.listData = temp
+        // temp[i].liu_yang_qi_xian = dayjs(temp[i].song_jian_shi_jia).add(3,'month').format("YYYY-MM-DD")
+        // temp[i].xiao_hui_ri_qi_ = dayjs(temp[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD")
         }else{
           this.handleEmptyData();
         }
@@ -42,26 +49,32 @@ export default {
     },
     loadDataBySQL(page) {
       // 扫码扫到新数据,查询 并分页 回填展示
-      let countSQL = `select count(*) as count from t_lhypb where jie_yang_zhuang_t = '待接收' and shi_fou_guo_shen_ = '1'`
-      let str = (page-1)*10
-      // let fysql = `select * from t_lhypb where jie_yang_zhuang_t = '待接收' and shi_fou_guo_shen_ = '1' limit ${str},10`
       let fysql = `select ypb.*,sqb.chu_ju_bao_gao_ya from t_lhypb ypb join t_lhwtsqb sqb on ypb.parent_id_ = sqb.id_  and ypb.jie_yang_zhuang_t = '待接收' and ypb.shi_fou_guo_shen_ = '1'`
-      Promise.all([repostCurd('sql', countSQL), repostCurd('sql', fysql)]).then(([res1, res]) => {
+      Promise.all([repostCurd('sql', fysql)]).then(([res]) => {
         this.listData = []
-        this.pageCount = res1.variables.data[0].count
-        if (res.variables.data && res.variables.data.length > 0) {
-          for (let i in res.variables.data) {
-            res.variables.data[i].jie_yang_shu_lian = res.variables.data[i].yang_pin_zong_shu
-            res.variables.data[i].jie_yang_zhuang_t = '已确认'
-            res.variables.data[i].biao_zhi_uuid_ = this.uuid()
-            res.variables.data[i].shi_fou_liu_yang_ = '是'
-            res.variables.data[i].yan_shou_jie_guo_ = '完好'
-            res.variables.data[i].liu_yang_shu_lian = ' ml/支×1支'
-            res.variables.data[i].liu_yang_ri_qi_ = this.dateFormat()
-            // res.variables.data[i].liu_yang_qi_xian = dayjs(res.variables.data[i].song_jian_shi_jia).add(3,'month').format("YYYY-MM-DD")
-            // res.variables.data[i].xiao_hui_ri_qi_ = dayjs(res.variables.data[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD")
-            this.listData.push(res.variables.data[i])
-          }
+        let temp = res.variables.data
+        if (temp) {
+            temp.forEach(item => {
+                item.jie_yang_shu_lian = item.yang_pin_zong_shu
+                item.jie_yang_zhuang_t = '已确认'
+                item.biao_zhi_uuid_1 = this.uuid()
+                item.biao_zhi_uuid_2 = this.uuid()
+                item.biao_zhi_uuid_3 = this.uuid()
+                item.biao_zhi_uuid_4 = this.uuid()
+                item.shi_fou_liu_yang_ = '是'
+                item.yan_shou_jie_guo_ = '完好'
+                item.liu_yang_shu_lian_yi = ' ml/支×1支'
+                item.yang_pin_lei_er_ ? item.liu_yang_shu_lian_er = ' ml/支×1支' : null
+                item.yang_pin_lei_san_ ? item.liu_yang_shu_lian_san = ' ml/支×1支' : null
+                item.yang_pin_lei_si_  ? item.liu_yang_shu_lian_si = ' ml/支×1支' : null
+                item.liu_yang_ri_qi_ = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 10).replace('T', ' ')
+                item.yang_pin_lei_er_ ? this.$set(item,'flag2',true) : this.$set(item,'flag2',false)
+                item.yang_pin_lei_san_ ? this.$set(item,'flag3',true) : this.$set(item,'flag3',false)
+                item.yang_pin_lei_si_  ? this.$set(item,'flag4',true) : this.$set(item,'flag4',false)
+                
+
+            })
+            this.listData = temp
         }else{
           this.handleEmptyList();
         }
@@ -96,8 +109,6 @@ export default {
     submitData(type) {
       // this指针
       let this_ = this;
-      let changeWeiZhi;     // 此处俩字段作用在下面 选择货位时出现重复位置 而重新更新样品登记表 收样位置|留样位置
-      let changesyWeiZhi;
       // 回传关闭事件。隐藏当前组件。
       let judge = true;
 
@@ -114,36 +125,31 @@ export default {
 
           // 获取样品列表
           let ypInfoList = this_.listData
-          // console.log(ypInfoList, "样品信息")
+        //   console.log(ypInfoList, "样品信息")
 
           let dWhere = []
           let ypbh = []
-          let cfwzIdList = [] // 放置 存放位置的ID
           let ypbhList = [] // 样品编号列表
 
           // 罗湖样品编号列表
           let lhypbhList = []
           let lhypmcList = []
-          // 罗湖委托单列表
-          let lhwtsqbList = []
-          // 罗湖样品表列表
-          let lhypbList = []
           // 罗湖样品表外键
           let lhypbWJ = []
           // 罗湖委托表主键
           let lhwtbID = []
-          let lhwtbOnlyId = []
           // 罗湖委托表展示表ID
           let lhwtzsbID = []
           // 罗湖样品id列表
           let lhypIdList = []
           // 罗湖样品id格式列表
           let lhypIdNewList = []
-          let uuidList = [] // 列表的UUID
-
+          // 样品所选择的位置ID字符串
+          let localStr = ''
+          let locationIds = new Set()
+          let localArr = []
 
           for (let yp in ypInfoList) { //样品数据
-            let cfwzObj = []
             let cfwz = ''
             /*
               校验:
@@ -169,89 +175,31 @@ export default {
               this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 是否留样不能为空!')
               return;
             }
-
-          //  if (ypInfoList[yp].bao_gao_bian_zhi_ == undefined || ypInfoList[yp].bao_gao_bian_zhi_ == '') {
-          //     this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 报告编制员不能为空!')
-          //     return;
-          //   }
-          //   if (ypInfoList[yp].bao_gao_shen_he_y == undefined || ypInfoList[yp].bao_gao_shen_he_y == '') {
-          //     this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 报告审核员不能为空!')
-          //     return;
-          //   }
-
-            cfwzObj.push(ypInfoList[yp].shou_yang_wei_zhi) //取位置信息
-
             if (ypInfoList[yp].shi_fou_liu_yang_ == "是") {
-              if (ypInfoList[yp].liu_yang_wei_zhi_ == null || ypInfoList[yp].liu_yang_wei_zhi_ == '') {
-                this_.$message.error("你要留样的话,存放位置不能为空哦!")
-                return;
-              }
-              // if (ypInfoList[yp].shou_yang_wei_zhi != undefined && ypInfoList[yp].shou_yang_wei_zhi != '') {
-              //   this_.$message.error("你要留样的话,就不要选收样存放位置!")
-              //   return;
-              // }
               if (ypInfoList[yp].liu_yang_ri_qi_ == null || ypInfoList[yp].liu_yang_ri_qi_ == '') {
                 this_.$message.error("留样时必须填写留样日期!")
                 return;
               }
-              if (ypInfoList[yp].liu_yang_shu_lian == null || ypInfoList[yp].liu_yang_shu_lian == '') {
-                this_.$message.error("留样时必须填写留样数量!")
-                return;
-              }
-              // if (ypInfoList[yp].liu_yang_shu_lian > ypInfoList[yp].yang_pin_zong_shu) {
-              //   this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 留样数量不得大于收样数量。')
-              //   return;
-              // }
-            //   if (ypInfoList[yp].liu_yang_qi_xian == null || ypInfoList[yp].liu_yang_qi_xian == '') {
-            //     this_.$message.error("留样时必须填写留样期限!")
-            //     return;
-            //   }
-            //   if (ypInfoList[yp].xiao_hui_ri_qi_ == null || ypInfoList[yp].xiao_hui_ri_qi_ == '') {
-            //     this_.$message.error("留样时必须填写销毁日期!")
-            //     return;
-            //   }
-                // cfwz = ypInfoList[yp].liu_yang_wei_zhi_
-                cfwzObj.push(ypInfoList[yp].liu_yang_wei_zhi_)
-
             } 
-            // else {
-            //   if (ypInfoList[yp].shou_yang_wei_zhi == null || ypInfoList[yp].shou_yang_wei_zhi == '') {
-            //     this_.$message.error("你正常收样的话,样品存放位置不能为空哦!")
-            //     return;
-            //   }
-            //   if (ypInfoList[yp].liu_yang_wei_zhi_ != undefined && ypInfoList[yp].liu_yang_wei_zhi_ != '') {
-            //     this_.$message.error("你正常收样的话,就不要选择留样存放位置!")
-            //     return;
-            //   }
-            //     cfwz = ypInfoList[yp].shou_yang_wei_zhi //取位置信息
-            // }
-
-            // uuidList.push(ypInfoList[yp].biao_zhi_uuid_)
-            // ypIdList.push('{"id_":"' + ypInfoList[yp].id_ + '"}')
-            // ypWeiZhi.push(ypInfoList[yp].shou_yang_wei_zhi) // 收样存放位置
-            // ypLiuYangWeiZhi.push(ypInfoList[yp].liu_yang_wei_zhi_) // 留样存放位置
-            // saoMaNumList.push(ypInfoList[yp].jie_yang_shu_lian) // 扫码数量
-            // jieYangQueRenZTList.push(ypInfoList[yp].jie_yang_zhuang_t) // 接收确认状态
             ypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}') // 样品编号列表
-
-
             // 罗湖
-            // lhypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}')
-            // lhypbWJ.push('{"id_":"' + ypInfoList[yp].parent_id_ + '"}')
             dWhere.push('{"id_":"' + cfwz + '"}')
-            cfwzIdList.push(cfwzObj)
             lhypbhList.push( ypInfoList[yp].yang_pin_bian_hao )
             lhypbWJ.push( ypInfoList[yp].parent_id_ )
             lhypIdList.push( ypInfoList[yp].id_ )
             lhypIdNewList.push('{"id_":"' + ypInfoList[yp].id_ + '"}')
-            uuidList.push(ypInfoList[yp].biao_zhi_uuid_)
             ypbh.push(ypInfoList[yp].yang_pin_bian_hao)
             lhypmcList.push(ypInfoList[yp].yang_pin_ming_che)
+
+            localArr.push(
+                ypInfoList[yp].shou_yang_wei_zhi_yi,ypInfoList[yp].liu_yang_wei_zhi_yi,
+                ypInfoList[yp].shou_yang_wei_zhi_er,ypInfoList[yp].liu_yang_wei_zhi_er,
+                ypInfoList[yp].shou_yang_wei_zhi_san,ypInfoList[yp].liu_yang_wei_zhi_san,
+                ypInfoList[yp].shou_yang_wei_zhi_si,ypInfoList[yp].liu_yang_wei_zhi_si
+                )
           }
+          localStr = localArr.filter(i => i).join(',')
 
-        /*
-          封装好样品登记表对象,add 样品登记表
-        */
          let value = ''
          let lhypIdStr = ''
          for(let i =0;i<lhypbWJ.length; i++){
@@ -265,359 +213,200 @@ export default {
          lhypIdStr = lhypIdStr.substring(0,lhypIdStr.length-1)
          lhypIdStr = lhypIdStr.replace(/,/g,"','")
 
-         // console.log('lhypIdStr :',lhypIdStr)
-         let wtdAndYpb = []
-        // a.bao_gao_bian_zhi_,a.bao_gao_fu_he_yua,
+         let currentTime = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 16).replace('T', ' ')
          let allSQL = `select a.id_ as wtID,a.chu_ju_bao_gao_ya,a.zhan_shi_biao_id_,a.wei_tuo_lei_xing_,a.he_tong_id_,a.bao_gao_lei_xing_,a.wei_tuo_bian_hao_, a.wei_tuo_dan_wei_ as wtdh, a.wei_tuo_fang_lian, a.wei_tuo_lian,a.bao_gao_bian_zhi_,a.bao_gao_fu_he_yua,b.* from t_lhwtsqb a inner join t_lhypb b on a.id_ = b.parent_id_ where b.parent_id_ in ('${value}')and b.id_ in ('${lhypIdStr}')`
-          // console.log(allSQL)
-          repostCurd('sql', allSQL).then(res1 => {
-              /* 封装样品登记表对象  */
-              let ypdjb = []
-              let res = res1.variables.data
-              wtdAndYpb = res
-
-              for(let i = 0; i<res.length; i++){
-              lhwtbID.push('{"id_":"' + res[i].wtID + '"}')
-              lhwtbOnlyId.push(res[i].wtID)
-              lhwtzsbID.push('{"shen_qing_id_":"' + res[i].zhan_shi_biao_id_ + '"}')
-                  let count = 0;
-                  if(res[i].yang_pin_lei_xing != ''  && res[i].yang_pin_lei_xing != undefined){
-                    count = 1;
-                    if(res[i].yang_pin_lei_er_ != ''  && res[i].yang_pin_lei_er_ != undefined){
-                       count = 2;
-                       if(res[i].yang_pin_lei_san_ != ''  && res[i].yang_pin_lei_san_ != undefined){
-                         count = 3;
-                         if(res[i].yang_pin_lei_si_ != ''  && res[i].yang_pin_lei_si_ != undefined){
-                           count = 4;
-                         }
-                       }
-                    }
-                  }
-                  for(let x = 0; x<count;x++){
-                    let obj = {}
-                    obj["wei_tuo_dan_hao_"] = res[i].wei_tuo_bian_hao_
-                    obj["wei_tuo_dan_wei_"] = res[i].wtdh
-                    obj["lian_xi_ren_"]     = res[i].wei_tuo_fang_lian
-                    obj["lian_xi_dian_hua_"] = res[i].wei_tuo_lian
-
-                    obj["yang_ben_ming_che"]  = res[i].yang_pin_ming_che
-                    obj["yang_ben_bian_hao"]  = res[i].yang_pin_bian_hao
-                    obj["pi_hao_bian_hao_"]   = res[i].song_jian_pi_hao_
-                    obj["song_jian_dan_wei"]   = res[i].song_jian_dan_wei
-                    obj["xing_ming_"]         = res[i].xing_ming_
-                    obj["xing_bie_"]          = res[i].xing_bie_
-                    obj["nian_ling_"]         = res[i].nian_ling_
-                    obj["yang_ben_zhuang_t"]  = res[i].yang_pin_zhuang_t
-                    obj["shou_yang_ri_qi_"]   = this_.dateFormat()
-                    obj["bei_zhu_"]           = ypInfoList[i].bei_zhu_
-
-                    obj["yang_ben_lei_xing"] =    x==0? res[i].yang_pin_lei_xing : x==1? res[i].yang_pin_lei_er_ : x==2? res[i].yang_pin_lei_san_ : x==3? res[i].yang_pin_lei_si_ :''
-                    obj["yun_shu_tiao_jian"] =    x==0? res[i].yang_ben_yun_shu_ : x==1? res[i].yang_pin_yun_shu_ : x==2? res[i].yang_pin_yun_san : x==3? res[i].yang_pin_yun_si_ :''
-                    obj["yang_pin_shu_lian"] =    x==0? res[i].shu_liang_ : x==1? res[i].shu_liang_er_ : x==2? res[i].shu_liang_san_ : x==3? res[i].shu_liang_si_ :''
-                    obj["yang_ben_gui_ge_s"] =    x==0? res[i].yang_pin_gui_ge_ : x==1? res[i].yang_pin_gui_ge_e : x==2? res[i].yang_pin_gui_ge_s : x==3? res[i].yang_pin_gui_si_ :''
-                    obj["yan_shou_jie_guo_"] =      ypInfoList[i].yan_shou_jie_guo_
-                    obj["cun_fang_wei_zhi_"] =       ypInfoList[i].shou_yang_wei_zhi
-                    obj["liu_zhuan_zhuang_"] =       '待检'
-                    obj["shi_fou_liu_yang_"] =       ypInfoList[i].shi_fou_liu_yang_
-                    obj["liu_yang_ri_qi_"]    =       ypInfoList[i].liu_yang_ri_qi_
-                    obj["liu_yang_cun_fang"]  =      ypInfoList[i].liu_yang_wei_zhi_
-                    obj["liu_yang_shu_lian"]  =      ypInfoList[i].liu_yang_shu_lian
-                    obj["liu_yang_qi_xian"]   =        ypInfoList[i].liu_yang_qi_xian
-                    obj["xiao_hui_ri_qi_"]    =         ypInfoList[i].xiao_hui_ri_qi_
-                    obj["fan_yang_ri_qi_"]    =         ypInfoList[i].fan_yang_ri_qi_
-                    obj["fan_yang_jyr"]       =       ypInfoList[i].fan_yang_jyr
-                    obj["biao_zhi_uuid_"]     =       ypInfoList[i].biao_zhi_uuid_
-                    obj["song_yang_yao_qiu"]  =    ypInfoList[i].song_yang_yao_qiu
-                    // obj["fen_zhuang_liu_ya"]  =    ypInfoList[i].fen_zhuang_liu_ya
-                    changeWeiZhi = ypInfoList[i].shou_yang_wei_zhi ==''?'':ypInfoList[i].shou_yang_wei_zhi
-                    changesyWeiZhi = ypInfoList[i].liu_yang_wei_zhi_ ==''?'':ypInfoList[i].liu_yang_wei_zhi_
-                    ypdjb.push(obj)
-                  }
-              }
-              let fbbIdStr = ''
-              for(let i =0;i<lhwtbOnlyId.length; i++){
-                fbbIdStr += lhwtbOnlyId[i] + ','
-              }
-              fbbIdStr = fbbIdStr.substring(0,fbbIdStr.length-1)
-              // fbbIdStr = fbbIdStr.replace(/,/g,"','")
-              // console.log('fbbIdStr :',fbbIdStr)
-              // console.log('进入样品登记表...',ypdjb)
-              repostCurd('add', '{"tableName":"t_lhypdjb","paramWhere":' + JSON.stringify(ypdjb) + '}')
-              repostCurd('updates', '{"tableName":"t_lhypb","paramWhere":[' + lhypIdNewList + '],"paramCond":{"jie_yang_zhuang_t":"已接收"}}')
-              
-              /*
-                更新委托单 如果本来没值,就更新 报告编制人和 报告审核员 否则更新
-                委托单数组 和 样品数组 数量相同,遍历两者 判断委托单是否有编制人,审核员?
-                如果没有,则记录下委托单ID,以及同索引下的样品表的编制人和审核员
-              */
-              // let finalWtdIdList = []
-
-/**
- * 1.11胡老师说不要
- 
-              for(var index = 0; index < ypInfoList.length; index++){
-                if(res[index].bao_gao_bian_zhi_  == '' || res[index].bao_gao_fu_he_yua  == ''){
-                 repostCurd('update','{"tableName":"t_lhwtsqb","paramWhere":' + '{"id_":"' + res[index].wtID + '"}' + ',"paramCond":' + '{"bao_gao_bian_zhi_":"'+ypInfoList[index].bao_gao_bian_zhi_+'","bao_gao_fu_he_yua":"' +  ypInfoList[index].bao_gao_shen_he_y + '"}}')
-              }
-            }
-*/
-
-              /*
-              let wtdSQL = "select id_,bao_gao_bian_zhi_,bao_gao_fu_he_yua from t_lhwtsqb where id_ in('" + value + "')"
-
-               repostCurd('sql', wtdSQL).then(response => {
-                   let result = response.variables.data
-                   console.log(result)
-                   for(var i in result){
-                      if(result[i].bao_gao_bian_zhi_ == '' || result[i].bao_gao_bian_zhi_ == undefined){
-                        finalWtdIdList.push(result[i])
-                      }
-                   }
-                   console.log('finalWtdIdList',finalWtdIdList)
-               })
-               */
-
-              /*
-                 3、任务分配     【2022/11/23 取消 直接 批量开检测子流程】【2022/11/30 胡老师又要】
-                 3-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成
-                 3-2、根据每个样品一个任务分配流程 遍历样品表开任务分配流程
-                 3-3、委托表找zhan_shi_biao_id_ 修改  t_lhwtzsb "zhuang_tai_"为"待任务分配"
-              */
-               // console.log('委托单及样品信息',wtdAndYpb)
-               // console.log('委托单id列表 ',lhwtbID)
-               // console.log('展示表id列表 ',lhwtzsbID)
-
-               repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}')
-
-               let rws = []
-              if(wtdAndYpb.length>0){
-                 for(var i in wtdAndYpb){
-                  //  let strs = wtdAndYpb[i].jian_ce_xiang_mu_.split(',')
-                      //  for(var l in strs){
-                        let rw = {}
-                        //  rw["ren_wu_ming_cheng"] = strs[l] //检测项目
-                         rw["yang_pin_ming_che"] = wtdAndYpb[i].yang_pin_ming_che//样品名称
-                         rw["yang_pin_bian_hao"] = wtdAndYpb[i].yang_pin_bian_hao//样品编号
-                         rw["wei_tuo_lei_xing_"] = wtdAndYpb[i].wei_tuo_lei_xing_ //委托类型
-                         let yplxList = []
-                         let ypggList = []
-                         yplxList.push(
-                            wtdAndYpb[i].yang_pin_lei_xing,wtdAndYpb[i].yang_pin_lei_er_,wtdAndYpb[i].yang_pin_lei_san_,wtdAndYpb[i].yang_pin_lei_si_);
-                         ypggList.push(
-                            wtdAndYpb[i].yang_pin_gui_ge_,wtdAndYpb[i].yang_pin_gui_ge_e,wtdAndYpb[i].yang_pin_gui_ge_s,wtdAndYpb[i].yang_pin_gui_si_
-                         );
-                         let yplxz = yplxList.filter(i => i).join(',');
-                         let ypggStr = ypggList.filter(i => i).join(',');
-                         rw["yang_pin_lei_xing"] = yplxz        //  样品类型
-                         rw["yang_pin_gui_ge_"] = ypggStr       // 样品规格
-                         rw["wei_tuo_id_"] = wtdAndYpb[i].wtID  //  委托id
-                         rw["he_tong_id_"] = wtdAndYpb[i].he_tong_id_ //  合同id
-                         rw["zhuang_tai_"] = '待任务分配'       //  状态
-                         rw["wan_cheng_shi_jia"] = wtdAndYpb[i].song_jian_shi_jia   // 送检日期
-                        //  rw["bao_gao_bian_zhi_"] = ypInfoList[i].bao_gao_bian_zhi_  // 报告编制人
-                        //  rw["bao_gao_shen_he_y"] = ypInfoList[i].bao_gao_shen_he_y  // 报告审核人
-                         rw["bao_gao_lei_xing_"] = wtdAndYpb[i].bao_gao_lei_xing_   // 报告类型
-                         rw["xin_xiang_mu_ming"] = wtdAndYpb[i].xiang_mu_ming_che   // 项目名称
-                         rw["zhan_shi_biao_id_"] = wtdAndYpb[i].zhan_shi_biao_id_   // 展示表id
-                         rw["fen_zhuang_liu_ya"] = ypInfoList[i].liu_yang_shu_lian  // 留样数量
-                         rw["shi_fou_jia_ji_"] = wtdAndYpb[i].chu_ju_bao_gao_ya // 是否加急【2023/2/23王嘎嘎提出】
-                         rw["yang_pin_shu_lian"] = ypInfoList[i].jie_yang_shu_lian  // 样品确认总数【2023/3/7王嘎嘎提出】
-                         rws.push(rw)
-                        // }
-                  }
-                //    console.log("任务分配",rws)
-                 repostCurd('add', '{"tableName":"t_lhrwfpb","paramWhere":'+JSON.stringify(rws)+',"defKey":"Process_04o0csc","formKey":"lhrwfp"}')
+        // 搜集所有选择的位置信息
+        //  console.log('当前选择的位置ids:',locationIds)
+         var allLocal = `select * from t_ypcfwz where find_in_set(id_,'${localStr}')`
+         Promise.all([repostCurd("sql",allSQL),repostCurd("sql",allLocal)]).then((res)=>{
+            let result = res[0].variables.data
+            let localInfo = res[1].variables.data
+            // console.log(localInfo)
+            /* 1、更新货架位置信息 */
+            this.emptyLocal = []
+            this.fullLocal  = []
+            let allUUID = []
+            ypInfoList.forEach(item=>{
+                allUUID.push(item.biao_zhi_uuid_1,item.biao_zhi_uuid_2,item.biao_zhi_uuid_3,item.biao_zhi_uuid_4)
+                let allResult = []
+                allResult.push(this.handleLocationInfo(item.shou_yang_wei_zhi_yi,'否',localInfo,locationIds,item,item.biao_zhi_uuid_1,currentTime))
+                if(item.shou_yang_wei_zhi_er != undefined){
+                    allResult.push(this.handleLocationInfo(item.shou_yang_wei_zhi_er,'否',localInfo,locationIds,item,item.biao_zhi_uuid_2,currentTime))
                 }
-                // 更新委托单 检测开始时间   问吴懿是否需要 不需要
-                // repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"jian_ce_kai_shi_s":"' + this_.dateFormat() + '"}}')
-
-                //更新展示表
-                if(lhwtzsbID.length > 0){
-                  repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"任务分配进行中"}}')
+                if(item.shou_yang_wei_zhi_san != undefined){
+                    allResult.push(this.handleLocationInfo(item.shou_yang_wei_zhi_san,'否',localInfo,locationIds,item,item.biao_zhi_uuid_3,currentTime))
                 }
-                
-
-
-
-
-
-               /*
-                3、【任务分配2022/11/23 取消 直接 批量开检测子流程】【2022/11/30 取消】
-                 3-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成
-                 3-2、根据每个样品对应的检测项目,开启一个或多个任务 / 遍历样品表开检测子流程,一个样品可能对应多个检测
-                 3-3、委托表找zhan_shi_biao_id_ 修改  t_lhwtzsb "zhuang_tai_"为"待环境监控"
-                 
-                 repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}')
-                 */
-
-          // console.log('dwhere:',dWhere)
-          // console.log('cfwzIdList:',cfwzIdList)
-          /* 2、更新货架位置信息(位置状态、样品编号、入库时间)如果是重复位置,则新增一条位置记录,并增加对应UUID 
-                判断是否是留样位置,如果是留样位置 位置表shi_fou_liu_yang_字段值为`是` 否则 值为`否`
-          */
-          for (let num in dWhere) {
-            let firstIfEmpty = true
-            let secondIfEmpty = true
-              for(let index = 0; index<cfwzIdList[num].length; index++){
-                let sql = "select * from t_ypcfwz where id_ = '" + cfwzIdList[num][index] + "'"
-                let isLiuYang = index == 1 ? "是" : "否"
-                // console.log(sql)
-                  repostCurd('sql', sql).then(response => {
-                    let resArr = response.variables.data
-                    // console.log(resArr)
-                    if (resArr.length == 1) {
-                      if (resArr[0].wei_zhi_zhuang_ta == "空余") {
-                        if(index == 0){
-                          firstIfEmpty = false
-                        }else{
-                          secondIfEmpty = false
-                        }
-                        let content = {
-                          id_ : cfwzIdList[num][index]
-                        }
-                        let params = {
-                          wei_zhi_zhuang_ta : "占用",
-                          ru_ku_shi_jian_ : this_.dateFormat(),
-                          yang_pin_bian_hao : ypbh[num],
-                          yang_pin_ming_che : lhypmcList[num],
-                          shi_fou_liu_yang_ : isLiuYang
+                if(item.shou_yang_wei_zhi_si != undefined){
+                    allResult.push(this.handleLocationInfo(item.shou_yang_wei_zhi_si,'否',localInfo,locationIds,item,item.biao_zhi_uuid_4,currentTime))
+                }
+                allResult.push(this.handleLocationInfo(item.liu_yang_wei_zhi_yi,'是',localInfo,locationIds,item,item.biao_zhi_uuid_1,currentTime))
+                if(item.liu_yang_wei_zhi_er != undefined){
+                    allResult.push(this.handleLocationInfo(item.liu_yang_wei_zhi_er,'是',localInfo,locationIds,item,item.biao_zhi_uuid_2,currentTime))
+                }
+                if(item.liu_yang_wei_zhi_san != undefined){
+                    allResult.push(this.handleLocationInfo(item.liu_yang_wei_zhi_san,'是',localInfo,locationIds,item,item.biao_zhi_uuid_3,currentTime))
+                }
+                if(item.liu_yang_wei_zhi_si != undefined){
+                    allResult.push(this.handleLocationInfo(item.liu_yang_wei_zhi_si,'是',localInfo,locationIds,item,item.biao_zhi_uuid_4,currentTime))
+                }
+                allResult.forEach(item=>{
+                    item.name === 'emptyLocation' ? this.emptyLocal.push(item.value) : this.fullLocal.push(item.value)
+                })
+            })
+            let allUUIDStr = allUUID.filter(i => i).join(',')
+            // console.log(allUUIDStr)
+            // 更新样品位置list
+            // console.log('emptyLocal:',this.emptyLocal)
+            let allParams = {
+                tableName: 't_ypcfwz',
+                updList: this.emptyLocal
+            }
+            repostCurd('updatesByWhere', JSON.stringify(allParams))
+            // 插入样品位置list
+            // console.log('fullLocal:',this.fullLocal)
+            repostCurd('add', '{"tableName":"t_ypcfwz","paramWhere":' + JSON.stringify(this.fullLocal) + '}').then(res=>{
+                // 再次查询位置表,对比当前样品列表 替换初始值为占用的样品位置id
+                let findLocationAgain = `select id_,shi_fou_liu_yang_,biao_zhi_uuid_ from t_ypcfwz where find_in_set(biao_zhi_uuid_,'${allUUIDStr}')`
+                // console.log(findLocationAgain)
+                repostCurd('sql',findLocationAgain).then(res=>{
+                    let  data  = res.variables.data
+                    let uuidArgs = ['biao_zhi_uuid_1','biao_zhi_uuid_2','biao_zhi_uuid_3','biao_zhi_uuid_4']
+                    let shouYangArgs = ['shou_yang_wei_zhi_yi','shou_yang_wei_zhi_er','shou_yang_wei_zhi_san','shou_yang_wei_zhi_si']
+                    let liuYangArgs = ['liu_yang_wei_zhi_yi','liu_yang_wei_zhi_er','liu_yang_wei_zhi_san','liu_yang_wei_zhi_si']
+                    data.forEach(item=>{
+                            uuidArgs.forEach((uuid,index)=>{
+                                let ypIndex = ypInfoList.findIndex(i => i[uuid] === item.biao_zhi_uuid_)
+                                if(ypIndex != -1){
+                                    item.shi_fou_liu_yang_ === '否' ?  
+                                    ypInfoList[ypIndex][shouYangArgs[index]] = item.id_ : 
+                                    ypInfoList[ypIndex][liuYangArgs[index]] = item.id_
+                                }
+                            })
+                    })
+
+                    repostCurd('updates', '{"tableName":"t_lhypb","paramWhere":[' + lhypIdNewList + '],"paramCond":{"jie_yang_zhuang_t":"已接收"}}')
+
+                    /* 2、封装样品登记表对象,插入样品登记表 顺便封装任务分配表  */
+                    let ypdjb = []
+                    let rws = []
+                    result.forEach((item,index)=>{
+                        // 2-1:统计每个样品有多少类型[数量]
+                        let lxList = []
+                        let ypggList = []
+                        let liuYangList = []
+                        lxList.push(item.yang_pin_lei_xing,item.yang_pin_lei_er_,item.yang_pin_lei_san_,item.yang_pin_lei_si_)
+                        ypggList.push(item.yang_pin_gui_ge_,item.yang_pin_gui_ge_e,item.yang_pin_gui_ge_s,item.yang_pin_gui_si_)
+                        liuYangList.push(ypInfoList[index].liu_yang_shu_lian_yi,ypInfoList[index].liu_yang_shu_lian_er,ypInfoList[index].liu_yang_shu_lian_san,ypInfoList[index].liu_yang_shu_lian_si)
+                        let yplxz = lxList.filter(i => i).join(',')
+                        let ypggStr = ypggList.filter(i => i).join(',')
+                        let liuyangStr = liuYangList.filter(i => i).join(',')
+                        // let count = lxList.filter(i => i).join(',').match(/,/g).length + 1
+                        let size = lxList.filter(i => i).join(',').match(/,/g)
+                        let count = 1
+                        size == null ? count = 1: count = size + 1
+                        for(let c = 0; c < count; c++){
+                            let xmmc = []
+                            xmmc.push(item.chang_gui_xiang_m,item.tao_can_ming_chen)
+                            let xiangMuZh = xmmc.filter(i => i).join(',')
+
+                            let yblx = c==0? item.yang_pin_lei_xing : c==1? item.yang_pin_lei_er_ : c==2? item.yang_pin_lei_san_ : c==3? item.yang_pin_lei_si_ :''
+                            let ystj = c==0? item.yang_ben_yun_shu_ : c==1? item.yang_pin_yun_shu_ : c==2? item.yang_pin_yun_san : c==3? item.yang_pin_yun_si_ :''
+                            let ypsl = c==0? item.shu_liang_ : c==1? item.shu_liang_er_ : c==2? item.shu_liang_san_ : c==3? item.shu_liang_si_ :''
+                            let ybgg = c==0? item.yang_pin_gui_ge_ : c==1? item.yang_pin_gui_ge_e : c==2? item.yang_pin_gui_ge_s : c==3? item.yang_pin_gui_si_ :''
+                            let sywz = c==0? ypInfoList[index].shou_yang_wei_zhi_yi : c==1? ypInfoList[index].shou_yang_wei_zhi_er : c==2? ypInfoList[index].shou_yang_wei_zhi_san : c==3? ypInfoList[index].shou_yang_wei_zhi_si :''
+                            let lycf = c==0? ypInfoList[index].liu_yang_wei_zhi_yi : c==1? ypInfoList[index].liu_yang_wei_zhi_er : c==2? ypInfoList[index].liu_yang_wei_zhi_san : c==3? ypInfoList[index].liu_yang_wei_zhi_si :''
+                            let lysl =  c==0? ypInfoList[index].liu_yang_shu_lian_yi : c==1? ypInfoList[index].liu_yang_shu_lian_er : c==2? ypInfoList[index].liu_yang_shu_lian_san : c==3? ypInfoList[index].liu_yang_shu_lian_si :''  
+                            let currentUUID = c==0? ypInfoList[index].biao_zhi_uuid_1 : c==1? ypInfoList[index].biao_zhi_uuid_2 : c==2? ypInfoList[index].biao_zhi_uuid_3 : c==3? ypInfoList[index].biao_zhi_uuid_4 :''
+                            let obj = {
+                                wei_tuo_dan_hao_ : item.wei_tuo_bian_hao_,
+                                wei_tuo_dan_wei_ : item.wtdh,
+                                lian_xi_ren_     : item.wei_tuo_fang_lian,
+                                lian_xi_dian_hua_: item.wei_tuo_lian,
+                                yang_ben_ming_che: item.yang_pin_ming_che,
+                                yang_ben_bian_hao: item.yang_pin_bian_hao,
+                                pi_hao_bian_hao_ : item.song_jian_pi_hao_,
+                                song_jian_dan_wei: item.song_jian_dan_wei,
+                                xing_ming_       : ypInfoList[index].xing_ming_,
+                                xing_bie_        : ypInfoList[index].xing_bie_,
+                                nian_ling_       : ypInfoList[index].nian_ling_,
+                                yang_ben_zhuang_t: item.yang_pin_zhuang_t,
+                                shou_yang_ri_qi_ : currentTime,
+                                bei_zhu_         : ypInfoList[index].bei_zhu_,
+                                yang_ben_lei_xing: yblx,
+                                yun_shu_tiao_jian: ystj,
+                                yang_pin_shu_lian: ypsl,
+                                yang_ben_gui_ge_s: ybgg,
+                                yan_shou_jie_guo_: ypInfoList[index].yan_shou_jie_guo_,
+                                cun_fang_wei_zhi_: sywz,
+                                liu_zhuan_zhuang_: '待检',
+                                shi_fou_liu_yang_: ypInfoList[index].shi_fou_liu_yang_,
+                                liu_yang_ri_qi_  : ypInfoList[index].liu_yang_ri_qi_,
+                                liu_yang_cun_fang: lycf,
+                                liu_yang_shu_lian: lysl,
+                                liu_yang_qi_xian : ypInfoList[index].liu_yang_qi_xian,
+                                xiao_hui_ri_qi_  : ypInfoList[index].xiao_hui_ri_qi_,
+                                fan_yang_ri_qi_  : ypInfoList[index].fan_yang_ri_qi_,
+                                fan_yang_jyr     : ypInfoList[index].fan_yang_jyr,
+                                biao_zhi_uuid_   : currentUUID,
+                                song_yang_yao_qiu: ypInfoList[index].song_yang_yao_qiu,
+                                jian_ce_xiang_mu_: xiangMuZh
+                            }
+                            ypdjb.push(obj)
                         }
-                        let o = {
-                          tableName:'t_ypcfwz',
-                          paramWhere:content,
-                          paramCond : params
+                        // 2-2:封装任务分配表
+                        let rw = {
+                            yang_pin_ming_che : item.yang_pin_ming_che,
+                            yang_pin_bian_hao : item.yang_pin_bian_hao,
+                            wei_tuo_lei_xing_ : item.wei_tuo_lei_xing_,
+                            yang_pin_lei_xing : yplxz,
+                            yang_pin_gui_ge_  : ypggStr,
+                            wei_tuo_id_       : item.wtID,
+                            he_tong_id_       : item.he_tong_id_,
+                            zhuang_tai_       : '待任务分配',
+                            wan_cheng_shi_jia : item.song_jian_shi_jia,
+                            bao_gao_lei_xing_ : item.bao_gao_lei_xing_,
+                            xin_xiang_mu_ming : item.xiang_mu_ming_che,
+                            zhan_shi_biao_id_ : item.zhan_shi_biao_id_,
+                            fen_zhuang_liu_ya : liuyangStr, 
+                            shi_fou_jia_ji_   : item.chu_ju_bao_gao_ya,             // 是否加急【2023/2/23王嘎嘎提出】
+                            yang_pin_shu_lian : ypInfoList[index].jie_yang_shu_lian // 样品确认总数【2023/3/7王嘎嘎提出】
                         }
-                        repostCurd('update',JSON.stringify(o)).then(res=>{
-                          console.log("空余位置修改")
-                        })
-                      
-                      } else if (resArr[0].wei_zhi_zhuang_ta == "占用") {
-                        // 新增一条新的位置记录,使用旧的位置记录 修改它的样品编号,入库时间,标识UUID
-                        let cfNewList = []
-                        let cfNew = {}
-                        cfNew["fang_jian_lei_xin"] = resArr[0].fang_jian_lei_xin
-                        cfNew["wei_zhi_"] = resArr[0].wei_zhi_
-                        cfNew["qu_yu_"] = resArr[0].qu_yu_
-                        cfNew["huo_jia_lei_xing_"] = resArr[0].huo_jia_lei_xing_
-                        cfNew["huo_jia_hao_"] = resArr[0].huo_jia_hao_
-                        cfNew["ceng_hao_"] = resArr[0].ceng_hao_
-                        cfNew["shui_ping_fen_qu_"] = resArr[0].shui_ping_fen_qu_
-                        cfNew["wei_zhi_bian_hao_"] = resArr[0].wei_zhi_bian_hao_
-                        cfNew["wei_zhi_zhuang_ta"] = resArr[0].wei_zhi_zhuang_ta
-                        cfNew["cun_chu_tiao_jian"] = resArr[0].cun_chu_tiao_jian
-                        cfNew["yang_pin_bian_hao"] = ypbh[num]
-                        cfNew["shi_fou_guo_shen_"] = '启用'
-                        // cfNew["yang_pin_bian_hao"] = lhypIdList[num]
-                        cfNew["yang_pin_ming_che"] = lhypmcList[num]
-                        cfNew["ru_ku_shi_jian_"] = this_.dateFormat()
-                        cfNew["shi_fou_liu_yang_"] = isLiuYang
-                        cfNew["biao_zhi_uuid_"] = uuidList[num]
-                        cfNewList.push(cfNew)
-                        let uuid = cfNew["biao_zhi_uuid_"];
-                        // console.log('货位:',cfNewList)
-
-
-                        repostCurd('add', '{"tableName":"t_ypcfwz","paramWhere":' + JSON.stringify(cfNewList) + '}').then(res => {
-                          let selectsql = "select id_ from t_ypcfwz where biao_zhi_uuid_='" + uuid + "'";
-                          repostCurd('sql', selectsql).then(res => {
-                            // let dataid = res.variables.data[0].id_;
-                            let data = res.variables.data;
-                            // console.log('data:',data)
-                            let suchAs = '{"biao_zhi_uuid_":"' + uuid + '"}'
-                            // console.log(data.length,changeWeiZhi,changesyWeiZhi,firstIfEmpty,secondIfEmpty)
-                            if(data.length == 1 && changeWeiZhi && firstIfEmpty){
-                              repostCurd('update', '{"tableName":"t_lhypdjb","paramWhere":'+suchAs+',"paramCond":{"cun_fang_wei_zhi_":"'+data[0].id_+'"}}').then(res=>{
-                                console.log('One 存放位置',res)
-                              })
-                            }else if(data.length == 1 && changesyWeiZhi && secondIfEmpty){
-                              repostCurd('update', '{"tableName":"t_lhypdjb","paramWhere":'+suchAs+',"paramCond":{"liu_yang_cun_fang":"'+data[0].id_+'"}}').then(res=>{
-                                console.log('One 留样位置',res)
-                              })
-                            }else if(data.length == 2 && changeWeiZhi && changesyWeiZhi){
-                              let whereL = []
-                              whereL.push(suchAs)
-                              repostCurd('updates', '{"tableName":"t_lhypdjb","paramWhere":['+whereL+'],"paramCond":{"cun_fang_wei_zhi_":"'+data[0].id_+'","liu_yang_cun_fang":"'+data[1].id_+'"}}').then(res=>{
-                                console.log('Two 收样留样位置',res)
-                              })
-                            }
-                          })
-                        })
-                      }
+                        rws.push(rw)
+
+                        
+                        lhwtzsbID.push('{"shen_qing_id_":"' + item.zhan_shi_biao_id_ + '"}')
+                        lhwtbID.push('{"id_":"' + item.wtID + '"}')
+
+                    })
+                    // console.log('样品登记表...',ypdjb)
+                    repostCurd('add', '{"tableName":"t_lhypdjb","paramWhere":' + JSON.stringify(ypdjb) + '}')
+                    
+                    
+                    /* 3、更新样品表  */
+                    // console.log('3、更新样品表',lhypIdNewList)
+                    repostCurd('updates', '{"tableName":"t_lhypb","paramWhere":[' + lhypIdNewList + '],"paramCond":{"jie_yang_zhuang_t":"已接收"}}')
+                    
+                    
+
+                    /* 4、任务分配 
+                        4-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成
+                        4-2、根据每个样品一个任务分配流程 遍历样品表开任务分配流程
+                        4-3、委托表找zhan_shi_biao_id_ 修改  t_lhwtzsb "zhuang_tai_"为"任务分配进行中"
+                    */
+                    // console.log('4、更改委托表的 委托状态',lhwtbID)
+                    repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}')
+                    // console.log("4、任务分配",rws)
+                    repostCurd('add', '{"tableName":"t_lhrwfpb","paramWhere":'+JSON.stringify(rws)+',"defKey":"Process_04o0csc","formKey":"lhrwfp"}')
+
+                    /* 5、更新展示表  */
+                    if(lhwtzsbID.length > 0){
+                        // console.log('5、更新展示表',lhwtzsbID)
+                        repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"任务分配进行中"}}')
                     }
-                  })
-              }
-          }
-           
-          /*
-               let ffbSql = "select * from t_lhfbb where FIND_IN_SET( parent_id_,'"+ fbbIdStr +"')"
-               repostCurd('sql',ffbSql).then(response => {
-                 let ffbList = response.variables.data
-                 if(wtdAndYpb.length>0){
-                   let jcxmArr = []
-                   wtdAndYpb.forEach(item=>{
-                     item.jian_ce_xiang_mu_.split(',').reverse().forEach(temp=>{
-                       jcxmArr.push(temp)
-                     })
-                   })
-                   let allProject = []
-                   let finalJCTask = []
-                   let processDefKeyParam = []
-                   let processFormKeyParam = []
-                   let sql111 = `select id_, defkey_, formkey_ from t_mjjcnlfw where defkey_ != '' and find_in_set(id_, '${jcxmArr.join(',')}')`
-                   repostCurd('sql', sql111).then(res => {
-                        allProject = res.variables.data
-                        wtdAndYpb.forEach(item => {
-                          let yblxArr = []
-                          let yblxStr = ''
-                          yblxArr.push(item.yang_pin_lei_xing, item.yang_pin_lei_er_, item.yang_pin_lei_san_, item.yang_pin_lei_si_)
-                          yblxStr = yblxArr.filter(s => s).join(',')
-                          let t = item.jian_ce_xiang_mu_.split(',')
-                          let ypList = ypInfoList.find(k => k.id_ === item.id_)
-                          t.forEach(i => {
-                             let fbbItem = ffbList.find(j => j.jian_ce_xiang_mu_ === i)
-                             let jcxmItem = allProject.find(k => k.id_ === i)
-                             let obj = {
-                                 jian_ce_yuan_: fbbItem.jian_ce_yuan_,
-                                 fu_he_yuan_  : fbbItem.fu_he_yuan_,
-                                 yang_pin_ming_che: item.yang_pin_ming_che,
-                                 yang_pin_bian_hao: item.yang_pin_bian_hao,
-                                 jian_ce_xiang_mu_:jcxmItem.id_,
-                                 wei_tuo_id_:item.wtID,
-                                 he_tong_id_:item.he_tong_id_,
-                                 bao_gao_bian_zhi_:ypList.bao_gao_bian_zhi_,
-                                 bao_gao_fu_he_yua:ypList.bao_gao_shen_he_y,
-                                 wei_tuo_lei_xing_:item.wei_tuo_lei_xing_,
-                                 yang_pin_lei_xing: yblxStr,
-                                 xin_xiang_mu_ming:item.xiang_mu_ming_che,
-                                 wan_cheng_shi_jia:item.song_jian_shi_jia,
-                                 zhuang_tai_:'待环境监控',
-                                 zhan_shi_biao_id_:item.zhan_shi_biao_id_
-                             }
-                             finalJCTask.push(obj)
-                             processDefKeyParam.push(jcxmItem.defkey_)
-                             processFormKeyParam.push(jcxmItem.formkey_)
-                          })
-                        })
-                       finalJCTask.forEach((item,index )=>{
-                         let obj = {
-                           tableName:"t_lhjczb",
-                           paramWhere:[item],
-                           defKey:processDefKeyParam[index],
-                           formKey:processFormKeyParam[index]
-                         }
-                       repostCurd('add', JSON.stringify(obj))
-                       })
-                   })
-                   }
-               })
-              //更新展示表
-              if(lhwtzsbID.length > 0){
-                repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"检测进行中"}}')
-              }
-              */
-          })
-
-
+                })
+            })
+         })
+         // todo 让列表刷新
           this.$emit('callback', true)
           this.visable = false
           this.$message({
@@ -661,16 +450,64 @@ export default {
       cont['paramCond'] = cond
       return repostCurd('update', JSON.stringify(cont))
     },
-
-    /* zzj add */
-    dateFormat() { // 获取当前时间
-      var date = new Date();
-      var year = date.getFullYear();
-      var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
-      var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
-      return year + "-" + month + "-" + day;
+    // 根据旧位置数据生成新位置数据
+    generateNewLocation(oldLocation,sampleInfo){
+        let temp = {
+            fang_jian_lei_xin : oldLocation.fang_jian_lei_xin,
+            wei_zhi_          : oldLocation.wei_zhi_,
+            qu_yu_            : oldLocation.qu_yu_,
+            huo_jia_lei_xing_ : oldLocation.huo_jia_lei_xing_,
+            huo_jia_hao_      : oldLocation.huo_jia_hao_,
+            ceng_hao_         : oldLocation.ceng_hao_,
+            shui_ping_fen_qu_ : oldLocation.shui_ping_fen_qu_,
+            wei_zhi_bian_hao_ : oldLocation.wei_zhi_bian_hao_,
+            wei_zhi_zhuang_ta : oldLocation.wei_zhi_zhuang_ta,
+            cun_chu_tiao_jian : oldLocation.cun_chu_tiao_jian,
+            shi_fou_guo_shen_ : '启用',
+            yang_pin_bian_hao : sampleInfo.yang_pin_bian_hao,
+            yang_pin_ming_che : sampleInfo.yang_pin_ming_che,
+            ru_ku_shi_jian_   : sampleInfo.ru_ku_shi_jian_,
+            shi_fou_liu_yang_ : sampleInfo.shi_fou_liu_yang_,
+            biao_zhi_uuid_    : sampleInfo.biao_zhi_uuid_
+        }
+        return temp 
+    },
+    handleLocationInfo(currentLocation,isLiuYang,localInfo,locationIds,item,UUID,currentTime){
+        !locationIds.has(currentLocation) ? locationIds.add(currentLocation) : localInfo.find(i => i.id_ === currentLocation).wei_zhi_zhuang_ta ='占用'
+        if(localInfo.find(i => i.id_ === currentLocation).wei_zhi_zhuang_ta ==='空余'){
+            let obj = {
+                where: {
+                    id_ : currentLocation
+                },
+                param: {
+                    wei_zhi_zhuang_ta : "占用",
+                    ru_ku_shi_jian_ : currentTime,
+                    yang_pin_bian_hao : item.yang_pin_bian_hao,
+                    yang_pin_ming_che : item.yang_pin_ming_che,
+                    shi_fou_liu_yang_ : isLiuYang
+                }
+            }
+            let result = {
+                name : 'emptyLocation',
+                value: obj
+            }
+            return result
+        }else{ // 新增一条位置信息(修改它的样品编号,样品名称,入库时间,标识UUID)
+            let sampleInfo = {
+                yang_pin_bian_hao : item.yang_pin_bian_hao,
+                yang_pin_ming_che : item.yang_pin_ming_che,
+                ru_ku_shi_jian_   : currentTime,
+                biao_zhi_uuid_    : UUID,
+                shi_fou_liu_yang_ : isLiuYang
+            }
+            let newLocation = this.generateNewLocation(localInfo.find(i => i.id_ === currentLocation),sampleInfo)
+            let result = {
+                name : 'fullLocation',
+                value: newLocation
+            }
+            return result
+        }
     },
-
 
     /* 关闭*/
     remRedar() {

+ 278 - 398
src/views/system/jbdScan/js/sampleConfirmationJS.js

@@ -22,7 +22,7 @@ export default {
       let flag = true  // 重复扫码标志位
       for (let index in this.listData) { // 判断是否重复,重复扫码 数量自增
           if (this.listData[index].yang_pin_bian_hao == id) {
-              this.listData[index].jie_yang_shu_lian = this.listData[index].jie_yang_shu_lian + 1
+              this.listData[index].jie_yang_shu_lian = parseInt(this.listData[index].jie_yang_shu_lian) + 1
               flag = false
           }
         }
@@ -31,19 +31,28 @@ export default {
       if(flag){
         let sql = `select ypb.*,sqb.chu_ju_bao_gao_ya from t_lhypb ypb join t_lhwtsqb sqb on ypb.parent_id_ = sqb.id_  and find_in_set(ypb.yang_pin_bian_hao,'${id}') and ypb.jie_yang_zhuang_t = '待接收' and ypb.shi_fou_guo_shen_ = '1'`
          repostCurd('sql',sql).then(res => {
-          if (res.variables.data && res.variables.data.length > 0) {
-            for (let i in res.variables.data) {
-              res.variables.data[i].jie_yang_shu_lian = res.variables.data[i].yang_pin_zong_shu
-              res.variables.data[i].jie_yang_zhuang_t = '已确认'
-              res.variables.data[i].biao_zhi_uuid_ = this.uuid()
-              res.variables.data[i].shi_fou_liu_yang_ = '是'
-              res.variables.data[i].yan_shou_jie_guo_ = '完好'
-              res.variables.data[i].liu_yang_shu_lian = ' ml/支×1支'
-              res.variables.data[i].liu_yang_ri_qi_ = this.dateFormat()
-            //   res.variables.data[i].liu_yang_qi_xian = dayjs(res.variables.data[i].song_jian_shi_jia).add(3,'month').format("YYYY-MM-DD")
-            //   res.variables.data[i].xiao_hui_ri_qi_ = dayjs(res.variables.data[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD")
-              this.listData.push(res.variables.data[i])
-            }
+            let temp = res.variables.data
+            if(temp){
+                temp.forEach(item => {
+                    item.jie_yang_shu_lian = item.yang_pin_zong_shu
+                    item.jie_yang_zhuang_t = '已确认'
+                    item.biao_zhi_uuid_1 = this.uuid()
+                    item.biao_zhi_uuid_2 = this.uuid()
+                    item.biao_zhi_uuid_3 = this.uuid()
+                    item.biao_zhi_uuid_4 = this.uuid()
+                    item.shi_fou_liu_yang_ = '是'
+                    item.yan_shou_jie_guo_ = '完好'
+                    item.liu_yang_shu_lian_yi = ' ml/支×1支'
+                    item.yang_pin_lei_er_ ? item.liu_yang_shu_lian_er = ' ml/支×1支' : null
+                    item.yang_pin_lei_san_ ? item.liu_yang_shu_lian_san = ' ml/支×1支' : null
+                    item.yang_pin_lei_si_  ? item.liu_yang_shu_lian_si = ' ml/支×1支' : null
+                    item.liu_yang_ri_qi_ =  new Date(new Date().getTime() + 28800000).toJSON().slice(0, 10).replace('T', ' ')
+                    item.yang_pin_lei_er_ ? this.$set(item,'flag2',true) : this.$set(item,'flag2',false)
+                    item.yang_pin_lei_san_ ? this.$set(item,'flag3',true) : this.$set(item,'flag3',false)
+                    item.yang_pin_lei_si_  ? this.$set(item,'flag4',true) : this.$set(item,'flag4',false)
+                })
+                this.listData.push(temp[0])
+                console.log(this.listData)
             }
         })
       }
@@ -69,8 +78,6 @@ export default {
       submitData(type) {
         // this指针
         let this_ = this;
-        let changeWeiZhi;     // 此处俩字段作用在下面 选择货位时出现重复位置 而重新更新样品登记表 收样位置|留样位置
-        let changesyWeiZhi;
         // 回传关闭事件。隐藏当前组件。
         let judge = true;
   
@@ -87,33 +94,31 @@ export default {
   
             // 获取样品列表
             let ypInfoList = this_.listData
+          //   console.log(ypInfoList, "样品信息")
+  
             let dWhere = []
             let ypbh = []
-            let cfwzIdList = [] // 放置 存放位置的ID
             let ypbhList = [] // 样品编号列表
+  
             // 罗湖样品编号列表
             let lhypbhList = []
             let lhypmcList = []
-            // 罗湖委托单列表
-            let lhwtsqbList = []
-            // 罗湖样品表列表
-            let lhypbList = []
             // 罗湖样品表外键
             let lhypbWJ = []
             // 罗湖委托表主键
             let lhwtbID = []
-            let lhwtbOnlyId = []
             // 罗湖委托表展示表ID
             let lhwtzsbID = []
             // 罗湖样品id列表
             let lhypIdList = []
             // 罗湖样品id格式列表
             let lhypIdNewList = []
-            let uuidList = [] // 列表的UUID
-  
+            // 样品所选择的位置ID字符串
+            let localStr = ''
+            let locationIds = new Set()
+            let localArr = []
   
             for (let yp in ypInfoList) { //样品数据
-              let cfwzObj = []
               let cfwz = ''
               /*
                 校验:
@@ -139,53 +144,31 @@ export default {
                 this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 是否留样不能为空!')
                 return;
               }
-              cfwzObj.push(ypInfoList[yp].shou_yang_wei_zhi) //取位置信息
-  
               if (ypInfoList[yp].shi_fou_liu_yang_ == "是") {
-                if (ypInfoList[yp].liu_yang_wei_zhi_ == null || ypInfoList[yp].liu_yang_wei_zhi_ == '') {
-                  this_.$message.error("你要留样的话,存放位置不能为空哦!")
-                  return;
-                }
                 if (ypInfoList[yp].liu_yang_ri_qi_ == null || ypInfoList[yp].liu_yang_ri_qi_ == '') {
                   this_.$message.error("留样时必须填写留样日期!")
                   return;
                 }
-                if (ypInfoList[yp].liu_yang_shu_lian == null || ypInfoList[yp].liu_yang_shu_lian == '') {
-                  this_.$message.error("留样时必须填写留样数量!")
-                  return;
-                }
-                // if (ypInfoList[yp].liu_yang_shu_lian > ypInfoList[yp].yang_pin_zong_shu) {
-                //   this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 留样数量不得大于收样数量。')
-                //   return;
-                // }
-                // if (ypInfoList[yp].liu_yang_qi_xian == null || ypInfoList[yp].liu_yang_qi_xian == '') {
-                //   this_.$message.error("留样时必须填写留样期限!")
-                //   return;
-                // }
-                // if (ypInfoList[yp].xiao_hui_ri_qi_ == null || ypInfoList[yp].xiao_hui_ri_qi_ == '') {
-                //   this_.$message.error("留样时必须填写销毁日期!")
-                //   return;
-                // }
-                  cfwzObj.push(ypInfoList[yp].liu_yang_wei_zhi_)
               } 
               ypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}') // 样品编号列表
-  
-  
               // 罗湖
               dWhere.push('{"id_":"' + cfwz + '"}')
-              cfwzIdList.push(cfwzObj)
               lhypbhList.push( ypInfoList[yp].yang_pin_bian_hao )
               lhypbWJ.push( ypInfoList[yp].parent_id_ )
               lhypIdList.push( ypInfoList[yp].id_ )
               lhypIdNewList.push('{"id_":"' + ypInfoList[yp].id_ + '"}')
-              uuidList.push(ypInfoList[yp].biao_zhi_uuid_)
               ypbh.push(ypInfoList[yp].yang_pin_bian_hao)
               lhypmcList.push(ypInfoList[yp].yang_pin_ming_che)
+  
+              localArr.push(
+                  ypInfoList[yp].shou_yang_wei_zhi_yi,ypInfoList[yp].liu_yang_wei_zhi_yi,
+                  ypInfoList[yp].shou_yang_wei_zhi_er,ypInfoList[yp].liu_yang_wei_zhi_er,
+                  ypInfoList[yp].shou_yang_wei_zhi_san,ypInfoList[yp].liu_yang_wei_zhi_san,
+                  ypInfoList[yp].shou_yang_wei_zhi_si,ypInfoList[yp].liu_yang_wei_zhi_si
+                  )
             }
+            localStr = localArr.filter(i => i).join(',')
   
-          /*
-            封装好样品登记表对象,add 样品登记表
-          */
            let value = ''
            let lhypIdStr = ''
            for(let i =0;i<lhypbWJ.length; i++){
@@ -199,353 +182,200 @@ export default {
            lhypIdStr = lhypIdStr.substring(0,lhypIdStr.length-1)
            lhypIdStr = lhypIdStr.replace(/,/g,"','")
   
-           // console.log('lhypIdStr :',lhypIdStr)
-           let wtdAndYpb = []
+           let currentTime = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 16).replace('T', ' ')
            let allSQL = `select a.id_ as wtID,a.chu_ju_bao_gao_ya,a.zhan_shi_biao_id_,a.wei_tuo_lei_xing_,a.he_tong_id_,a.bao_gao_lei_xing_,a.wei_tuo_bian_hao_, a.wei_tuo_dan_wei_ as wtdh, a.wei_tuo_fang_lian, a.wei_tuo_lian,a.bao_gao_bian_zhi_,a.bao_gao_fu_he_yua,b.* from t_lhwtsqb a inner join t_lhypb b on a.id_ = b.parent_id_ where b.parent_id_ in ('${value}')and b.id_ in ('${lhypIdStr}')`
-            // console.log(allSQL)
-            repostCurd('sql', allSQL).then(res1 => {
-                /* 封装样品登记表对象  */
-                let ypdjb = []
-                let res = res1.variables.data
-                wtdAndYpb = res
-  
-                for(let i = 0; i<res.length; i++){
-                lhwtbID.push('{"id_":"' + res[i].wtID + '"}')
-                lhwtbOnlyId.push(res[i].wtID)
-                lhwtzsbID.push('{"shen_qing_id_":"' + res[i].zhan_shi_biao_id_ + '"}')
-                    let count = 0;
-                    if(res[i].yang_pin_lei_xing != ''  && res[i].yang_pin_lei_xing != undefined){
-                      count = 1;
-                      if(res[i].yang_pin_lei_er_ != ''  && res[i].yang_pin_lei_er_ != undefined){
-                         count = 2;
-                         if(res[i].yang_pin_lei_san_ != ''  && res[i].yang_pin_lei_san_ != undefined){
-                           count = 3;
-                           if(res[i].yang_pin_lei_si_ != ''  && res[i].yang_pin_lei_si_ != undefined){
-                             count = 4;
-                           }
-                         }
-                      }
-                    }
-                    for(let x = 0; x<count;x++){
-                      let obj = {}
-                      obj["wei_tuo_dan_hao_"] = res[i].wei_tuo_bian_hao_
-                      obj["wei_tuo_dan_wei_"] = res[i].wtdh
-                      obj["lian_xi_ren_"]     = res[i].wei_tuo_fang_lian
-                      obj["lian_xi_dian_hua_"] = res[i].wei_tuo_lian
-  
-                      obj["yang_ben_ming_che"]  = res[i].yang_pin_ming_che
-                      obj["yang_ben_bian_hao"]  = res[i].yang_pin_bian_hao
-                      obj["pi_hao_bian_hao_"]   = res[i].song_jian_pi_hao_
-                      obj["song_jian_dan_wei"]  = res[i].song_jian_dan_wei
-                      obj["xing_ming_"]         = res[i].xing_ming_
-                      obj["xing_bie_"]          = res[i].xing_bie_
-                      obj["nian_ling_"]         = res[i].nian_ling_
-                      obj["yang_ben_zhuang_t"]  = res[i].yang_pin_zhuang_t
-                      obj["shou_yang_ri_qi_"]   = this_.dateFormat()
-                      obj["bei_zhu_"]           = ypInfoList[i].bei_zhu_
-  
-                      obj["yang_ben_lei_xing"] =    x==0? res[i].yang_pin_lei_xing : x==1? res[i].yang_pin_lei_er_ : x==2? res[i].yang_pin_lei_san_ : x==3? res[i].yang_pin_lei_si_ :''
-                      obj["yun_shu_tiao_jian"] =    x==0? res[i].yang_ben_yun_shu_ : x==1? res[i].yang_pin_yun_shu_ : x==2? res[i].yang_pin_yun_san : x==3? res[i].yang_pin_yun_si_ :''
-                      obj["yang_pin_shu_lian"] =    x==0? res[i].shu_liang_ : x==1? res[i].shu_liang_er_ : x==2? res[i].shu_liang_san_ : x==3? res[i].shu_liang_si_ :''
-                      obj["yang_ben_gui_ge_s"] =    x==0? res[i].yang_pin_gui_ge_ : x==1? res[i].yang_pin_gui_ge_e : x==2? res[i].yang_pin_gui_ge_s : x==3? res[i].yang_pin_gui_si_ :''
-                      obj["yan_shou_jie_guo_"] =      ypInfoList[i].yan_shou_jie_guo_
-                      obj["cun_fang_wei_zhi_"] =       ypInfoList[i].shou_yang_wei_zhi
-                      obj["liu_zhuan_zhuang_"] =       '待检'
-                      obj["shi_fou_liu_yang_"] =       ypInfoList[i].shi_fou_liu_yang_
-                      obj["liu_yang_ri_qi_"]    =       ypInfoList[i].liu_yang_ri_qi_
-                      obj["liu_yang_cun_fang"]  =      ypInfoList[i].liu_yang_wei_zhi_
-                      obj["liu_yang_shu_lian"]  =      ypInfoList[i].liu_yang_shu_lian
-                      obj["liu_yang_qi_xian"]   =        ypInfoList[i].liu_yang_qi_xian
-                      obj["xiao_hui_ri_qi_"]    =         ypInfoList[i].xiao_hui_ri_qi_
-                      obj["fan_yang_ri_qi_"]    =         ypInfoList[i].fan_yang_ri_qi_
-                      obj["fan_yang_jyr"]       =       ypInfoList[i].fan_yang_jyr
-                      obj["biao_zhi_uuid_"]     =       ypInfoList[i].biao_zhi_uuid_
-                      obj["song_yang_yao_qiu"]  =    ypInfoList[i].song_yang_yao_qiu
-                      // obj["fen_zhuang_liu_ya"]  =    ypInfoList[i].fen_zhuang_liu_ya
-                      changeWeiZhi = ypInfoList[i].shou_yang_wei_zhi ==''?'':ypInfoList[i].shou_yang_wei_zhi
-                      changesyWeiZhi = ypInfoList[i].liu_yang_wei_zhi_ ==''?'':ypInfoList[i].liu_yang_wei_zhi_
-                      ypdjb.push(obj)
-                    }
-                }
-                let fbbIdStr = ''
-                for(let i =0;i<lhwtbOnlyId.length; i++){
-                  fbbIdStr += lhwtbOnlyId[i] + ','
-                }
-                fbbIdStr = fbbIdStr.substring(0,fbbIdStr.length-1)
-                // fbbIdStr = fbbIdStr.replace(/,/g,"','")
-                // console.log('fbbIdStr :',fbbIdStr)
-                // console.log('进入样品登记表...',ypdjb)
-                repostCurd('add', '{"tableName":"t_lhypdjb","paramWhere":' + JSON.stringify(ypdjb) + '}')
-                repostCurd('updates', '{"tableName":"t_lhypb","paramWhere":[' + lhypIdNewList + '],"paramCond":{"jie_yang_zhuang_t":"已接收"}}')
-                
-                /*
-                  更新委托单 如果本来没值,就更新 报告编制人和 报告审核员 否则更新
-                  委托单数组 和 样品数组 数量相同,遍历两者 判断委托单是否有编制人,审核员?
-                  如果没有,则记录下委托单ID,以及同索引下的样品表的编制人和审核员
-                */
-                // let finalWtdIdList = []
-  
-  /**
-   * 1.11胡老师说不要
-   
-                for(var index = 0; index < ypInfoList.length; index++){
-                  if(res[index].bao_gao_bian_zhi_  == '' || res[index].bao_gao_fu_he_yua  == ''){
-                   repostCurd('update','{"tableName":"t_lhwtsqb","paramWhere":' + '{"id_":"' + res[index].wtID + '"}' + ',"paramCond":' + '{"bao_gao_bian_zhi_":"'+ypInfoList[index].bao_gao_bian_zhi_+'","bao_gao_fu_he_yua":"' +  ypInfoList[index].bao_gao_shen_he_y + '"}}')
-                }
-              }
-  */
-  
-                /*
-                let wtdSQL = "select id_,bao_gao_bian_zhi_,bao_gao_fu_he_yua from t_lhwtsqb where id_ in('" + value + "')"
-  
-                 repostCurd('sql', wtdSQL).then(response => {
-                     let result = response.variables.data
-                     console.log(result)
-                     for(var i in result){
-                        if(result[i].bao_gao_bian_zhi_ == '' || result[i].bao_gao_bian_zhi_ == undefined){
-                          finalWtdIdList.push(result[i])
-                        }
-                     }
-                     console.log('finalWtdIdList',finalWtdIdList)
-                 })
-                 */
-  
-                /*
-                   3、任务分配     【2022/11/23 取消 直接 批量开检测子流程】【2022/11/30 胡老师又要】
-                   3-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成
-                   3-2、根据每个样品一个任务分配流程 遍历样品表开任务分配流程
-                   3-3、委托表找zhan_shi_biao_id_ 修改  t_lhwtzsb "zhuang_tai_"为"待任务分配"
-                */
-                 // console.log('委托单及样品信息',wtdAndYpb)
-                 // console.log('委托单id列表 ',lhwtbID)
-                 // console.log('展示表id列表 ',lhwtzsbID)
-  
-                 repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}')
-  
-                 let rws = []
-                if(wtdAndYpb.length>0){
-                   for(var i in wtdAndYpb){
-                    //  let strs = wtdAndYpb[i].jian_ce_xiang_mu_.split(',')
-                        //  for(var l in strs){
-                          let rw = {}
-                          //  rw["ren_wu_ming_cheng"] = strs[l] //检测项目
-                           rw["yang_pin_ming_che"] = wtdAndYpb[i].yang_pin_ming_che//样品名称
-                           rw["yang_pin_bian_hao"] = wtdAndYpb[i].yang_pin_bian_hao//样品编号
-                           rw["wei_tuo_lei_xing_"] = wtdAndYpb[i].wei_tuo_lei_xing_ //委托类型
-                           let yplxList = []
-                            let ypggList = []
-                            yplxList.push(
-                                wtdAndYpb[i].yang_pin_lei_xing,wtdAndYpb[i].yang_pin_lei_er_,wtdAndYpb[i].yang_pin_lei_san_,wtdAndYpb[i].yang_pin_lei_si_);
-                            ypggList.push(
-                                wtdAndYpb[i].yang_pin_gui_ge_,wtdAndYpb[i].yang_pin_gui_ge_e,wtdAndYpb[i].yang_pin_gui_ge_s,wtdAndYpb[i].yang_pin_gui_si_
-                            );
-                           let yplxz = yplxList.filter(i => i).join(',');
-                           let ypggStr = ypggList.filter(i => i).join(',');
-                           rw["yang_pin_lei_xing"] = yplxz        //  样品类型
-                           rw["yang_pin_gui_ge_"] = ypggStr       // 样品规格
-                           rw["wei_tuo_id_"] = wtdAndYpb[i].wtID  //  委托id
-                           rw["he_tong_id_"] = wtdAndYpb[i].he_tong_id_ //  合同id
-                           rw["zhuang_tai_"] = '待任务分配'       //  状态
-                           rw["wan_cheng_shi_jia"] = wtdAndYpb[i].song_jian_shi_jia   // 送检日期
-                          //  rw["bao_gao_bian_zhi_"] = ypInfoList[i].bao_gao_bian_zhi_  // 报告编制人
-                          //  rw["bao_gao_shen_he_y"] = ypInfoList[i].bao_gao_shen_he_y  // 报告审核人
-                           rw["bao_gao_lei_xing_"] = wtdAndYpb[i].bao_gao_lei_xing_   // 报告类型
-                           rw["xin_xiang_mu_ming"] = wtdAndYpb[i].xiang_mu_ming_che   // 项目名称
-                           rw["zhan_shi_biao_id_"] = wtdAndYpb[i].zhan_shi_biao_id_   // 展示表id
-                           rw["fen_zhuang_liu_ya"] = ypInfoList[i].liu_yang_shu_lian  // 留样数量
-                           rw["shi_fou_jia_ji_"] = wtdAndYpb[i].chu_ju_bao_gao_ya // 是否加急【2023/2/23王嘎嘎提出】
-                           rw["yang_pin_shu_lian"] = ypInfoList[i].jie_yang_shu_lian  // 样品确认总数【2023/3/7王嘎嘎提出】
-                           rws.push(rw)
-                          // }
-                    }
-                    //  console.log("任务分配",rws)
-                   repostCurd('add', '{"tableName":"t_lhrwfpb","paramWhere":'+JSON.stringify(rws)+',"defKey":"Process_04o0csc","formKey":"lhrwfp"}')
+          // 搜集所有选择的位置信息
+          //  console.log('当前选择的位置ids:',locationIds)
+           var allLocal = `select * from t_ypcfwz where find_in_set(id_,'${localStr}')`
+           Promise.all([repostCurd("sql",allSQL),repostCurd("sql",allLocal)]).then((res)=>{
+              let result = res[0].variables.data
+              let localInfo = res[1].variables.data
+              // console.log(localInfo)
+              /* 1、更新货架位置信息 */
+              this.emptyLocal = []
+              this.fullLocal  = []
+              let allUUID = []
+              ypInfoList.forEach(item=>{
+                  allUUID.push(item.biao_zhi_uuid_1,item.biao_zhi_uuid_2,item.biao_zhi_uuid_3,item.biao_zhi_uuid_4)
+                  let allResult = []
+                  allResult.push(this.handleLocationInfo(item.shou_yang_wei_zhi_yi,'否',localInfo,locationIds,item,item.biao_zhi_uuid_1,currentTime))
+                  if(item.shou_yang_wei_zhi_er != undefined){
+                      allResult.push(this.handleLocationInfo(item.shou_yang_wei_zhi_er,'否',localInfo,locationIds,item,item.biao_zhi_uuid_2,currentTime))
                   }
-                  // 更新委托单 检测开始时间   问吴懿是否需要 不需要
-                  // repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"jian_ce_kai_shi_s":"' + this_.dateFormat() + '"}}')
-  
-                  //更新展示表
-                  if(lhwtzsbID.length > 0){
-                    repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"任务分配进行中"}}')
+                  if(item.shou_yang_wei_zhi_san != undefined){
+                      allResult.push(this.handleLocationInfo(item.shou_yang_wei_zhi_san,'否',localInfo,locationIds,item,item.biao_zhi_uuid_3,currentTime))
                   }
-                  
-  
-  
-  
+                  if(item.shou_yang_wei_zhi_si != undefined){
+                      allResult.push(this.handleLocationInfo(item.shou_yang_wei_zhi_si,'否',localInfo,locationIds,item,item.biao_zhi_uuid_4,currentTime))
+                  }
+                  allResult.push(this.handleLocationInfo(item.liu_yang_wei_zhi_yi,'是',localInfo,locationIds,item,item.biao_zhi_uuid_1,currentTime))
+                  if(item.liu_yang_wei_zhi_er != undefined){
+                      allResult.push(this.handleLocationInfo(item.liu_yang_wei_zhi_er,'是',localInfo,locationIds,item,item.biao_zhi_uuid_2,currentTime))
+                  }
+                  if(item.liu_yang_wei_zhi_san != undefined){
+                      allResult.push(this.handleLocationInfo(item.liu_yang_wei_zhi_san,'是',localInfo,locationIds,item,item.biao_zhi_uuid_3,currentTime))
+                  }
+                  if(item.liu_yang_wei_zhi_si != undefined){
+                      allResult.push(this.handleLocationInfo(item.liu_yang_wei_zhi_si,'是',localInfo,locationIds,item,item.biao_zhi_uuid_4,currentTime))
+                  }
+                  allResult.forEach(item=>{
+                      item.name === 'emptyLocation' ? this.emptyLocal.push(item.value) : this.fullLocal.push(item.value)
+                  })
+              })
+              let allUUIDStr = allUUID.filter(i => i).join(',')
+              // console.log(allUUIDStr)
+              // 更新样品位置list
+              // console.log('emptyLocal:',this.emptyLocal)
+              let allParams = {
+                  tableName: 't_ypcfwz',
+                  updList: this.emptyLocal
+              }
+              repostCurd('updatesByWhere', JSON.stringify(allParams))
+              // 插入样品位置list
+              // console.log('fullLocal:',this.fullLocal)
+              repostCurd('add', '{"tableName":"t_ypcfwz","paramWhere":' + JSON.stringify(this.fullLocal) + '}').then(res=>{
+                  // 再次查询位置表,对比当前样品列表 替换初始值为占用的样品位置id
+                  let findLocationAgain = `select id_,shi_fou_liu_yang_,biao_zhi_uuid_ from t_ypcfwz where find_in_set(biao_zhi_uuid_,'${allUUIDStr}')`
+                  // console.log(findLocationAgain)
+                  repostCurd('sql',findLocationAgain).then(res=>{
+                      let  data  = res.variables.data
+                      let uuidArgs = ['biao_zhi_uuid_1','biao_zhi_uuid_2','biao_zhi_uuid_3','biao_zhi_uuid_4']
+                      let shouYangArgs = ['shou_yang_wei_zhi_yi','shou_yang_wei_zhi_er','shou_yang_wei_zhi_san','shou_yang_wei_zhi_si']
+                      let liuYangArgs = ['liu_yang_wei_zhi_yi','liu_yang_wei_zhi_er','liu_yang_wei_zhi_san','liu_yang_wei_zhi_si']
+                      data.forEach(item=>{
+                              uuidArgs.forEach((uuid,index)=>{
+                                  let ypIndex = ypInfoList.findIndex(i => i[uuid] === item.biao_zhi_uuid_)
+                                  if(ypIndex != -1){
+                                      item.shi_fou_liu_yang_ === '否' ?  
+                                      ypInfoList[ypIndex][shouYangArgs[index]] = item.id_ : 
+                                      ypInfoList[ypIndex][liuYangArgs[index]] = item.id_
+                                  }
+                              })
+                      })
   
+                      repostCurd('updates', '{"tableName":"t_lhypb","paramWhere":[' + lhypIdNewList + '],"paramCond":{"jie_yang_zhuang_t":"已接收"}}')
   
-                 /*
-                  3、【任务分配2022/11/23 取消 直接 批量开检测子流程】【2022/11/30 取消】
-                   3-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成
-                   3-2、根据每个样品对应的检测项目,开启一个或多个任务 / 遍历样品表开检测子流程,一个样品可能对应多个检测
-                   3-3、委托表找zhan_shi_biao_id_ 修改  t_lhwtzsb "zhuang_tai_"为"待环境监控"
-                   
-                   repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}')
-                   */
+                      /* 2、封装样品登记表对象,插入样品登记表 顺便封装任务分配表  */
+                      let ypdjb = []
+                      let rws = []
+                      result.forEach((item,index)=>{
+                          // 2-1:统计每个样品有多少类型[数量]
+                          let lxList = []
+                          let ypggList = []
+                          let liuYangList = []
+                          lxList.push(item.yang_pin_lei_xing,item.yang_pin_lei_er_,item.yang_pin_lei_san_,item.yang_pin_lei_si_)
+                          ypggList.push(item.yang_pin_gui_ge_,item.yang_pin_gui_ge_e,item.yang_pin_gui_ge_s,item.yang_pin_gui_si_)
+                          liuYangList.push(ypInfoList[index].liu_yang_shu_lian_yi,ypInfoList[index].liu_yang_shu_lian_er,ypInfoList[index].liu_yang_shu_lian_san,ypInfoList[index].liu_yang_shu_lian_si)
+                          let yplxz = lxList.filter(i => i).join(',')
+                          let ypggStr = ypggList.filter(i => i).join(',')
+                          let liuyangStr = liuYangList.filter(i => i).join(',')
+                          //   let count = lxList.filter(i => i).join(',').match(/,/g).length + 1
+                          let size = lxList.filter(i => i).join(',').match(/,/g)
+                          let count = 1
+                          size == null ? count = 1: count = size + 1
+                          for(let c = 0; c < count; c++){
+                              let xmmc = []
+                              xmmc.push(item.chang_gui_xiang_m,item.tao_can_ming_chen)
+                              let xiangMuZh = xmmc.filter(i => i).join(',')
   
-            // console.log('dwhere:',dWhere)
-            // console.log('cfwzIdList:',cfwzIdList)
-            /* 2、更新货架位置信息(位置状态、样品编号、入库时间)如果是重复位置,则新增一条位置记录,并增加对应UUID  */
-            for (let num in dWhere) {
-              let firstIfEmpty = true
-              let secondIfEmpty = true
-                for(let index = 0; index<cfwzIdList[num].length; index++){
-                  let sql = "select * from t_ypcfwz where id_ = '" + cfwzIdList[num][index] + "'"
-                  let isLiuYang = index == 1 ? "是" : "否"
-                  // console.log(sql)
-                    repostCurd('sql', sql).then(response => {
-                      let resArr = response.variables.data
-                      // console.log(resArr)
-                      if (resArr.length == 1) {
-                        if (resArr[0].wei_zhi_zhuang_ta == "空余") {
-                          if(index == 0){
-                            firstIfEmpty = false
-                          }else{
-                            secondIfEmpty = false
-                          }
-                          let content = {
-                            id_ : cfwzIdList[num][index]
-                          }
-                          let params = {
-                            wei_zhi_zhuang_ta : "占用",
-                            ru_ku_shi_jian_ : this_.dateFormat(),
-                            yang_pin_bian_hao : ypbh[num],
-                            yang_pin_ming_che : lhypmcList[num],
-                            shi_fou_liu_yang_ : isLiuYang
+                              let yblx = c==0? item.yang_pin_lei_xing : c==1? item.yang_pin_lei_er_ : c==2? item.yang_pin_lei_san_ : c==3? item.yang_pin_lei_si_ :''
+                              let ystj = c==0? item.yang_ben_yun_shu_ : c==1? item.yang_pin_yun_shu_ : c==2? item.yang_pin_yun_san : c==3? item.yang_pin_yun_si_ :''
+                              let ypsl = c==0? item.shu_liang_ : c==1? item.shu_liang_er_ : c==2? item.shu_liang_san_ : c==3? item.shu_liang_si_ :''
+                              let ybgg = c==0? item.yang_pin_gui_ge_ : c==1? item.yang_pin_gui_ge_e : c==2? item.yang_pin_gui_ge_s : c==3? item.yang_pin_gui_si_ :''
+                              let sywz = c==0? ypInfoList[index].shou_yang_wei_zhi_yi : c==1? ypInfoList[index].shou_yang_wei_zhi_er : c==2? ypInfoList[index].shou_yang_wei_zhi_san : c==3? ypInfoList[index].shou_yang_wei_zhi_si :''
+                              let lycf = c==0? ypInfoList[index].liu_yang_wei_zhi_yi : c==1? ypInfoList[index].liu_yang_wei_zhi_er : c==2? ypInfoList[index].liu_yang_wei_zhi_san : c==3? ypInfoList[index].liu_yang_wei_zhi_si :''
+                              let lysl =  c==0? ypInfoList[index].liu_yang_shu_lian_yi : c==1? ypInfoList[index].liu_yang_shu_lian_er : c==2? ypInfoList[index].liu_yang_shu_lian_san : c==3? ypInfoList[index].liu_yang_shu_lian_si :''  
+                              let currentUUID = c==0? ypInfoList[index].biao_zhi_uuid_1 : c==1? ypInfoList[index].biao_zhi_uuid_2 : c==2? ypInfoList[index].biao_zhi_uuid_3 : c==3? ypInfoList[index].biao_zhi_uuid_4 :''
+                              let obj = {
+                                  wei_tuo_dan_hao_ : item.wei_tuo_bian_hao_,
+                                  wei_tuo_dan_wei_ : item.wtdh,
+                                  lian_xi_ren_     : item.wei_tuo_fang_lian,
+                                  lian_xi_dian_hua_: item.wei_tuo_lian,
+                                  yang_ben_ming_che: item.yang_pin_ming_che,
+                                  yang_ben_bian_hao: item.yang_pin_bian_hao,
+                                  pi_hao_bian_hao_ : item.song_jian_pi_hao_,
+                                  song_jian_dan_wei: item.song_jian_dan_wei,
+                                  xing_ming_       : ypInfoList[index].xing_ming_,
+                                  xing_bie_        : ypInfoList[index].xing_bie_,
+                                  nian_ling_       : ypInfoList[index].nian_ling_,
+                                  yang_ben_zhuang_t: item.yang_pin_zhuang_t,
+                                  shou_yang_ri_qi_ : currentTime,
+                                  bei_zhu_         : ypInfoList[index].bei_zhu_,
+                                  yang_ben_lei_xing: yblx,
+                                  yun_shu_tiao_jian: ystj,
+                                  yang_pin_shu_lian: ypsl,
+                                  yang_ben_gui_ge_s: ybgg,
+                                  yan_shou_jie_guo_: ypInfoList[index].yan_shou_jie_guo_,
+                                  cun_fang_wei_zhi_: sywz,
+                                  liu_zhuan_zhuang_: '待检',
+                                  shi_fou_liu_yang_: ypInfoList[index].shi_fou_liu_yang_,
+                                  liu_yang_ri_qi_  : ypInfoList[index].liu_yang_ri_qi_,
+                                  liu_yang_cun_fang: lycf,
+                                  liu_yang_shu_lian: lysl,
+                                  liu_yang_qi_xian : ypInfoList[index].liu_yang_qi_xian,
+                                  xiao_hui_ri_qi_  : ypInfoList[index].xiao_hui_ri_qi_,
+                                  fan_yang_ri_qi_  : ypInfoList[index].fan_yang_ri_qi_,
+                                  fan_yang_jyr     : ypInfoList[index].fan_yang_jyr,
+                                  biao_zhi_uuid_   : currentUUID,
+                                  song_yang_yao_qiu: ypInfoList[index].song_yang_yao_qiu,
+                                  jian_ce_xiang_mu_: xiangMuZh
+                              }
+                              ypdjb.push(obj)
                           }
-                          let o = {
-                            tableName:'t_ypcfwz',
-                            paramWhere:content,
-                            paramCond : params
+                          // 2-2:封装任务分配表
+                          let rw = {
+                              yang_pin_ming_che : item.yang_pin_ming_che,
+                              yang_pin_bian_hao : item.yang_pin_bian_hao,
+                              wei_tuo_lei_xing_ : item.wei_tuo_lei_xing_,
+                              yang_pin_lei_xing : yplxz,
+                              yang_pin_gui_ge_  : ypggStr,
+                              wei_tuo_id_       : item.wtID,
+                              he_tong_id_       : item.he_tong_id_,
+                              zhuang_tai_       : '待任务分配',
+                              wan_cheng_shi_jia : item.song_jian_shi_jia,
+                              bao_gao_lei_xing_ : item.bao_gao_lei_xing_,
+                              xin_xiang_mu_ming : item.xiang_mu_ming_che,
+                              zhan_shi_biao_id_ : item.zhan_shi_biao_id_,
+                              fen_zhuang_liu_ya : liuyangStr, 
+                              shi_fou_jia_ji_   : item.chu_ju_bao_gao_ya,             // 是否加急【2023/2/23王嘎嘎提出】
+                              yang_pin_shu_lian : ypInfoList[index].jie_yang_shu_lian // 样品确认总数【2023/3/7王嘎嘎提出】
                           }
-                          repostCurd('update',JSON.stringify(o)).then(res=>{
-                            console.log("空余位置修改")
-                          })
-                        } else if (resArr[0].wei_zhi_zhuang_ta == "占用") {
-                          // 新增一条新的位置记录,使用旧的位置记录 修改它的样品编号,入库时间,标识UUID
-                          let cfNewList = []
-                          let cfNew = {}
-                          cfNew["fang_jian_lei_xin"] = resArr[0].fang_jian_lei_xin
-                          cfNew["wei_zhi_"] = resArr[0].wei_zhi_
-                          cfNew["qu_yu_"] = resArr[0].qu_yu_
-                          cfNew["huo_jia_lei_xing_"] = resArr[0].huo_jia_lei_xing_
-                          cfNew["huo_jia_hao_"] = resArr[0].huo_jia_hao_
-                          cfNew["ceng_hao_"] = resArr[0].ceng_hao_
-                          cfNew["shui_ping_fen_qu_"] = resArr[0].shui_ping_fen_qu_
-                          cfNew["wei_zhi_bian_hao_"] = resArr[0].wei_zhi_bian_hao_
-                          cfNew["wei_zhi_zhuang_ta"] = resArr[0].wei_zhi_zhuang_ta
-                          cfNew["cun_chu_tiao_jian"] = resArr[0].cun_chu_tiao_jian
-                          cfNew["yang_pin_bian_hao"] = ypbh[num]
-                          cfNew["shi_fou_guo_shen_"] = '启用'
-                          // cfNew["yang_pin_bian_hao"] = lhypIdList[num]
-                          cfNew["yang_pin_ming_che"] = lhypmcList[num]
-                          cfNew["ru_ku_shi_jian_"] = this_.dateFormat()
-                          cfNew["shi_fou_liu_yang_"] = isLiuYang
-                          cfNew["biao_zhi_uuid_"] = uuidList[num]
-                          cfNewList.push(cfNew)
-                          let uuid = cfNew["biao_zhi_uuid_"];
-                          // console.log('货位:',cfNewList)
+                          rws.push(rw)
   
+                          
+                          lhwtzsbID.push('{"shen_qing_id_":"' + item.zhan_shi_biao_id_ + '"}')
+                          lhwtbID.push('{"id_":"' + item.wtID + '"}')
   
-                          repostCurd('add', '{"tableName":"t_ypcfwz","paramWhere":' + JSON.stringify(cfNewList) + '}').then(res => {
-                            let selectsql = "select id_ from t_ypcfwz where biao_zhi_uuid_='" + uuid + "'";
-                            repostCurd('sql', selectsql).then(res => {
-                              let data = res.variables.data;
-                              let suchAs = '{"biao_zhi_uuid_":"' + uuid + '"}'
-                              // console.log(data.length,changeWeiZhi,changesyWeiZhi,firstIfEmpty,secondIfEmpty)
-                              if(data.length == 1 && changeWeiZhi && firstIfEmpty){
-                                repostCurd('update', '{"tableName":"t_lhypdjb","paramWhere":'+suchAs+',"paramCond":{"cun_fang_wei_zhi_":"'+data[0].id_+'"}}').then(res=>{
-                                  console.log('One 存放位置',res)
-                                })
-                              }else if(data.length == 1 && changesyWeiZhi && secondIfEmpty){
-                                repostCurd('update', '{"tableName":"t_lhypdjb","paramWhere":'+suchAs+',"paramCond":{"liu_yang_cun_fang":"'+data[0].id_+'"}}').then(res=>{
-                                  console.log('One 留样位置',res)
-                                })
-                              }else if(data.length == 2 && changeWeiZhi && changesyWeiZhi){
-                                let whereL = []
-                                whereL.push(suchAs)
-                                repostCurd('updates', '{"tableName":"t_lhypdjb","paramWhere":['+whereL+'],"paramCond":{"cun_fang_wei_zhi_":"'+data[0].id_+'","liu_yang_cun_fang":"'+data[1].id_+'"}}').then(res=>{
-                                  console.log('Two 收样留样位置',res)
-                                })
-                              }
-                            })
-                          })
-                        }
-                      }
-                    })
-                }
-            }
-             
-            /*
-                 let ffbSql = "select * from t_lhfbb where FIND_IN_SET( parent_id_,'"+ fbbIdStr +"')"
-                 repostCurd('sql',ffbSql).then(response => {
-                   let ffbList = response.variables.data
-                   if(wtdAndYpb.length>0){
-                     let jcxmArr = []
-                     wtdAndYpb.forEach(item=>{
-                       item.jian_ce_xiang_mu_.split(',').reverse().forEach(temp=>{
-                         jcxmArr.push(temp)
-                       })
-                     })
-                     let allProject = []
-                     let finalJCTask = []
-                     let processDefKeyParam = []
-                     let processFormKeyParam = []
-                     let sql111 = `select id_, defkey_, formkey_ from t_mjjcnlfw where defkey_ != '' and find_in_set(id_, '${jcxmArr.join(',')}')`
-                     repostCurd('sql', sql111).then(res => {
-                          allProject = res.variables.data
-                          wtdAndYpb.forEach(item => {
-                            let yblxArr = []
-                            let yblxStr = ''
-                            yblxArr.push(item.yang_pin_lei_xing, item.yang_pin_lei_er_, item.yang_pin_lei_san_, item.yang_pin_lei_si_)
-                            yblxStr = yblxArr.filter(s => s).join(',')
-                            let t = item.jian_ce_xiang_mu_.split(',')
-                            let ypList = ypInfoList.find(k => k.id_ === item.id_)
-                            t.forEach(i => {
-                               let fbbItem = ffbList.find(j => j.jian_ce_xiang_mu_ === i)
-                               let jcxmItem = allProject.find(k => k.id_ === i)
-                               let obj = {
-                                   jian_ce_yuan_: fbbItem.jian_ce_yuan_,
-                                   fu_he_yuan_  : fbbItem.fu_he_yuan_,
-                                   yang_pin_ming_che: item.yang_pin_ming_che,
-                                   yang_pin_bian_hao: item.yang_pin_bian_hao,
-                                   jian_ce_xiang_mu_:jcxmItem.id_,
-                                   wei_tuo_id_:item.wtID,
-                                   he_tong_id_:item.he_tong_id_,
-                                   bao_gao_bian_zhi_:ypList.bao_gao_bian_zhi_,
-                                   bao_gao_fu_he_yua:ypList.bao_gao_shen_he_y,
-                                   wei_tuo_lei_xing_:item.wei_tuo_lei_xing_,
-                                   yang_pin_lei_xing: yblxStr,
-                                   xin_xiang_mu_ming:item.xiang_mu_ming_che,
-                                   wan_cheng_shi_jia:item.song_jian_shi_jia,
-                                   zhuang_tai_:'待环境监控',
-                                   zhan_shi_biao_id_:item.zhan_shi_biao_id_
-                               }
-                               finalJCTask.push(obj)
-                               processDefKeyParam.push(jcxmItem.defkey_)
-                               processFormKeyParam.push(jcxmItem.formkey_)
-                            })
-                          })
-                         finalJCTask.forEach((item,index )=>{
-                           let obj = {
-                             tableName:"t_lhjczb",
-                             paramWhere:[item],
-                             defKey:processDefKeyParam[index],
-                             formKey:processFormKeyParam[index]
-                           }
-                         repostCurd('add', JSON.stringify(obj))
-                         })
-                     })
-                     }
-                 })
-                //更新展示表
-                if(lhwtzsbID.length > 0){
-                  repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"检测进行中"}}')
-                }
-                */
-            })
+                      })
+                      // console.log('样品登记表...',ypdjb)
+                      repostCurd('add', '{"tableName":"t_lhypdjb","paramWhere":' + JSON.stringify(ypdjb) + '}')
+                      
+                      
+                      /* 3、更新样品表  */
+                      // console.log('3、更新样品表',lhypIdNewList)
+                      repostCurd('updates', '{"tableName":"t_lhypb","paramWhere":[' + lhypIdNewList + '],"paramCond":{"jie_yang_zhuang_t":"已接收"}}')
+                      
+                      
   
+                      /* 4、任务分配 
+                          4-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成
+                          4-2、根据每个样品一个任务分配流程 遍历样品表开任务分配流程
+                          4-3、委托表找zhan_shi_biao_id_ 修改  t_lhwtzsb "zhuang_tai_"为"任务分配进行中"
+                      */
+                      // console.log('4、更改委托表的 委托状态',lhwtbID)
+                      repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}')
+                      // console.log("4、任务分配",rws)
+                      repostCurd('add', '{"tableName":"t_lhrwfpb","paramWhere":'+JSON.stringify(rws)+',"defKey":"Process_04o0csc","formKey":"lhrwfp"}')
   
+                      /* 5、更新展示表  */
+                      if(lhwtzsbID.length > 0){
+                          // console.log('5、更新展示表',lhwtzsbID)
+                          repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"任务分配进行中"}}')
+                      }
+                  })
+              })
+           })
+           // todo 让列表刷新
             this.$emit('callback', true)
             this.visable = false
             this.$message({
@@ -555,7 +385,6 @@ export default {
             this.closeDialog();
           }).catch(_ => {});
         }
-  
       },
     /* 去除指定行数据 使用过滤器filter过滤指定行号数据 */
     deleteData(val){
@@ -588,13 +417,64 @@ export default {
     	  return repostCurd('update',JSON.stringify(cont))
     	},
 
-    /* zzj add */
-     dateFormat() { // 获取当前时间
-        var date=new Date();
-        var year=date.getFullYear();
-        var month= date.getMonth()+1<10 ? "0"+(date.getMonth()+1) : date.getMonth()+1;
-        var day=date.getDate()<10 ? "0"+date.getDate() : date.getDate();
-        return year+"-"+month+"-"+day;
+    // 根据旧位置数据生成新位置数据
+    generateNewLocation(oldLocation,sampleInfo){
+        let temp = {
+            fang_jian_lei_xin : oldLocation.fang_jian_lei_xin,
+            wei_zhi_          : oldLocation.wei_zhi_,
+            qu_yu_            : oldLocation.qu_yu_,
+            huo_jia_lei_xing_ : oldLocation.huo_jia_lei_xing_,
+            huo_jia_hao_      : oldLocation.huo_jia_hao_,
+            ceng_hao_         : oldLocation.ceng_hao_,
+            shui_ping_fen_qu_ : oldLocation.shui_ping_fen_qu_,
+            wei_zhi_bian_hao_ : oldLocation.wei_zhi_bian_hao_,
+            wei_zhi_zhuang_ta : oldLocation.wei_zhi_zhuang_ta,
+            cun_chu_tiao_jian : oldLocation.cun_chu_tiao_jian,
+            shi_fou_guo_shen_ : '启用',
+            yang_pin_bian_hao : sampleInfo.yang_pin_bian_hao,
+            yang_pin_ming_che : sampleInfo.yang_pin_ming_che,
+            ru_ku_shi_jian_   : sampleInfo.ru_ku_shi_jian_,
+            shi_fou_liu_yang_ : sampleInfo.shi_fou_liu_yang_,
+            biao_zhi_uuid_    : sampleInfo.biao_zhi_uuid_
+        }
+        return temp 
+    },
+    handleLocationInfo(currentLocation,isLiuYang,localInfo,locationIds,item,UUID,currentTime){
+        !locationIds.has(currentLocation) ? locationIds.add(currentLocation) : localInfo.find(i => i.id_ === currentLocation).wei_zhi_zhuang_ta ='占用'
+        console.log(localInfo.find(i => i.id_ === currentLocation),currentLocation)
+        if(localInfo.find(i => i.id_ === currentLocation).wei_zhi_zhuang_ta ==='空余'){
+            let obj = {
+                where: {
+                    id_ : currentLocation
+                },
+                param: {
+                    wei_zhi_zhuang_ta : "占用",
+                    ru_ku_shi_jian_ : currentTime,
+                    yang_pin_bian_hao : item.yang_pin_bian_hao,
+                    yang_pin_ming_che : item.yang_pin_ming_che,
+                    shi_fou_liu_yang_ : isLiuYang
+                }
+            }
+            let result = {
+                name : 'emptyLocation',
+                value: obj
+            }
+            return result
+        }else{ // 新增一条位置信息(修改它的样品编号,样品名称,入库时间,标识UUID)
+            let sampleInfo = {
+                yang_pin_bian_hao : item.yang_pin_bian_hao,
+                yang_pin_ming_che : item.yang_pin_ming_che,
+                ru_ku_shi_jian_   : currentTime,
+                biao_zhi_uuid_    : UUID,
+                shi_fou_liu_yang_ : isLiuYang
+            }
+            let newLocation = this.generateNewLocation(localInfo.find(i => i.id_ === currentLocation),sampleInfo)
+            let result = {
+                name : 'fullLocation',
+                value: newLocation
+            }
+            return result
+        }
     },
 
 

+ 1 - 1
src/views/system/login/page.vue

@@ -79,7 +79,7 @@ export default {
     margin-bottom: 20px;
     box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
     padding: 30px;
-    height: 320px;
+    height: 300px;
     width: 300px;
     background-repeat: no-repeat;
     border-radius: 5%;

+ 6 - 0
src/views/system/login/user-login.vue

@@ -425,3 +425,9 @@
         }
     }
 </script>
+
+<style scoped>
+    .el-form-item {
+        margin-bottom: 6px !important;
+    }
+</style>