NNowhZzU
2024-01-05 cb611a0c2ba672e23aedb6f95635deb4f922b79b
新增采购订单详情页,部分消息提示,修改采购订单功能部分
1个文件已添加
7个文件已修改
2314 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Create.vue 471 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Details.vue 453 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Payment.vue 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/PurchaseOrder.vue 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Return.vue 400 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Select.vue 377 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Storage.vue 381 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/stockReport/StockReport.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Create.vue
@@ -1,81 +1,103 @@
<template>
  <el-header height="auto">
    <el-form label-width="100px" :inline="true" :model="formInline" class="demo-form-inline">
      <el-row :gutter="10">
        <el-col :span="6">
          <el-form-item label="采购类型" class="item-style">
            <el-select v-model="form.buyType" class="m-2" placeholder="选择采购类型" clearable>
              <el-option
                  v-for="item in CGTypeOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="采购部门" class="item-style">
            <el-select v-model="cgBuMen" class="m-2" placeholder="选择采购部门" clearable>
              <el-option
                  v-for="item in CGBuMenOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="供应商" class="item-style">
            <el-cascader
                placeholder="选择供应商"
                :options="buyerOptions"
                filterable
                clearable
                empty-text="empty-text"
                :v-model="form.supplier"
            >
            </el-cascader>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="采购员" class="item-style">
            <el-select v-model="form.buyer" class="m-2" placeholder="选择采购部门" clearable>
              <el-option
                  v-for="item in BuyerOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
              />
            </el-select>
          </el-form-item>
        </el-col>
    <el-descriptions
        class="margin-top"
        title=""
        :column="4"
        :size="'default'"
        border
        :rules="rules"
        :model="ruleForm"
    >
      </el-row>
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy" prop="name">
        <template #label>
          <span style="color:red">*</span>
          采购类型
        </template>
<!--        <el-select v-model="form.buyType" class="m-2" placeholder="选择采购类型" clearable>-->
        <el-select v-model="ruleForm.name" class="m-2" placeholder="选择采购类型" clearable>
          <el-option
              v-for="item in CGTypeOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
          />
        </el-select>
      </el-descriptions-item >
      <el-row :gutter="10">
        <el-col :span="6">
          <el-form-item label="采购组织" class="item-style">
            <el-input v-model="form.buyItem" placeholder="采购组织" clearable></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="制表日期" class="item-style">
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy">
        <template #label>
          <span style="color:red">*</span>
          采购组织
        </template>
        <el-input v-model="ruleForm.name" placeholder="采购组织" clearable prop="name"></el-input>
      </el-descriptions-item>
            <el-date-picker
                v-model="form.date"
                type="date"
                placeholder="选择制表日期"
                style="width: 100%"
            />
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy">
        <template #label>
          <span style="color:red">*</span>
          供应商
        </template>
        <el-cascader
            placeholder="选择供应商"
            :options="buyerOptions"
            filterable
            clearable
            empty-text="empty-text"
            :v-model="form.supplier"
        >
        </el-cascader>
      </el-descriptions-item>
          </el-form-item>
        </el-col>
        <el-col :span="6"></el-col>
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy">
        <template #label>
          <span style="color:red">*</span>
          采购部门
        </template>
        <el-select v-model="cgBuMen" class="m-2" placeholder="选择采购部门" clearable>
          <el-option
              v-for="item in CGBuMenOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
          />
        </el-select>
      </el-descriptions-item>
      </el-row>
    </el-form>
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy">
        <template #label>
          <span style="color:red">*</span>
          采购员
        </template>
        <el-select v-model="form.buyer" class="m-2" placeholder="选择采购员" clearable>
          <el-option
              v-for="item in BuyerOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
          />
        </el-select>
      </el-descriptions-item>
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy"
      >
        <template #label>
          <span style="color:red">*</span>
          制表日期
        </template>
        <el-date-picker
            v-model="form.date"
            type="date"
            placeholder="选择制表日期"
        />
      </el-descriptions-item>
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy"></el-descriptions-item>
    </el-descriptions>
  </el-header>
@@ -91,7 +113,7 @@
        class="mytable-scrollbar"
        ref="xGrid"
        v-bind="gridOptions"
        v-on="gridEvents"
        @="gridEvents"
    >
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
@@ -115,7 +137,7 @@
      <template #num1_filter="{ column, $panel }">
        <div>
          <div v-for="(option, index) in column.filters" :key="index">
            <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/>
            <el-input v-model="option.data" @input="changeFilterEvent($event, option, $panel)" />
          </div>
        </div>
      </template>
@@ -125,8 +147,10 @@
</template>
<script setup>
<script lang="ts" setup>
import {ref, reactive} from 'vue'
import {useRouter} from "vue-router";
import {ElMessage, ElMessageBox} from "element-plus";
let router = useRouter()
@@ -163,7 +187,7 @@
    //{title: '操作', width: '8%', slots: {default: 'button_slot'}, fixed: "left"},
    {type: 'seq', fixed: "left", title: ' ', width: 50},
    {type: 'checkbox', fixed: "left", title: '', width: 50},
    {type: 'expand', title: '详情', fixed: "left", slots: {content: 'content'}, width: 50},
    //{type: 'expand', title: '详情', fixed: "left", slots: {content: 'content'}, width: 50},
    {
      field: 'cgdh',
      width: '10%',
@@ -203,7 +227,8 @@
      width: '8%',
      title: '高度', /*filters: [{data: ''}], slots: {filter: 'num1_filter'},*/
      editRender: {name: 'input', attrs: {placeholder: ''}},
      sortable: true
      sortable: true,
      type: 'number'
    },
    {
      field: 'h',
@@ -310,12 +335,12 @@
        'name': '入库',
        status: 'primary',
        'code': 'Storage'
      },
      }/*,
      {
        'name': '退货',
        status: 'primary',
        'code': 'Return'
      }/*,
      },
      {
        'name': '返回查询',
@@ -356,7 +381,8 @@
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
        case 'Add': {//新增
//新增
        case 'Add': {
          const record = {
            checked: false
          }
@@ -365,83 +391,57 @@
          })
          break
        }
        case 'Remove': {//移除
//移除
        case 'Remove': {
          if ($grid.getCheckboxRecords().length === 0) {
            openAlert({type: 'message', content: '请选择至少一条数据', status: 'warning'})
            //VXETable.modal.message( '请选择一条数据!')
            MessageShow('请选择至少一条数据','warning');
            return
          } else {
            const type = VXETable.modal.confirm('您移除了' + $grid.getCheckboxRecords().length + '条数据!');
            //openAlert({type:'alert', content: '成功入库'+$grid.getCheckboxRecords().length+'条数据!', status: 'success' })
            //VXETable.modal.message( '请选择一条数据!')
            return
            MessageConfirmShow('移除','是否确认移除选中的' + $grid.getCheckboxRecords().length + '条数据!');
          }
          break
        }
        case 'Save': {//保存
          if (form.buyItem === null || form.buyItem === '') {
            openAlert({type: 'message', content: '采购组织不可为空', status: 'warning'})
//保存
        case 'Save': {
          /*if (form.buyItem === null || form.buyItem === '') {
            MessageShow('采购组织不可为空','warning');
            return;
          }
          return
          if (buyerOptions.values() <= 0) {
          }
          const type = VXETable.modal.confirm('是否确定保存当前订单信息?');
          openAlert({type: 'message', content: $grid.rows.number + '', status: 'warning'})
          return
          break
        }
        case 'GoSelect': {
          router.push({path: '/main/purchaseOrder/SelectPurchaseOrder'})
          break
        }
        case 'Storage': {//入库
          if ($grid.getCheckboxRecords().length === 0) {
            openAlert({type: 'message', content: '请选择至少一条数据', status: 'warning'})
            //VXETable.modal.message( '请选择一条数据!')
            return
          } else {
            const type = VXETable.modal.confirm('您选择了' + $grid.getCheckboxRecords().length + '条数据!,是否确认入库?');
            //openAlert({type:'alert', content: '成功入库'+$grid.getCheckboxRecords().length+'条数据!', status: 'success' })
            //VXETable.modal.message( '请选择一条数据!')
            return
          }
          break
        }
        case 'Return': {//退库
          if ($grid.getCheckboxRecords().length === 0) {
            openAlert({type: 'message', content: '请选择至少一条数据', status: 'warning'})
            //VXETable.modal.message( '请选择一条数据!')
            return
          } else {
            /*            async ()=>{
              const type = await.VXETable.modal.confirm('您选择了'+$grid.getCheckboxRecords().length+'条数据!,是否确认退库?');
            }*/
            const type = VXETable.modal.confirm('您选择了' + $grid.getCheckboxRecords().length + '条数据!,是否确认退库?');
            /* if(VXETable.modal.confirm('您选择了'+$grid.getCheckboxRecords().length+'条数据!,是否确认退库?' )){
              //openAlert({type:'message', content: '成功退库'+$grid.getCheckboxRecords().length+'条数据!', status: 'success',lockView: false, mask: false })
            }*/
            /* if(type==='confirm'){
              openAlert({type:'message', content: '成功退库'+$grid.getCheckboxRecords().length+'条数据!', status: 'success' })
            }
*/
            //openAlert({type:'alert', content: '成功退库'+$grid.getCheckboxRecords().length+'条数据!', status: 'success' })
            //VXETable.modal.message( '请选择一条数据!')
          //选中数据
          /* const $table = this.$refs.xTable
           const selectRecords = $table.getCheckboxRecords()*/
//+$grid.rows.number
          if ($grid.getCheckboxRecords().length === 0) {
            MessageShow('请选择至少一条数据','warning');
            return
          } else {
            MessageConfirmShow('保存订单','是否确定保存当前订单信息');
          }
          break
        }
//入库
        case 'Storage': {
          if ($grid.getCheckboxRecords().length === 0) {
            MessageShow('请选择至少一条数据','warning');
            return
          } else {
            MessageConfirmShow('入库','您选择了' + $grid.getCheckboxRecords().length + '条数据!,是否确认入库?')
          }
          break
        }
//退库
        case 'Return': {
          if ($grid.getCheckboxRecords().length === 0) {
            MessageShow('请选择至少一条数据','warning');
            return
          } else {
          }
          break
        }
@@ -463,14 +463,88 @@
}
const openAlert = (options) => {
  if (options.type === 'message') {
    VXETable.modal.message(options)
  } else {
    VXETable.modal.alert(options)
  }
import type { FormInstance, FormRules } from 'element-plus'
interface RuleForm {
  name: string
  region: string
  count: string
  date1: string
  date2: string
  delivery: boolean
  type: string[]
  resource: string
  desc: string
}
const ruleFormRef = ref<FormInstance>()
const ruleForm = reactive<RuleForm>({
  name: '',
  region: '',
  count: '',
  date1: '',
  date2: '',
  delivery: false,
  type: [],
  resource: '',
  desc: '',
})
const rules = reactive<FormRules<RuleForm>>({
  name: [
    { required: true, message: 'Please input Activity name', trigger: 'blur' },
    { min: 3, max: 5, message: 'Length should be 3 to 5', trigger: 'blur' },
  ],
  region: [
    {
      required: true,
      message: 'Please select Activity zone',
      trigger: 'change',
    },
  ],
  count: [
    {
      required: true,
      message: 'Please select Activity count',
      trigger: 'change',
    },
  ],
  date1: [
    {
      type: 'date',
      required: true,
      message: 'Please pick a date',
      trigger: 'change',
    },
  ],
  date2: [
    {
      type: 'date',
      required: true,
      message: 'Please pick a time',
      trigger: 'change',
    },
  ],
  type: [
    {
      type: 'array',
      required: true,
      message: 'Please select at least one activity type',
      trigger: 'change',
    },
  ],
  resource: [
    {
      required: true,
      message: 'Please select activity resource',
      trigger: 'change',
    },
  ],
  desc: [
    { required: true, message: 'Please input activity form', trigger: 'blur' },
  ],
})
const form = reactive({
@@ -487,10 +561,6 @@
  buyType: ''
})
const onSubmit = () => {
  console.log('submit!')
}
//供应商
const buyerOptions = [
@@ -573,23 +643,82 @@
]
import dayjs from 'dayjs'
import {VXETable} from "vxe-table";
import {useRouter} from "vue-router";
//页面逻辑代码执行
function logicExecute(type){
  const $grid = xGrid.value
  switch (type) {
    case '入库':
      //入库逻辑代码TODO
      MessageShow('入库成功!', 'success');
      break;
    case '退货':
      //退货逻辑代码TODO
      MessageShow('退货成功!', 'success');
      break;
    case '保存订单':
      //保存订单逻辑代码TODO
      const submitForm = async (formEl: FormInstance | undefined) => {
        if (!formEl) return
        await formEl.validate((valid, fields) => {
          if (valid) {
            console.log('submit!')
          } else {
            console.log('error submit!', fields)
          }
        })
      }
      MessageShow('订单保存成功!', 'success');
      break;
    case '移除':
      $grid.removeCheckboxRow();
      break;
    default:
      MessageShow('未知操作!', 'error');
      break;
  }
  return true;
}
//提示信息
const MessageShow = (content, type ) => {
  ElMessage({
    message: content,
    type: type,
    showClose: true,
  })
}
//操作确认类信息:操作类型,提示内容,提示标头,提示类型
const MessageConfirmShow = (czType, content, title='操作确认提示', type='warning') => {
  ElMessageBox.confirm(
      content,
      title,
      {
        cancelButtonText: '取消',
        confirmButtonText: '确定',
        type: type,
        center: true,
      }
  )
      //点击了确定
      .then(() => {
        return logicExecute(czType);
      })
      //点击了取消
      .catch(() => {
        return false;
      })
}
</script>
<style scoped>
.custom-header {
  .el-checkbox {
    display: flex;
    height: unset;
  }
}
.item-style {
  width: 300px;
:deep(.el-descriptions__table .label-diy) {
  text-align: center;
  width: 100px;
  /*font-size: large;*/
}
</style>
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Details.vue
New file
@@ -0,0 +1,453 @@
<template>
  <el-header height="auto">
    <el-descriptions
        class="margin-top"
        title=""
        :column="4"
        :size="'default'"
        border
    >
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy">
        <template #label>
          操作单号
        </template>
        <el-input v-model="form.buyItem" placeholder="单号" disabled></el-input>
      </el-descriptions-item>
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy">
        <template #label>
          采购类型
        </template>
        <el-input v-model="form.buyItem" placeholder="采购类型" disabled></el-input>
      </el-descriptions-item>
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy">
        <template #label>
          采购部门
        </template>
        <el-input v-model="form.buyItem" placeholder="采购部门" disabled></el-input>
      </el-descriptions-item>
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy">
        <template #label>
          供应商
        </template>
        <el-input v-model="form.buyItem" placeholder="供应商" disabled></el-input>
      </el-descriptions-item>
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy">
        <template #label>
          采购员
        </template>
        <el-input v-model="form.buyItem" placeholder="采购员" disabled></el-input>
      </el-descriptions-item>
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy">
        <template #label>
          采购组织
        </template>
        <el-input v-model="form.buyItem" placeholder="采购组织" disabled></el-input>
      </el-descriptions-item>
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy">
        <template #label>
          制表日期
        </template>
        <el-date-picker
            v-model="form.date"
            type="date"
            placeholder="选择制表日期"
        />
      </el-descriptions-item>
      <el-descriptions-item label-class-name="label-diy" class-name="content-diy"></el-descriptions-item>
    </el-descriptions>
  </el-header>
  <el-main style="padding-top: 5px;height:100%">
    <vxe-grid
        max-height="500"
        @filter-change="filterChanged"
        ref="xGrid"
        v-bind="gridOptions"
        v-on="gridEvents"
    >
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
      <!--      下拉显示所有信息插槽-->
      <template #content="{ row}">
        <ul class="expand-wrapper">
          <li v-for="(item,key,index) in row">
            <span style="font-weight: bold">{{ key + ':  ' }}</span>
            <span>{{ item }}</span>
          </li>
        </ul>
      </template>
    </vxe-grid>
  </el-main>
</template>
<script setup>
import {ref, reactive} from 'vue'
let router = useRouter()
import {useRouter} from "vue-router";
import { ElMessage, ElMessageBox} from "element-plus";
const value = ref('')
//组件接收参数
const gridOptions = reactive({
  border: "full",//表格加边框
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe: true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮
  id: 'CustomerList',
  showFooter: true,//显示脚
  printConfig: {},
  importConfig: {},
  exportConfig: {},
  //开启虚拟滚动
  scrollY: {enabled: true},
  showOverflow: true,
  columnConfig: {
    resizable: true,
    useKey: true
  },
  //筛选配置项
  filterConfig: {
    remote: true
  },
  customConfig: {
    storage: true
  },
  editConfig: {
    trigger: 'click',
    mode: 'row',
    showStatus: true
  },
  //表头参数、列名
  columns: [
    {type: 'seq', fixed: "left", title: ' ', width: 50},
    {type: 'checkbox', fixed: "left", title: '', width: 50},
    {
      field: 'cgdh',
      width: '10%',
      title: '物料编码',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'cgzt',
      width: '10%',
      title: '物料名称',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'gys',
      width: '10%',
      title: '产地',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'w',
      width: '8%',
      title: '宽度',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'g',
      width: '8%',
      title: '高度',
      filters: [{data: ''}],
      sortable: true,
    },
    {
      field: 'h',
      width: '8%',
      title: '厚度',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'xh',
      width: '8%',
      title: '型号',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'dw',
      width: '8%',
      title: '单位',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'sl',
      width: '8%',
      title: '数量',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'czsl',
      width: '8%',
      title: '操作数量',
      type: 'number',
      editRender: {name: 'input', type: 'number', attrs: {placeholder: ''}}
    },
    {
      field: 'sl',
      width: '12%',
      title: '箱数',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'je',
      width: '8%',
      title: '单片面积',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'je',
      width: '12%',
      title: '单价',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'sl',
      width: '8%',
      title: '总面积',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'yl',
      width: '10%',
      title: '总金额',
      filters: [{data: ''}],
      sortable: true
    },
    {
      field: 'yl',
      width: '10%',
      title: '备注',
      filters: [{data: ''}],
      sortable: true
    }
  ],
  //表头按钮
  toolbarConfig: {
    buttons: [
      {type: 'text'},
      {
        'name': '保存订单',
        status: 'primary',
        'code': 'Save'
      }, {
        'name': '入库',
        status: 'primary',
        'code': 'Storage'
      },
      {
        'name': '退货',
        status: 'primary',
        'code': 'Return'
      },
      {
        'name': '取消',
        status: '',
        'code': 'Cancel'
      }],
    import: false,
    export: true,
    print: true,
    zoom: true,
    custom: true,
    tools: [],
  },
  //table body实际数据
  data: [{}, {}, {}],
  //脚合并
  mergeFooterItems: [
    {row: 0, col: 0, rowspan: 1, colspan: 3}
  ],
  //合并脚
  footerMethod({columns, data}) {//页脚函数
    return [
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
        }
        /* if (props.tableProp.footList.includes(column.field)) {
           return sumNum(data, column.field)
         }*/
        return ''
      })
    ]
  },
})
const xGrid = ref()
const gridEvents = {
  toolbarButtonClick({code}) {
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
//保存
        case 'Save': {
          MessageAlertShow('点击了保存订单','操作提示');
          //MessageShow('点击了保存订单!', 'error');
          break;
        }
//取消,返回查询页面
        case 'Cancel': {
          router.push({path: '/main/purchaseOrder/StoragePurchaseOrder'})
          break
        }
//入库
        case 'Storage': {
          if ($grid.getCheckboxRecords().length === 0) {
            MessageShow('请选择至少一条数据!', 'warning');
            return
          } else {
            MessageConfirmShow('入库', '是否确认对选中的' + $grid.getCheckboxRecords().length + '物料进行入库操作!');
          }
          break
        }
//退货
        case 'Return': {
          if ($grid.getCheckboxRecords().length === 0) {
            MessageShow('请选择至少一条数据!', 'warning');
            return
          } else {
            MessageConfirmShow('退货', '是否确认对选中的' + $grid.getCheckboxRecords().length + '物料进行退货操作!');
          }
          break
        }
      }
    }
  },
  toolbarToolClick({code}) {
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
        case 'myPrint': {
          $grid.print()
          break
        }
      }
    }
  },
}
//表单数据
const form = reactive({
  name: '',
  region: '',
  date: '',
  delivery: false,
  type: [],
  resource: '',
  desc: '',
  supplier: '',
  buyer: '',
  buyItem: '',
  buyType: ''
})
//页面逻辑代码执行
function logicExecute(type){
  const $grid = xGrid.value
  switch (type) {
    case '入库':
      //入库逻辑代码TODO
      MessageShow('入库成功!', 'success');
      break;
    case '退货':
      //退货逻辑代码TODO
      MessageShow('退货成功!', 'success');
      break;
    default:
      MessageShow('未知操作!', 'error');
      break;
  }
  return true;
}
//提示信息
//信息内容,显示方式,显示标题,类型
const MessageShow = (content,type='success') => {
    ElMessage({
      message: content,
      type: type,
      showClose: true,
    })
}
//操作确认类信息:操作类型,提示内容,提示标头,提示类型
const MessageConfirmShow = (czType, content, title='操作确认提示', type='warning') => {
  ElMessageBox.confirm(
      content,
      title,
      {
        cancelButtonText: '取消',
        confirmButtonText: '确定',
        type: type,
        center: true,
      }
  )
      //点击了确定
      .then(() => {
        return logicExecute(czType);
      })
      //点击了取消
      .catch(() => {
        return false;
      })
}
//弹窗信息
const MessageAlertShow=(content,title,type='info')=>{
  ElMessageBox.alert(content, title, {
    // 禁止自动对焦
    //autofocus: false,
    confirmButtonText: 'OK',
    /*callback: (action: Action) => {
      MessageShow(`action: ${action}`,type)
    },*/
  })
}
</script>
<style scoped>
:deep(.el-descriptions__table .label-diy) {
  text-align: center;
  width: 100px;
  /*  font-size: large;*/
}
</style>
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Payment.vue
@@ -39,14 +39,13 @@
          @="gridEvents"
      >
        <!--            @="gridEvents"-->
        <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
        <!--      下拉显示所有信息插槽-->
        <template #content="{ row}">
        <template #content="{ row }">
          <ul class="expand-wrapper">
            <li v-for="(item,key,index) in row">
              <span style="font-weight: bold">{{ key + ':  ' }}</span>
              <span>{{ item }}</span>
            <li  v-for="(item,index) in gridOptions.columns" v-show="item.field!==undefined ">
              <span style="font-weight: bold">{{item.title+':  '}}</span>
              <span>{{ row[item.field] }}</span>
            </li>
          </ul>
        </template>
@@ -79,6 +78,9 @@
import {VXETable} from "vxe-table";
import {reactive} from "vue";
import {useRouter} from 'vue-router'
import {ElMessage, ElMessageBox} from "element-plus";
const datevalue = ref('')//时间
//组件接收参数
const PayOptions = reactive({
@@ -110,10 +112,10 @@
    showStatus: true
  },
  columns: [
   /* {title: '操作', width: '8%', slots: {default: 'button_slot'}, fixed: "left"},*/
    {type: 'seq', fixed: "left", title: ' ', width: '5%'},
    /* {title: '操作', width: '8%', slots: {default: 'button_slot'}, fixed: "left"},*/
    {type: 'expand', title: '', fixed: "left", slots: {content: 'content'}, width: '5%'},//详情
    {type: 'checkbox', fixed: "left", title: '', width: '5%'},
    {type: 'expand', title: '详情', fixed: "left", slots: {content: 'content'}, width: '5%'},
    {type: 'seq', fixed: "left", title: ' ', width: '5%'},
    {
      field: 'cgdh',
      width: '10%',
@@ -147,15 +149,29 @@
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'w', width: '10%', title: '本期已付', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'g', width: '10%', title: '期末余额', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'w',
      width: '10%',
      title: '本期已付',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'g',
      width: '10%',
      title: '期末余额',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'h', width: '9%', title: '税率', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '10%', title: '备注', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true}
  ],//表头参数
  toolbarConfig: {
    buttons: [{type:'text'},{
    buttons: [{type: 'text'}, {
      'name': '应付确认',
      status:'primary',
      status: 'primary',
      'code': 'Sure',
    }],
    import: false,
@@ -165,7 +181,7 @@
    custom: true,
    style: 'paddling-left:10px'
  },//表头按钮
  data: [{},{},{},{}],//table body实际数据
  data: [{}, {}, {}, {}],//table body实际数据
  mergeFooterItems: [
    {row: 0, col: 0, rowspan: 1, colspan: 3}
  ],//合并脚
@@ -192,49 +208,13 @@
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
        case 'Add': {//新增
          router.push({path: '/main/purchaseOrder/CreatePurchaseOrder'})
          break
        }
        case 'Storage': {//入库
          //应付确认
        case 'Sure': {
          if ($grid.getCheckboxRecords().length === 0) {
            openAlert({type: 'message', content: '请选择至少一条数据', status: 'warning'})
            //VXETable.modal.message( '请选择一条数据!')
            MessageShow("请选择至少一条数据!", 'warning');
            return
          } else {
            const type = VXETable.modal.confirm('您选择了' + $grid.getCheckboxRecords().length + '条数据!,是否确认入库?');
            //openAlert({type:'alert', content: '成功入库'+$grid.getCheckboxRecords().length+'条数据!', status: 'success' })
            //VXETable.modal.message( '请选择一条数据!')
            return
          }
          break
        }
        case 'Return': {//退库
          if ($grid.getCheckboxRecords().length === 0) {
            openAlert({type: 'message', content: '请选择至少一条数据', status: 'warning'})
            //VXETable.modal.message( '请选择一条数据!')
            return
          } else {
            /*            async ()=>{
              const type = await.VXETable.modal.confirm('您选择了'+$grid.getCheckboxRecords().length+'条数据!,是否确认退库?');
            }*/
            const type = VXETable.modal.confirm('您选择了' + $grid.getCheckboxRecords().length + '条数据!,是否确认退库?');
            /* if(VXETable.modal.confirm('您选择了'+$grid.getCheckboxRecords().length+'条数据!,是否确认退库?' )){
              //openAlert({type:'message', content: '成功退库'+$grid.getCheckboxRecords().length+'条数据!', status: 'success',lockView: false, mask: false })
            }*/
            /* if(type==='confirm'){
              openAlert({type:'message', content: '成功退库'+$grid.getCheckboxRecords().length+'条数据!', status: 'success' })
            }
*/
            //openAlert({type:'alert', content: '成功退库'+$grid.getCheckboxRecords().length+'条数据!', status: 'success' })
            //VXETable.modal.message( '请选择一条数据!')
            return
            MessageConfirmShow("确认应付", '您选择了' + $grid.getCheckboxRecords().length + '条数据!,是否确认应付?')
          }
          break
        }
@@ -254,16 +234,7 @@
  },
}
const openAlert = (options) => {
  if (options.type === 'message') {
    VXETable.modal.message(options)
  } else {
    VXETable.modal.alert(options)
  }
}
const datevalue = ref('')
const shortcuts = [
  {
@@ -294,6 +265,73 @@
    },
  },
]
//页面逻辑代码执行
function logicExecute(type){
  const $grid = xGrid.value
  switch (type) {
    case '确认应付':
      //入库逻辑代码TODO
      MessageShow('操作成功!', 'success');
      break;
    default:
      MessageShow('未知操作!', 'error');
      break;
  }
  return true;
}
//提示信息
//信息内容,显示方式,显示标题,类型
const MessageShow = (content, type = 'success') => {
  ElMessage({
    message: content,
    type: type,
    showClose: true,
  })
}
//操作确认类信息:操作类型,提示内容,提示标头,提示类型
const MessageConfirmShow = (czType, content, title = '操作确认提示', type = 'warning') => {
  ElMessageBox.confirm(
      content,
      title,
      {
        cancelButtonText: '取消',
        confirmButtonText: '确定',
        type: type,
        center: true,
      }
  )
      //点击了确定
      .then(() => {
        return  logicExecute(czType);
      })
      //点击了取消
      .catch(() => {
        return false;
      })
}
//弹窗信息
const MessageAlertShow = (content, title, type = 'info') => {
  ElMessageBox.alert(content, title, {
    // 禁止自动对焦
    //autofocus: false,
    confirmButtonText: 'OK',
    /*callback: (action: Action) => {
      MessageShow(`action: ${action}`,type)
    },*/
  })
}
</script>
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/PurchaseOrder.vue
@@ -39,6 +39,7 @@
<script setup>
import {nextTick, ref} from 'vue'
import {ArrowRight, Search} from "@element-plus/icons-vue";
import {ElMessage, ElMessageBox} from "element-plus";
let indexFlag = $ref(1)
@@ -46,6 +47,69 @@
  indexFlag = index
}
/*
//提示信息
//信息内容,显示方式,显示标题,类型
const MessageShow = (content, type = 'success') =>{
  ElMessage({
    message: content,
    type: type,
    showClose: true,
  })
}
//操作确认类信息:操作类型,提示内容,提示标头,提示类型
const MessageConfirmShow = (czType, content, title = '操作确认提示', type = 'warning') => {
  ElMessageBox.confirm(
      content,
      title,
      {
        cancelButtonText: '取消',
        confirmButtonText: '确定',
        type: type,
        center: true,
      }
  )
      //点击了确定
      .then(() => {
        switch (czType) {
          case '确定':
            //多选退货逻辑代码TODO
            MessageShow('操作成功!', 'success');
            break;
          case '退货':
            //单退货逻辑代码TODO
            MessageShow('操作成功!', 'success');
            break;
          default:
            MessageShow('未知操作!', 'error');
            break;
        }
        return true;
      })
      //点击了取消
      .catch(() => {
        return false;
      })
}
//弹窗信息
const MessageAlertShow = (content, title, type = 'info') => {
  ElMessageBox.alert(content, title, {
    // 禁止自动对焦
    //autofocus: false,
    confirmButtonText: 'OK',
    /!*callback: (action: Action) => {
      MessageShow(`action: ${action}`,type)
    },*!/
  })
}
*/
</script>
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Return.vue
@@ -42,11 +42,11 @@
        <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
        <!--      下拉显示所有信息插槽-->
        <template #content="{ row}">
        <template #content="{ row }">
          <ul class="expand-wrapper">
            <li v-for="(item,key,index) in row">
              <span style="font-weight: bold">{{ key + ':  ' }}</span>
              <span>{{ item }}</span>
            <li v-for="(item,index) in gridOptions.columns" v-show="item.field!==undefined ">
              <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
              <span>{{ row[item.field] }}</span>
            </li>
          </ul>
        </template>
@@ -70,12 +70,13 @@
      <!--      详情框 部分1-->
      <vxe-modal v-model="showDetails" title="查看详情" width="600" height="80%" :mask="false" :lock-view="false" resize>
        <el-container >
      <vxe-modal v-model="showDetails" title="查看详情" width="600" height="80%" :mask="false" :lock-view="false"
                 resize>
        <el-container>
          <el-header height="35px"
                     style="margin: 0;padding: 0">
            <el-input  v-model="showCGDH" placeholder="采购单号" disabled >
            <el-input v-model="showCGDH" placeholder="采购单号" disabled>
              <template #prepend>采购单号:</template>
            </el-input>
          </el-header>
@@ -119,60 +120,55 @@
<script setup>
import {ref} from "vue";
import {reactive} from "vue";
import {useRouter} from 'vue-router'
import {Search} from "@element-plus/icons-vue";
import dayjs from "dayjs";
import {VXETable} from "vxe-table";
import {ElMessage, ElMessageBox} from "element-plus";
let router = useRouter()
const getTableRow = (row, type) => {
  switch (type) {
    case 'edit' : {
      //alert('我接收到子组件传送的编辑信息')
      router.push({path: '/main/purchaseOrder/CreatePurchaseOrder', query: {id: row.id}})
      router.push({path: '/main/purchaseOrder/DetailsPurchaseOrder', query: {id: row.id}})
      break
    }
    case 'delete': {
      alert('我接收到子组件传送的删除信息'+row.id)
      alert('我接收到子组件传送的删除信息' + row.id)
      break
    }
  }
}
const xGrid = ref()
const gridEvents = {
  toolbarButtonClick({code}) {
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
        case 'Add': {//新增
          router.push({path: '/main/purchaseOrder/CreatePurchaseOrder'})
          break
        }
        case 'Sure':{
        case 'Sure': {
          if ($grid.getCheckboxRecords().length === 0) {
            openAlert({type: 'message', content: '请选择至少一条数据', status: 'warning'})
            //VXETable.modal.message( '请选择一条数据!')
            MessageShow('请选择至少一条数据!', 'warning');
            return
          } else {
            const type = VXETable.modal.confirm('您选择了' + $grid.getCheckboxRecords().length + '条数据!,是否确认退货?');
            //openAlert({type:'alert', content: '成功入库'+$grid.getCheckboxRecords().length+'条数据!', status: 'success' })
            //VXETable.modal.message( '请选择一条数据!')
            return
            MessageConfirmShow('确定', '您选择了' + $grid.getCheckboxRecords().length + '条数据!,是否确认退货?')
          }
          break
        }
        case 'Log':{
          openAlert({type: 'alert', content: '点击了退货记录', status: 'success'})
        case 'Log': {
          MessageAlertShow('点击了退货记录!', '操作提示');
          break
        }
      }
    }
  },
@@ -189,44 +185,33 @@
  },
}
const openAlert = (options) => {
  if(options.type==='message'){
    VXETable.modal.message(options)
  }else{
    VXETable.modal.alert(options)
  }
}
const closeAlert = (id) => {
  VXETable.modal.close(id)
}
//查询按钮方法
const BtnSearchPurchaseOrder = () => {
const confirmEvent = async () => {
  const type = await VXETable.modal.confirm('您确定要删除吗?')
  VXETable.modal.message({ content: `点击了 ${type}` })
}
  //开始时间,结束时间获取
  //MessageShow("开始时间"+datevalue._rawValue[0]+"\r\n结束时间\r\n"+datevalue._rawValue[1]);
const BtnSearchPurchaseOrder =()=>{
  for (let i = 1; i < 6; i++) {
    const randomInt = Math.floor(Math.random() * 999) + 1000;//4位数随机数
    const randomSumInt = Math.floor(Math.random() * 99) + 10;//2位数随机数
    const randomOrderInt = Math.floor(Math.random() * 99) + 100;//3位数随机数
    const t = i % 2 === 0 ? 5 : 6;
    const s = i % 2 === 0 ?  '入库' :i % 3 === 0?'退货':'部分入库';
    const thdh = i % 2 === 0 ?  '' :i % 3 === 0?'THID'+randomOrderInt:'';
    const s = i % 2 === 0 ? '入库' : i % 3 === 0 ? '退货' : '部分入库';
    const thdh = i % 2 === 0 ? '' : i % 3 === 0 ? 'THID' + randomOrderInt : '';
    const CGNo = 'NGCG231200' + randomOrderInt;//采购编号
    const wlNo = 'NGWL1000' + randomInt;
    const xh = 'NGXH' + randomSumInt;
    const wlmc = 'WLMC' + randomInt;
    const gys = '供应商' + randomSumInt;
    const xhdh='NG231200'+randomOrderInt;
    const xhdh = 'NG231200' + randomOrderInt;
    const w = i % 2 === 0 ? '3300' : i % 3 === 0 ? '3660' : i % 4 === 0 ? '2250' : '2580';
    const h = i % 2 === 0 ? '2440' : i % 3 === 0 ? '2440' : i % 4 === 0 ? '2000' : '2300';
    const dw = i % 2 === 0 ? '片' : i % 3 === 0 ? '平米' : i % 4 === 0 ? '包' : '吨';
    now.setDate(now.getDate() + 1);
    gridOptions.data.push({
      cgdh: CGNo,
      thdh:thdh,
      thdh: thdh,
      h: t,
      xh: xh,
      wlbh: wlNo,
@@ -235,19 +220,18 @@
      w: w,
      g: h,
      dw: dw,
      cgzt:s,
      rq:dayjs(now).format('YYYY-MM-DD'),
      yl:randomSumInt,
      sl:randomOrderInt,
      xsdh:xhdh,
      je:randomInt,
      cgzt: s,
      rq: dayjs(now).format('YYYY-MM-DD'),
      yl: randomSumInt,
      sl: randomOrderInt,
      xsdh: xhdh,
      je: randomInt,
      6: '139xxxxxxxx',
    })
  }
}
//组件接收参数
@@ -280,48 +264,141 @@
    showStatus: true
  },
  columns: [
    {type: 'expand', title: '', fixed: "left", slots: {content: 'content'}, width: 50},//详情
    {title: '操作', width: '8%', slots: {default: 'button_slot'}, fixed: "left"},
    {type: 'checkbox', fixed: "left", title: '', width: 50},
    {type: 'seq', fixed: "left", title: ' ', width: 50},
    { type: 'checkbox',fixed:"left", title: '', width: 50 },
    {type: 'expand', title:'详情', fixed: "left", slots: {content: 'content'}, width: 50},
    {field: 'thdh', width: '10%', title: '退货单号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'cgdh', width: '10%', title: '采购单号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'thdh',
      width: '10%',
      title: '退货单号',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'cgdh',
      width: '10%',
      title: '采购单号',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'cgzt', width: '10%', title: '状态', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'gys', width: '10%',title: '供应商', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'wlbh', width: '10%',title: '物料编号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'wlmc', width: '10%', title: '物料名称', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'w', width: '8%',title: '宽度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'g', width: '8%',title: '高度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'h', width: '8%',title: '厚度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'xh', width: '8%',title: '型号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'dw', width: '8%',title: '单位', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '12%',title: '不含税单价', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'sl', width: '8%',title: '数量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'sl', width: '12%',title: '已采购数量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'je', width: '8%',title: '金额', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'je', width: '12%',title: '不含税金额', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '8%',title: '税率', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'sl', width: '8%',title: '库存', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'yl', width: '10%',title: '周用量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'yl', width: '10%',title: '月用量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'cgzt', width: '10%',title: '单据状态', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'xsdh', width: '10%',title: '销售单号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'rq', width: '10%',title: '制单日期', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'gys',
      width: '10%',
      title: '供应商',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'wlbh',
      width: '10%',
      title: '物料编号',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'wlmc',
      width: '10%',
      title: '物料名称',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'w', width: '8%', title: '宽度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'g', width: '8%', title: '高度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'h', width: '8%', title: '厚度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'xh', width: '8%', title: '型号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'dw', width: '8%', title: '单位', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: '6',
      width: '12%',
      title: '不含税单价',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'sl', width: '8%', title: '数量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'sl',
      width: '12%',
      title: '已采购数量',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'je', width: '8%', title: '金额', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'je',
      width: '12%',
      title: '不含税金额',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: '6', width: '8%', title: '税率', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'sl', width: '8%', title: '库存', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'yl', width: '10%', title: '周用量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'yl', width: '10%', title: '月用量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'cgzt',
      width: '10%',
      title: '单据状态',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'xsdh',
      width: '10%',
      title: '销售单号',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'rq',
      width: '10%',
      title: '制单日期',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: '6', width: '10%', title: '制单人', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '10%',title: '采购部门', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '10%',title: '采购组织', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '10%',title: '备注', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true}
    {
      field: '6',
      width: '10%',
      title: '采购部门',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: '6',
      width: '10%',
      title: '采购组织',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: '6', width: '10%', title: '备注', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true}
  ],//表头参数
  toolbarConfig: {
    buttons: [{type:'text'},{
        'name': '退货记录',
    buttons: [{type: 'text'}, {
      'name': '退货记录',
        'code':'Log'
      },
      'code': 'Log'
    },
      {
        'name': '确认退货',
        status:'primary',
        'code':'Sure'
        status: 'primary',
        'code': 'Sure'
      }],
    import: false,
    export: true,
@@ -352,65 +429,52 @@
//详情框 部分2
const showCGDH =ref();
const showDetails =ref(false);
let detailData =[];
const showCGDH = ref();
const showDetails = ref(false);
let detailData = [];
const cellClickEvent = ({row}) => {
  detailData = ['cgdh', 'thdh', 'h', 'xh', 'wlbh', 'wlmc', 'gys','w','g','dw','cgzt','rq','yl','sl','xsdh','je','6'].map(field => {
    return { label: ModelColumnContent(field) , value: row[field] }
  if (isQueryColumnId === false) {
    queryColumnId();
  }
  detailData = list.map(field => {
    return {label: queryColumnsTitle(field), value: row[field]}
  })
  showDetails.value = true;
  showCGDH.value = row['cgdh'];
}
const ModelColumnContent = (text) => {
  switch (text) {
    case 'cgdh':
      return "采购单号";
    case 'thdh':
      return "退货单号";
    case 'h':
      return "厚";
    case 'xh':
      return "型号";
    case 'wlbh':
      return "物料编码";
    case 'wlmc':
      return "物料名称";
    case 'gys':
      return "供应商";
    case 'w':
      return "宽";
    case 'g':
      return "高";
    case 'dw':
      return "单位";
    case 'cgzt':
      return "采购状态";
    case 'rq':
      return "日期";
    case 'yl':
      return "余量";
    case 'sl':
      return "数量";
    case 'xsdh':
      return "销售单号";
    case 'je':
      return "金额";
    case '6':
      return "其他";
//获取表列
let list = [];
let columnIndex = 4;//列标头从第几列开始的
let isQueryColumnId = false;
const queryColumnId = () => {
    default:
      return text;
  while (columnIndex < gridOptions.columns.length) {
    list.push(gridOptions.columns[columnIndex].field);
    columnIndex++;
  }
  isQueryColumnId = true;
  return list;
}
const SureReturn=()=>{
//获取表列名
function queryColumnsTitle(cn) {
  let i = 0;
  while (i < gridOptions.columns.length + 1) {
    if (gridOptions.columns[i].field === cn) {
      return gridOptions.columns[i].title;
    }
    i++;
  }
}
  const type = VXETable.modal.confirm('是否确认退货?');
// 详情框部分2 结束
const SureReturn = () => {
  MessageConfirmShow('退货', '是否确认退货?')
}
//详情框 部分2 结束
@@ -450,12 +514,80 @@
  },
]
//页面逻辑代码执行
function logicExecute(type) {
  const $grid = xGrid.value
  switch (type) {
    case '确定':
      //多选退货逻辑代码TODO
      MessageShow('操作成功!', 'success');
      break;
    case '退货':
      //单退货逻辑代码TODO
      MessageShow('操作成功!', 'success');
      break;
    default:
      MessageShow('未知操作!', 'error');
      break;
  }
  return true;
}
//提示信息
//信息内容,显示方式,显示标题,类型
const MessageShow = (content, type = 'success') => {
  ElMessage({
    message: content,
    type: type,
    showClose: true,
  })
}
//操作确认类信息:操作类型,提示内容,提示标头,提示类型
const MessageConfirmShow = (czType, content, title = '操作确认提示', type = 'warning') => {
  ElMessageBox.confirm(
      content,
      title,
      {
        cancelButtonText: '取消',
        confirmButtonText: '确定',
        type: type,
        center: true,
      }
  )
      //点击了确定
      .then(() => {
        logicExecute(czType);
        return true;
      })
      //点击了取消
      .catch(() => {
        return false;
      })
}
//弹窗信息
const MessageAlertShow = (content, title, type = 'info') => {
  ElMessageBox.alert(content, title, {
    // 禁止自动对焦
    //autofocus: false,
    confirmButtonText: 'OK',
    /*callback: (action: Action) => {
      MessageShow(`action: ${action}`,type)
    },*/
  })
}
</script>
<style scoped>
:deep(.v-column-label div span){
:deep(.v-column-label div span) {
  font-weight: bold;
  font-align:center;
}
</style>
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Select.vue
@@ -28,24 +28,24 @@
        </el-col>
      </el-row>
    </el-header>
    <el-main style="padding-top: 5px;height:100%">
      <vxe-grid
          max-height="600"
          @filter-change="filterChanged"
          class="mytable-scrollbar"
          ref="xGrid"
          v-bind="gridOptions"
          v-on="gridEvents"
          @cell-dblclick="cellClickEvent"
      >
        <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
        <!--      下拉显示所有信息插槽-->
        <template #content="{ row}">
        <template #content="{ row }">
          <ul class="expand-wrapper">
            <li v-for="(item,key,index) in row">
              <span style="font-weight: bold">{{ key + ':  ' }}</span>
              <span>{{ item }}</span>
            <li  v-for="(item,index) in gridOptions.columns" v-show="item.field!==undefined ">
              <span style="font-weight: bold">{{item.title+':  '}}</span>
              <span>{{ row[item.field] }}</span>
            </li>
          </ul>
        </template>
@@ -53,8 +53,8 @@
        <!--左边固定显示的插槽-->
        <template #button_slot="{ row }">
          <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button>
<!--          <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button>-->
<!--          <el-button @click="cellClickEvent" link type="primary" size="small">详情</el-button>-->
          <!--          <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button>-->
          <!--          <el-button @click="cellClickEvent" link type="primary" size="small">详情</el-button>-->
        </template>
@@ -67,23 +67,49 @@
        </template>
      </vxe-grid>
      <!--      详情框 部分1-->
      <vxe-modal v-model="showDetails" title="查看详情" width="600" height="80%" :mask="false" :lock-view="false"
                 resize>
        <el-container>
          <el-header height="35px"
                     style="margin: 0;padding: 0">
      <vxe-modal v-model="showDetails" title="查看详情" width="600" height="400" :mask="false" :lock-view="false" resize>
        <template #default>
          <vxe-table
              border="inner"
              auto-resize
              show-overflow
              height="auto"
              :row-config="{isHover: true}"
              :show-header="false"
              :sync-resize="showDetails"
              :data="detailData">
            <vxe-column field="label" width="40%"></vxe-column>
            <vxe-column field="value"></vxe-column>
          </vxe-table>
        </template>
            <el-input v-model="showCGDH" placeholder="采购单号" disabled>
              <template #prepend>采购单号:</template>
            </el-input>
          </el-header>
          <el-main>
            <template #default>
              <vxe-table
                  border="inner"
                  auto-resize
                  show-overflow
                  max-height="400"
                  :row-config="{isHover: true}"
                  :show-header="false"
                  :sync-resize="showDetails"
                  :data="detailData">
                <vxe-column field="label" width="30%" class-name="v-column-label"></vxe-column>
                <vxe-column field="value"></vxe-column>
              </vxe-table>
            </template>
          </el-main>
          <el-footer height="40px">
            <el-row>
              <el-col :offset="20" :span="4">
                <el-button
                    id="Sure"
                    type="primary"
                    @click="logicExecute('编辑')"
                >编辑
                </el-button>
              </el-col>
            </el-row>
          </el-footer>
        </el-container>
      </vxe-modal>
      <!--      详情框 部分1 结束-->
    </el-main>
@@ -97,7 +123,9 @@
import {useRouter} from 'vue-router'
import {Search} from "@element-plus/icons-vue";
import dayjs from "dayjs";
import {VXETable} from "vxe-table";
import {ElMessage} from "element-plus";
let router = useRouter()
const getTableRow = (row, type) => {
@@ -110,8 +138,7 @@
    case 'delete': {
      alert('我接收到子组件传送的删除信息'+row.id)
      alert('我接收到子组件传送的删除信息' + row.id)
      break
    }
  }
@@ -128,7 +155,8 @@
          break
        }
        case 'AddNo': {//无单新增
          openAlert({type: 'alert', content: '点击了无单新增', status: 'success'})
          MessageShow('点击了无单新增', 'success');
          break
        }
@@ -148,36 +176,19 @@
  },
}
const openAlert = (options) => {
  if(options.type==='message'){
    VXETable.modal.message(options)
  }else{
    VXETable.modal.alert(options)
  }
}
const closeAlert = (id) => {
  VXETable.modal.close(id)
}
const confirmEvent = async () => {
  const type = await VXETable.modal.confirm('您确定要删除吗?')
  VXETable.modal.message({ content: `点击了 ${type}` })
}
const BtnSearchPurchaseOrder =()=>{
const BtnSearchPurchaseOrder = () => {
  for (let i = 1; i < 6; i++) {
    const randomInt = Math.floor(Math.random() * 999) + 1000;//4位数随机数
    const randomSumInt = Math.floor(Math.random() * 99) + 10;//2位数随机数
    const randomOrderInt = Math.floor(Math.random() * 99) + 100;//3位数随机数
    const t = i % 2 === 0 ? 5 : 6;
    const s = i % 2 === 0 ? '入库':i % 3 === 0 ? '待审核' : i % 5 === 0 ? '已采购' :'退库';
    const s = i % 2 === 0 ? '入库' : i % 3 === 0 ? '待审核' : i % 5 === 0 ? '已采购' : '退库';
    const CGNo = 'NGCG231200' + randomOrderInt;//采购编号
    const wlNo = 'NGWL1000' + randomInt;
    const xh = 'NGXH' + randomSumInt;
    const wlmc = 'WLMC' + randomInt;
    const gys = '供应商' + randomSumInt;
    const xhdh='NG231200'+randomOrderInt;
    const xhdh = 'NG231200' + randomOrderInt;
    const w = i % 2 === 0 ? '3300' : i % 3 === 0 ? '3660' : i % 4 === 0 ? '2250' : '2580';
    const h = i % 2 === 0 ? '2440' : i % 3 === 0 ? '2440' : i % 4 === 0 ? '2000' : '2300';
    const dw = i % 2 === 0 ? '片' : i % 3 === 0 ? '平米' : i % 4 === 0 ? '包' : '吨';
@@ -192,12 +203,12 @@
      w: w,
      g: h,
      dw: dw,
      cgzt:s,
      rq:dayjs(now).format('YYYY-MM-DD'),
      yl:randomSumInt,
      sl:randomOrderInt,
      xsdh:xhdh,
      je:randomInt,
      cgzt: s,
      rq: dayjs(now).format('YYYY-MM-DD'),
      yl: randomSumInt,
      sl: randomOrderInt,
      xsdh: xhdh,
      je: randomInt,
      6: '139xxxxxxxx',
    })
@@ -205,6 +216,26 @@
}
//页面逻辑代码执行
function logicExecute(type) {
  const $grid = xGrid.value
  switch (type) {
    case '编辑':
      //MessageShow('操作成功!', 'success');
      //编辑逻辑代码TODO
      router.push({path: '/main/purchaseOrder/CreatePurchaseOrder'})
      break;
    case '退货':
      //单退货逻辑代码TODO
      MessageShow('操作成功!', 'success');
      break;
    default:
      MessageShow('未知操作!', 'error');
      break;
  }
  return true;
}
//组件接收参数
@@ -237,36 +268,122 @@
    showStatus: true
  },
  columns: [
    {type: 'expand', title: '', fixed: "left", slots: {content: 'content'}, width: 50},//详情
    {title: '操作', width: '8%', slots: {default: 'button_slot'}, fixed: "left"},
    /* {type: 'checkbox',fixed:"left", title: '', width: 50 },*/
    {type: 'seq', fixed: "left", title: ' ', width: 50},
    { type: 'checkbox',fixed:"left", title: '', width: 50 },
    {type: 'expand', title:'详情', fixed: "left", slots: {content: 'content'}, width: 50},
    {field: 'cgdh', width: '10%', title: '采购单号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'cgdh',
      width: '10%',
      title: '采购单号',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'cgzt', width: '10%', title: '状态', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'gys', width: '10%',title: '供应商', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'wlbh', width: '10%',title: '物料编号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'wlmc', width: '10%', title: '物料名称', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'w', width: '8%',title: '宽度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'g', width: '8%',title: '高度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'h', width: '8%',title: '厚度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'xh', width: '8%',title: '型号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'dw', width: '8%',title: '单位', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '12%',title: '不含税单价', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'sl', width: '8%',title: '数量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'sl', width: '12%',title: '已采购数量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'je', width: '8%',title: '金额', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'je', width: '12%',title: '不含税金额', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '8%',title: '税率', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'sl', width: '8%',title: '库存', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'yl', width: '10%',title: '周用量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'yl', width: '10%',title: '月用量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'cgzt', width: '10%',title: '单据状态', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'xsdh', width: '10%',title: '销售单号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'rq', width: '10%',title: '制单日期', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'gys',
      width: '10%',
      title: '供应商',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'wlbh',
      width: '10%',
      title: '物料编号',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'wlmc',
      width: '10%',
      title: '物料名称',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'w', width: '8%', title: '宽度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'g', width: '8%', title: '高度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'h', width: '8%', title: '厚度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'xh', width: '8%', title: '型号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'dw', width: '8%', title: '单位', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: '6',
      width: '12%',
      title: '不含税单价',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'sl', width: '8%', title: '数量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'sl',
      width: '12%',
      title: '已采购数量',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'je', width: '8%', title: '金额', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'je',
      width: '12%',
      title: '不含税金额',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: '6', width: '8%', title: '税率', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'sl', width: '8%', title: '库存', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'yl', width: '10%', title: '周用量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'yl', width: '10%', title: '月用量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'cgzt',
      width: '10%',
      title: '单据状态',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'xsdh',
      width: '10%',
      title: '销售单号',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'rq',
      width: '10%',
      title: '制单日期',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: '6', width: '10%', title: '制单人', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '10%',title: '采购部门', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '10%',title: '采购组织', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '10%',title: '备注', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true}
    {
      field: '6',
      width: '10%',
      title: '采购部门',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: '6',
      width: '10%',
      title: '采购组织',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: '6', width: '10%', title: '备注', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true}
  ],//表头参数
  toolbarConfig: {
    buttons: [/*{type:'text'},
@@ -281,7 +398,7 @@
        'code':'AddNo'
      }*/
      ],
    ],
    import: false,
    export: true,
    print: true,
@@ -309,14 +426,47 @@
})
/*const showDetails = ref(false)
const detailData = ref([])
const cellClickEvent = ({ row }) => {
  detailData.value = ['采购单号', 'wlbh', 'wlmc', 'gys', 'h', 'k', 'g'].map(field => {
    return { label: field, value: row[field] }
//详情框 部分2
const showCGDH = ref();
const showDetails = ref(false);
let detailData = [];
const cellClickEvent = ({row}) => {
  if(isQueryColumnId===false){
    queryColumnId();
  }
  detailData = list.map(field => {
    return {label: queryColumnsTitle(field), value: row[field]}
  })
  showDetails.value = true
}*/
  showDetails.value = true;
  showCGDH.value = row['cgdh'];
}
//获取表列
let list = [];
let columnIndex = 3;//列标头从第几列开始的
let isQueryColumnId = false;
const queryColumnId = () => {
  while (columnIndex < gridOptions.columns.length) {
    list.push(gridOptions.columns[columnIndex].field);
    columnIndex++;
  }
  isQueryColumnId = true;
  return list;
}
//获取表列名
function queryColumnsTitle(cn) {
  let i = 0;
  while (i < gridOptions.columns.length + 1) {
    if (gridOptions.columns[i].field === cn) {
      return gridOptions.columns[i].title;
    }
    i++;
  }
}
//详情框 部分2 结束
const now = new Date()
@@ -353,9 +503,60 @@
  },
]
//提示信息
//信息内容,显示方式,显示标题,类型
const MessageShow = (content, type = 'success') => {
  ElMessage({
    message: content,
    type: type,
    showClose: true,
  })
}
//操作确认类信息:操作类型,提示内容,提示标头,提示类型
const MessageConfirmShow = (czType, content, title = '操作确认提示', type = 'warning') => {
  ElMessageBox.confirm(
      content,
      title,
      {
        cancelButtonText: '取消',
        confirmButtonText: '确定',
        type: type,
        center: true,
      }
  )
      //点击了确定
      .then(() => {
        logicExecute(czType);
        return true;
      })
      //点击了取消
      .catch(() => {
        return false;
      })
}
//弹窗信息
const MessageAlertShow = (content, title, type = 'info') => {
  ElMessageBox.alert(content, title, {
    // 禁止自动对焦
    //autofocus: false,
    confirmButtonText: 'OK',
    /*callback: (action: Action) => {
      MessageShow(`action: ${action}`,type)
    },*/
  })
}
</script>
<style scoped>
:deep(.v-column-label div span) {
  font-weight: bold;
}
</style>
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Storage.vue
@@ -29,8 +29,6 @@
      </el-row>
    </el-header>
    <el-main style="padding-top: 5px;height:100%">
      <vxe-grid
@@ -42,16 +40,16 @@
          v-bind="gridOptions"
          v-on="gridEvents"
          @cell-click ="cellClickEvent"
          @cell-dblclick="cellClickEvent"
      >
        <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
        <!--      下拉显示所有信息插槽-->
        <template #content="{ row}">
        <template #content="{ row }">
          <ul class="expand-wrapper">
            <li v-for="(item,key,index) in row">
              <span style="font-weight: bold">{{ key + ':  ' }}</span>
              <span>{{ item }}</span>
            <li v-for="(item,index) in gridOptions.columns" v-show="item.field!==undefined ">
              <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
              <span>{{ row[item.field] }}</span>
            </li>
          </ul>
        </template>
@@ -74,13 +72,14 @@
        </template>
      </vxe-grid>
<!--      详情框 部分1-->
      <vxe-modal v-model="showDetails" title="查看详情" width="600" height="80%" :mask="false" :lock-view="false" resize>
        <el-container >
      <!--      详情框 部分1-->
      <vxe-modal v-model="showDetails" title="查看详情" width="600" height="80%" :mask="false" :lock-view="false"
                 resize>
        <el-container>
          <el-header height="35px"
              style="margin: 0;padding: 0">
                     style="margin: 0;padding: 0">
            <el-input  v-model="showCGDH" placeholder="采购单号" disabled >
            <el-input v-model="showCGDH" placeholder="采购单号" disabled>
              <template #prepend>采购单号:</template>
            </el-input>
          </el-header>
@@ -90,7 +89,7 @@
                  border="inner"
                  auto-resize
                  show-overflow
                  max-height="420"
                  max-height="400"
                  :row-config="{isHover: true}"
                  :show-header="false"
                  :sync-resize="showDetails"
@@ -122,8 +121,6 @@
  </el-container>
</template>
@@ -134,27 +131,29 @@
import {Search} from "@element-plus/icons-vue";
import dayjs from "dayjs";
import {VXETable} from "vxe-table";
let router = useRouter()
import {ElMessage, ElMessageBox} from "element-plus";
import ERPMessage from '@/components/basic/ERPMessage.vue'
let router = useRouter()
const getTableRow = (row, type) => {
  switch (type) {
    case 'edit' : {
      //alert('我接收到子组件传送的编辑信息')
      router.push({path: '/main/purchaseOrder/CreatePurchaseOrder', query: {id: row.id}});
      router.push({path: '/main/purchaseOrder/DetailsPurchaseOrder', query: {id: row.id}});
      break
    }
    case 'look':{
    case 'look': {
      /*this.detailData = ['name', 'nickname', 'role', 'sex', 'age', 'amount', 'address'].map(field => {
        return { label: field, value: row[field] }
      })*/
      //this.showDetails = true
break
      break
    }
    case 'delete': {
      alert('我接收到子组件传送的删除信息'+row.id)
      alert('我接收到子组件传送的删除信息' + row.id)
      break
    }
  }
@@ -166,22 +165,24 @@
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
        case 'Sure':{
        case 'Sure': {
          if ($grid.getCheckboxRecords().length === 0) {
            openAlert({type: 'message', content: '请选择至少一条数据', status: 'warning'})
            MessageShow('请选择至少一条数据', 'warning');
            //openAlert({type: 'message', content: '请选择至少一条数据', status: 'warning'})
            //VXETable.modal.message( '请选择一条数据!')
            return
          } else {
            const type = VXETable.modal.confirm('您选择了' + $grid.getCheckboxRecords().length + '条数据!,是否确认退货?');
            const type = VXETable.modal.confirm('您选择了' + $grid.getCheckboxRecords().length + '条数据!,是否确认入库?');
            //openAlert({type:'alert', content: '成功入库'+$grid.getCheckboxRecords().length+'条数据!', status: 'success' })
            //VXETable.modal.message( '请选择一条数据!')
            return
          }
          break
        }
        case 'Log':{
        case 'Log': {
          openAlert({type: 'alert', content: '点击了退货记录', status: 'success'})
          //openAlert({type: 'alert', content: '点击了退货记录', status: 'success'})
          MessageConfirmShow("退货记录", "点击了退货记录", "", 'success')
          break
        }
      }
@@ -201,9 +202,9 @@
}
const openAlert = (options) => {
  if(options.type==='message'){
  if (options.type === 'message') {
    VXETable.modal.message(options)
  }else{
  } else {
    VXETable.modal.alert(options)
  }
@@ -212,32 +213,32 @@
  VXETable.modal.close(id)
}
const confirmEvent = async () => {
  const type = await VXETable.modal.confirm('您确定要删除吗?')
  VXETable.modal.message({ content: `点击了 ${type}` })
}
const BtnSearchPurchaseOrder =()=>{
//查询调用事件
const BtnSearchPurchaseOrder = () => {
  //开始时间,结束时间获取
  //MessageShow(datevalue._rawValue[0]+"\r\n时间2\r\n"+datevalue._rawValue[1]);
  for (let i = 1; i < 6; i++) {
    const randomInt = Math.floor(Math.random() * 999) + 1000;//4位数随机数
    const randomSumInt = Math.floor(Math.random() * 99) + 10;//2位数随机数
    const randomOrderInt = Math.floor(Math.random() * 99) + 100;//3位数随机数
    const t = i % 2 === 0 ? 5 : 6;
    const s = i % 2 === 0 ? '入库':i % 3 === 0 ? '待审核' : '已采购';
    const rkdh = i % 2 === 0 ? 'RKID'+randomOrderInt:i % 3 === 0 ? '' : '';
    const s = i % 2 === 0 ? '入库' : i % 3 === 0 ? '待审核' : '已采购';
    const rkdh = i % 2 === 0 ? 'RKID' + randomOrderInt : i % 3 === 0 ? '' : '';
    const CGNo = 'NGCG231200' + randomOrderInt;//采购编号
    const wlNo = 'NGWL1000' + randomInt;
    const xh = 'NGXH' + randomSumInt;
    const wlmc = 'WLMC' + randomInt;
    const gys = '供应商' + randomSumInt;
    const xhdh='NG231200'+randomOrderInt;
    const xhdh = 'NG231200' + randomOrderInt;
    const w = i % 2 === 0 ? '3300' : i % 3 === 0 ? '3660' : i % 4 === 0 ? '2250' : '2580';
    const h = i % 2 === 0 ? '2440' : i % 3 === 0 ? '2440' : i % 4 === 0 ? '2000' : '2300';
    const dw = i % 2 === 0 ? '片' : i % 3 === 0 ? '平米' : i % 4 === 0 ? '包' : '吨';
    now.setDate(now.getDate() + 1);
    gridOptions.data.push({
      cgdh: CGNo,
      rkdh:rkdh,
      rkdh: rkdh,
      h: t,
      xh: xh,
      wlbh: wlNo,
@@ -246,19 +247,18 @@
      w: w,
      g: h,
      dw: dw,
      cgzt:s,
      rq:dayjs(now).format('YYYY-MM-DD'),
      yl:randomSumInt,
      sl:randomOrderInt,
      xsdh:xhdh,
      je:randomInt,
      cgzt: s,
      rq: dayjs(now).format('YYYY-MM-DD'),
      yl: randomSumInt,
      sl: randomOrderInt,
      xsdh: xhdh,
      je: randomInt,
      6: '139xxxxxxxx',
    })
  }
}
//组件接收参数
@@ -292,48 +292,141 @@
    showStatus: true
  },
  columns: [
    {type: 'expand', title: '', fixed: "left", slots: {content: 'content'}, width: 50},//详情
    {title: '操作', width: '8%', slots: {default: 'button_slot'}, fixed: "left"},
    {type: 'checkbox', fixed: "left", title: '', width: 50},
    {type: 'seq', fixed: "left", title: ' ', width: 50},
    { type: 'checkbox',fixed:"left", title: '', width: 50 },
    {type: 'expand', title:'详情', fixed: "left", slots: {content: 'content'}, width: 50},
    {field: 'rkdh', width: '10%', title: '入库单号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'cgdh', width: '10%', title: '采购单号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'rkdh',
      width: '10%',
      title: '入库单号',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'cgdh',
      width: '10%',
      title: '采购单号',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'cgzt', width: '10%', title: '状态', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'gys', width: '10%',title: '供应商', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'wlbh', width: '10%',title: '物料编号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'wlmc', width: '10%', title: '物料名称', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'w', width: '8%',title: '宽度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'g', width: '8%',title: '高度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'h', width: '8%',title: '厚度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'xh', width: '8%',title: '型号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'dw', width: '8%',title: '单位', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '12%',title: '不含税单价', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'sl', width: '8%',title: '数量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'sl', width: '12%',title: '已采购数量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'je', width: '8%',title: '金额', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'je', width: '12%',title: '不含税金额', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '8%',title: '税率', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'sl', width: '8%',title: '库存', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'yl', width: '10%',title: '周用量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'yl', width: '10%',title: '月用量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'cgzt', width: '10%',title: '单据状态', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'xsdh', width: '10%',title: '销售单号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'rq', width: '10%',title: '制单日期', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'gys',
      width: '10%',
      title: '供应商',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'wlbh',
      width: '10%',
      title: '物料编号',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'wlmc',
      width: '10%',
      title: '物料名称',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'w', width: '8%', title: '宽度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'g', width: '8%', title: '高度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'h', width: '8%', title: '厚度', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'xh', width: '8%', title: '型号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'dw', width: '8%', title: '单位', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: '6',
      width: '12%',
      title: '不含税单价',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'sl', width: '8%', title: '数量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'sl',
      width: '12%',
      title: '已采购数量',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: 'je', width: '8%', title: '金额', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'je',
      width: '12%',
      title: '不含税金额',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: '6', width: '8%', title: '税率', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'sl', width: '8%', title: '库存', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'yl', width: '10%', title: '周用量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: 'yl', width: '10%', title: '月用量', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {
      field: 'cgzt',
      width: '10%',
      title: '单据状态',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'xsdh',
      width: '10%',
      title: '销售单号',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: 'rq',
      width: '10%',
      title: '制单日期',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: '6', width: '10%', title: '制单人', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '10%',title: '采购部门', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '10%',title: '采购组织', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
    {field: '6', width: '10%',title: '备注', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true}
    {
      field: '6',
      width: '10%',
      title: '采购部门',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {
      field: '7',
      width: '10%',
      title: '采购组织',
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      sortable: true
    },
    {field: '8', width: '10%', title: '备注', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true}
  ],//表头参数
  toolbarConfig: {
    buttons: [{type:'text'/*,name:'订单入库'*/},{
    buttons: [{type: 'text'/*,name:'订单入库'*/}, {
      'name': '入库记录',
      'code':'Log'
      'code': 'Log'
    },
      {
        'name': '确认入库',
        status:'primary',
        'code':'Sure'
        status: 'primary',
        'code': 'Sure'
      }],
    import: false,
    export: true,
@@ -362,70 +455,56 @@
})
const showCGDH = ref();
//详情框 部分2
const showDetails =ref(false);
let detailData =[];
const showCGDH = ref();
const showDetails = ref(false);
let detailData = [];
const cellClickEvent = ({row}) => {
 detailData = ['cgdh', 'rkdh', 'h', 'xh', 'wlbh', 'wlmc', 'gys','w','g','dw','cgzt','rq','yl','sl','xsdh','je','6'].map(field => {
    return { label: ModelColumnContent(field) , value: row[field] }
 })
  if(isQueryColumnId===false){
    queryColumnId();
  }
  detailData = list.map(field => {
    return {label: queryColumnsTitle(field), value: row[field]}
  })
  showDetails.value = true;
  showCGDH.value = row['cgdh'];
}
const ModelColumnContent = (text) => {
  switch (text) {
    case 'cgdh':
      return "采购单号";
    case 'rkdh':
      return "入库单号";
    case 'h':
      return "厚";
    case 'xh':
      return "型号";
    case 'wlbh':
      return "物料编码";
    case 'wlmc':
      return "物料名称";
    case 'gys':
      return "供应商";
    case 'w':
      return "宽";
    case 'g':
      return "高";
    case 'dw':
      return "单位";
    case 'cgzt':
      return "采购状态";
    case 'rq':
      return "日期";
    case 'yl':
      return "余量";
    case 'sl':
      return "数量";
      case 'xsdh':
      return "销售单号";
    case 'je':
      return "金额";
    case '6':
      return "其他";
    default:
      return text;
//获取表列
let list = [];
let columnIndex = 4;//列标头从第几列开始的
let isQueryColumnId = false;
const queryColumnId = () => {
  while (columnIndex < gridOptions.columns.length) {
    list.push(gridOptions.columns[columnIndex].field);
    columnIndex++;
  }
  isQueryColumnId = true;
  return list;
}
//获取表列名
function queryColumnsTitle(cn) {
  let i = 0;
  while (i < gridOptions.columns.length + 1) {
    if (gridOptions.columns[i].field === cn) {
      return gridOptions.columns[i].title;
    }
    i++;
  }
}
//详情框 部分2 结束
const SureStorage=()=>{
  openAlert({type: 'alert', content: '确认入库成功', status: 'success'})
const SureStorage = () => {
  MessageShow('确认入库成功');
}
const now = new Date()
@@ -461,15 +540,65 @@
  },
]
//页面逻辑代码执行
function logicExecute(type) {
  const $grid = xGrid.value
  switch (type) {
    case '入库':
      //入库逻辑代码TODO
      MessageShow('入库成功!', 'success');
      break;
    case '退货':
      //退货逻辑代码TODO
      MessageShow('退货成功!', 'success');
      break;
    default:
      MessageShow('未知操作!', 'error');
      break;
  }
  return true;
}
//提示信息
const MessageShow = (content, type = 'success') => {
  ElMessage({
    message: content,
    type: type,
    showClose: true,
  })
}
//操作确认类信息:操作类型,提示内容,提示标头,提示类型
const MessageConfirmShow = (czType, content, title = '操作确认提示', type = 'warning') => {
  ElMessageBox.confirm(
      content,
      title,
      {
        cancelButtonText: '取消',
        confirmButtonText: '确定',
        type: type,
        center: true,
      }
  )
      //点击了确定
      .then(() => {
        return logicExecute(czType);
      })
      //点击了取消
      .catch(() => {
        return false;
      })
}
</script>
<style scoped>
:deep(.v-column-label div span){
:deep(.v-column-label div span) {
  font-weight: bold;
}
</style>
north-glass-erp/northglass-erp/src/views/mm/stockReport/StockReport.vue
@@ -10,11 +10,11 @@
                              :to="{path:'/main/stockReport/StockWarehouseReport'}">成品报表
          </el-breadcrumb-item>
          <el-breadcrumb-item @click="changeRouter(3)" :class="indexFlag===3?'indexTag':''"
                              :to="{path:'/main/stockReport/StockMonthReport'}">原片月结
                              :to="{path:'/main/stockReport/StockMonthReport'}">原片月结报表
          </el-breadcrumb-item>
          <el-breadcrumb-item @click="changeRouter(4)" :class="indexFlag===4?'indexTag':''"
                              :to="{path:'/main/stockReport/SubsidiaryMonthReport'}">
            辅料月结
            辅料月结报表
          </el-breadcrumb-item>
          <el-breadcrumb-item style="display: none"></el-breadcrumb-item>
        </el-breadcrumb>