Explorar el Código

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!556
黄梓星 hace 1 año
padre
commit
0baf1d911a

+ 8 - 0
src/api/business/purchase/task.js

@@ -81,3 +81,11 @@ export function ROWClOSE(data) {
   });
 }
 
+export function RECORD(data) {
+  return request({
+    url: "/pu/record/list",
+    method: "POST",
+    data: data,
+  });
+}
+

+ 19 - 0
src/api/purchase/equipmentData.js

@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+
+// 设备产品数据库列表
+export function getEquipmentDataList(data) {
+  return request({
+    url: `device/origin/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
+    method: 'post',
+    data: data
+  })
+}
+// 设备产品数据库模板下载
+export function downLoadMb(data) {
+  return request({
+    url: `device/origin/download`,
+    method: 'post',
+    data: data,
+    responseType: 'blob'
+  })
+}

+ 208 - 0
src/components/PopDialog/index2.vue

@@ -0,0 +1,208 @@
+<template>
+  <div>
+    <el-dialog title="物料编码选择" width="1000px" :close-on-click-modal="false" :append-to-body="true" v-dialogDrag
+      class="userDialog" :visible.sync="visible">
+      <el-container style="height: 500px">
+        <el-container>
+          <el-header style="text-align: left; font-size: 12px; height: 30px">
+            <el-form size="small" :inline="true" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()"
+              @submit.native.prevent>
+              <el-form-item prop="code">
+                <el-input size="small" v-model.trim="searchForm.code" placeholder="请输入物料编号查询" clearable></el-input>
+              </el-form-item>
+              <el-form-item prop="name">
+                <el-input size="small" v-model="searchForm.name" placeholder="请输入物料名称查询" clearable></el-input>
+              </el-form-item>
+              <el-form-item>
+                <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+                <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+              </el-form-item>
+            </el-form>
+          </el-header>
+          <el-main>
+            <el-table :data="dataList" v-loading="loading" size="small" border ref="contractTable"
+              @select="handleSelectionChange" :selection="selectedRows"  height="calc(100% - 40px)" style="width: 100%">
+              <el-table-column type="selection" header-align="center" align="center" width="50">
+              </el-table-column>
+              <el-table-column prop="code" header-align="center" align="center" sortable="custom" min-width="90"
+                label="物料编码">
+              </el-table-column>
+              <el-table-column prop="name" header-align="center" align="center" sortable="custom" min-width="90"
+                label="物料名称">
+              </el-table-column>
+              <el-table-column prop="specification" header-align="center" align="center" sortable="custom" min-width="90"
+                label="规格">
+              </el-table-column>
+              <el-table-column prop="model" header-align="center" align="center" sortable="custom" min-width="90"
+                label="型号">
+              </el-table-column>
+              <el-table-column prop="manufacturerIdName" header-align="center" align="center" sortable="custom" min-width="90"
+                label="生产厂家">
+              </el-table-column>
+            </el-table>
+
+            <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
+              :current-page="searchForm.pageNo" :page-sizes="[5, 10, 15, 20]" :page-size="searchForm.pageSize"
+              :total="total" layout="total, sizes, prev, pager, next, jumper">
+            </el-pagination>
+          </el-main>
+        </el-container>
+      </el-container>
+      <span slot="footer">
+        <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
+        <el-button size="small" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import axios from 'axios'
+import { getMaterialList } from '@/api/changeApply/basic'
+export default {
+  data() {
+    return {
+      searchForm: {
+        code: '',
+        name: '',
+        isSync: '',
+        pageNo: 1,
+        pageSize: 10,
+      },
+      dataListAllSelections: [], // 所有选中的数据包含跨页数据
+      idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
+      dataList: [],
+      total: 0,
+      orders: [],
+      loading: false,
+      visible: false,
+      selectedRows:[]
+    };
+  },
+  props: {
+    selectData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    // 是否启用单选
+    single: {
+      type: Boolean,
+      default: true
+    }
+  },
+  methods: {
+    init(val) {
+      this.visible = true;
+      this.searchForm.isSync = val
+      this.$nextTick(() => {
+        this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
+        this.resetSearch();
+      });
+    },
+    // 获取数据列表
+    refreshList() {
+      this.loading = true;
+      // axios({
+      //   url: "http://172.16.62.241:8000/drp-admin/system/material/list", // 自己的接口路径
+      //   method: "post",
+      //   data: {
+      //     // current: this.pageNo,
+      //     size: this.pageSize,
+      //     // orders: this.orders,
+      //     // ...this.searchForm,
+      //   },
+      let params = {
+        ...this.searchForm,
+        // 默认查询已启用
+        isEnable: '0'
+      }
+      getMaterialList(params).then(({ data }) => {
+        console.log('data', data)
+        this.dataList = data.tableBody.rows;
+        this.total = data.tableBody.total;
+        this.loading = false;
+        this.$nextTick(() => {
+          this.setSelectRow();
+        });
+      });
+    },
+    // 每页数
+    sizeChangeHandle(val) {
+      console.log('每页数:', val)
+      this.searchForm.pageSize = val;
+      this.refreshList();
+    },
+    // 当前页
+    currentChangeHandle(val) {
+      console.log('当前页:', val)
+      this.searchForm.pageNo = val;
+      this.refreshList();
+    },
+    // 排序
+    resetSearch() {
+      this.$refs['searchForm'].resetFields();
+      this.searchForm.pageNo = 1;
+      this.refreshList();
+    },
+    watchSel(rows) {
+      console.log('监听得到选中吗', rows)
+      this.dataListAllSelections = rows
+    },
+    // 表格选中数据
+    rowSelect(row) {
+      // this.$refs.contractTable.clearSelection();
+      // this.$refs.contractTable.toggleRowSelection(row);
+      // this.dataListAllSelections = this.single ? [row] : selection
+      this.$refs.contractTable.toggleRowSelection(row);
+    },
+    // 选中数据
+    handleSelectionChange(selection, row) {
+      console.log('selection',selection)
+      console.log('row',[row])
+      if (this.single && selection.length > 1) {
+        this.$refs.contractTable.clearSelection();
+        this.$refs.contractTable.toggleRowSelection(row);
+      }
+      this.dataListAllSelections = this.single ? [row] : selection
+    },
+    // 设置选中的方法
+    setSelectRow() {
+      this.$refs.contractTable.clearSelection();
+      if (!this.dataListAllSelections || this.dataListAllSelections.length <= 0) {
+        return;
+      }
+      for (let i = 0; i < this.dataList.length; i++) {
+        if (this.dataListAllSelections.some(item => item[this.idKey] == this.dataList[i][this.idKey])) {
+          // 设置选中,记住table组件需要使用ref="table"
+          this.$refs.contractTable.toggleRowSelection(this.dataList[i], true);
+        }
+      }
+    },
+    doSubmit() {
+      this.visible = false;
+      console.log('选择的数据?', this.dataListAllSelections)
+      this.$emit("doSubmit", this.dataListAllSelections);
+    },
+  },
+};
+</script>
+<style lang="scss">
+.userDialog {
+  .el-dialog__body {
+    padding: 10px 0px 0px 10px;
+    color: #606266;
+    font-size: 14px;
+    word-break: break-all;
+  }
+
+  .el-main {
+    padding: 20px 20px 5px 20px;
+
+    .el-pagination {
+      margin-top: 5px;
+    }
+  }
+}
+</style>

+ 6 - 0
src/views/material/changeApply/columns.js

@@ -28,6 +28,12 @@ export default function useColumns() {
       attr: {  },
     },
     { item: { key: "updateTime", title: "最后修改时间" }, attr: {} },
+    
+    { 
+      item:{ key: "approveUser", title: "当前审批人" ,},
+      attr:{
+      },
+    },
    
   ].map(({ item, attr }) => ({
     attr,

+ 152 - 145
src/views/material/changeApply/index.vue

@@ -1,11 +1,13 @@
 <template>
-
-  <el-card 
-    v-loading="loading" 
-    style="width: calc(100% - 24px); height: 100%; margin: 10px;padding: 10px;" 
-    :body-style="{ padding: 0 }"
+  <el-card
+    v-loading="loading"
+    :body-style="{
+      height: '100%',
+      padding: 0,
+      display: 'flex',
+      'flex-direction': 'column',
+    }"
   >
-
     <AddChangeOrders
       ref="addChangeOrders"
       :size="size"
@@ -20,135 +22,138 @@
       @success="useReset"
     ></SeeChangeOrders>
 
-    <div>
-
-      <el-super-search
-        v-model="params"
-        :size="size"
-        :dict="dict"
-        :columns="SearchColumns"
-        @reset="useReset"
-        @row-dblclick="useSee"
-        @submit="useQuery(params, page)"
-      ></el-super-search>
-
-      <el-row 
-        :gutter="10" 
-        class="mb10" 
-        type="flex" 
-        justify="end"
-        style="margin-top: 20px;"
-      >
-        <el-col :span="1.5">
-          <el-button type="primary" size="mini" @click="newAdd">新增</el-button>
-          <!-- <BatchImport></BatchImport> -->
-        </el-col>
-      </el-row>
-
-      <!-- <div style="height: 600px; display:flex;"> -->
-        <el-super-ux-table
-          v-model="tableList"
-          :dict="dict"
-          :size="size"
-          pagination
-          :page="page"
-          :height="tableHeight"
-          :columns="TableColumns"
-          @pagination="useQuery(params, page)"
-          @row-dblclick="useSee"
-        >
-          <ux-table-column fixed="right" title="操作" width="180" align="center">
-            <template slot-scope="scope">
-              <el-button type="text" size="small" @click.stop="useSee(scope.row)">查看</el-button>
-              <el-button 
-                v-if="scope.row.status == '1'" 
-                type="text" 
-                size="mini"
-                @click.stop="handleBack(scope.row)"
-              >收回</el-button>
-              <el-button  
-                v-if="scope.row.oaId && scope.row.oaId !=''" 
-                @click.stop="jumpFlow(scope.row)" 
-                type="text"
-                :size="size"
-              >流程跳转</el-button>
-              <el-button @click.stop="handleEdit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
-              <el-button type="text" size="small" @click.stop="deleteRow(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3">删除</el-button>
-            </template>
-          </ux-table-column>
-        </el-super-ux-table>
-      <!-- </div> -->
-    </div>
-</el-card>
+    <el-super-search
+      v-model="params"
+      :size="size"
+      :dict="dict"
+      :columns="SearchColumns"
+      @reset="useReset"
+      @row-dblclick="useSee"
+      @submit="useQuery(params, page)"
+    ></el-super-search>
+
+    <el-row
+      :gutter="10"
+      class="mb10"
+      type="flex"
+      justify="end"
+      style="margin-top: 20px"
+    >
+      <el-col :span="1.5">
+        <el-button type="primary" size="mini" @click="newAdd">新增</el-button>
+        <!-- <BatchImport></BatchImport> -->
+      </el-col>
+    </el-row>
 
+    <el-super-ux-table
+      v-model="tableList"
+      :dict="dict"
+      :size="size"
+      pagination
+      :page="page"
+      :columns="TableColumns"
+      storage-key="MaterialApplySuperTable"
+      @pagination="useQuery(params, page)"
+      @row-dblclick="useSee"
+    >
+      <ux-table-column fixed="right" title="操作" width="180" align="center">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" @click.stop="useSee(scope.row)"
+            >查看</el-button
+          >
+          <el-button
+            v-if="scope.row.status == '1'"
+            type="text"
+            size="mini"
+            @click.stop="handleBack(scope.row)"
+            >收回</el-button
+          >
+          <el-button
+            v-if="scope.row.oaId && scope.row.oaId != ''"
+            @click.stop="jumpFlow(scope.row)"
+            type="text"
+            :size="size"
+            >流程跳转</el-button
+          >
+          <el-button
+            @click.stop="handleEdit(scope.row)"
+            v-if="scope.row.status == 0 || scope.row.status == 3"
+            type="text"
+            size="small"
+            >编辑</el-button
+          >
+          <el-button
+            type="text"
+            size="small"
+            @click.stop="deleteRow(scope.row)"
+            v-if="scope.row.status == 0 || scope.row.status == 3"
+            >删除</el-button
+          >
+        </template>
+      </ux-table-column>
+    </el-super-ux-table>
+  </el-card>
 </template>
 
 <script>
 import { dicts } from "./dicts";
-import { getChangeList , deleteChangeList,toOA} from '@/api/changeApply/basic';
+import { getChangeList, deleteChangeList, toOA } from "@/api/changeApply/basic";
 // 流程收回通用接口
-import {oaBack} from '@/api/requisition/basic';
-import useColumns from './columns';
+import { oaBack } from "@/api/requisition/basic";
+import useColumns from "./columns";
 export default {
-  name: 'changeApply',
-  dicts:[...dicts, 'oa_templete_id'],
+  name: "changeApply",
+  dicts: [...dicts, "oa_templete_id"],
   components: {
-    AddChangeOrders:() => import('./add/index.vue'),
-    SeeChangeOrders:() => import('./see/index.vue'),
-    BatchImport:() => import('./batchImport/index.vue'),
+    AddChangeOrders: () => import("./add/index.vue"),
+    SeeChangeOrders: () => import("./see/index.vue"),
+    BatchImport: () => import("./batchImport/index.vue"),
     ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
     ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
   },
 
-  data(){
-    const {TableColumns,SearchColumns} = useColumns();
+  data() {
+    const { TableColumns, SearchColumns } = useColumns();
     const params = this.$init.params(SearchColumns);
     return {
-      loading:false,
-      size:'mini',
+      loading: false,
+      size: "mini",
       tableList: [],
-      TableColumns:TableColumns,
+      TableColumns: TableColumns,
       page: { pageNum: 1, pageSize: 50, total: 0 },
-      params:params,
-      SearchColumns:SearchColumns,
-      optionType:'add',
-
-
-    }
+      params: params,
+      SearchColumns: SearchColumns,
+      optionType: "add",
+    };
   },
-  methods:{
-    async jumpFlow (row){
-
-      const {name} = this.$store.state.user;
+  methods: {
+    async jumpFlow(row) {
+      const { name } = this.$store.state.user;
 
       try {
+        let { code, msg, oaUrl } = await toOA(name, row.oaId);
 
-        let {code,msg,oaUrl} = await toOA(name,row.oaId);
-
-        if(code == 200){
-          window.open(oaUrl)
+        if (code == 200) {
+          window.open(oaUrl);
         }
-        
       } catch (error) {
-        
-      }finally{
-
+      } finally {
       }
     },
-    
+
     //流程收回
-    async handleBack(row){
-      console.log('row', row)
-      console.log('this.dicts.type', this.dict)
+    async handleBack(row) {
+      console.log("row", row);
+      console.log("this.dicts.type", this.dict);
       try {
         const { msg, code } = await oaBack({
-          fdTemplateId: this.dict.type.oa_templete_id.find(item => {
-            return item.label == "物料变更单"
+          fdTemplateId: this.dict.type.oa_templete_id.find((item) => {
+            return item.label == "物料变更单";
           }).value,
           fdId: row.oaId,
           billCode: row.code,
-          billMaker: row.createBy
+          billMaker: row.createBy,
         });
         if (code === 200) {
           this.$emit("success");
@@ -161,67 +166,61 @@ export default {
       }
     },
 
-    useReset(){
+    useReset() {
       this.page.pageNum = 1;
       this.page.pageSize = 10;
       this.params = this.$init.params(this.SearchColumns);
       this.useQuery(this.params, this.page);
     },
-    
-    // 
+
+    //
     openAddChangeOrders(row) {
-    
-      const {setVisible,fetchItem} = this.$refs.addChangeOrders;
+      const { setVisible, fetchItem } = this.$refs.addChangeOrders;
 
       setVisible(true);
 
       row && fetchItem(row);
     },
 
-    async newAdd(){
-      this.optionType = 'add';
+    async newAdd() {
+      this.optionType = "add";
       await this.openAddChangeOrders();
     },
 
-    async handleEdit(row){  
-      this.optionType = 'edit';
+    async handleEdit(row) {
+      this.optionType = "edit";
       await this.openAddChangeOrders(row);
-
     },
 
-    async useQuery(params,page) {
+    async useQuery(params, page) {
       try {
         this.loading = true;
-        let {code,rows,total} = await getChangeList({...params,...page});
+        let { code, rows, total } = await getChangeList({ ...params, ...page });
         if (code === 200) {
-          this.tableList = rows
+          this.tableList = rows;
           this.page.total = total;
         }
       } catch (error) {
-        
-      }finally{
+      } finally {
         this.loading = false;
       }
     },
-   
 
-    async useSee(row){
-      const {setVisible,fetchItem} = this.$refs.seeChangeOrders;
+    async useSee(row) {
+      const { setVisible, fetchItem } = this.$refs.seeChangeOrders;
       await setVisible(true);
       await fetchItem(row);
-
     },
-    deleteRow(row){
-      this.$confirm('是否删除此条数据?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(async() => {
-
+    deleteRow(row) {
+      this.$confirm("是否删除此条数据?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(async () => {
         try {
-          let {code,msg} = await deleteChangeList({id: row.id});
+          let { code, msg } = await deleteChangeList({ id: row.id });
 
-          if(code == 200){
+          if (code == 200) {
             this.$notify.success({
               // title: '成功',
               message: msg,
@@ -229,23 +228,31 @@ export default {
             await this.useQuery(this.params, this.page);
           }
         } catch (error) {}
-      })
+      });
     },
- 
   },
   computed: {
-      tableHeight:{
-        get(){
-          console.log(window,'window');
-          return window.innerHeight - 220;
-        },
-        set(){},
-      }
+    tableHeight: {
+      get() {
+        console.log(window, "window");
+        return window.innerHeight - 220;
+      },
+      set() {},
     },
-  created(){
-    this.params.code = this.$route.query.billCode
+  },
+  created() {
+    this.params.code = this.$route.query.billCode;
     this.useQuery(this.params, this.page);
   },
-}
+};
+</script>
 
-</script>
+<style scoped lang="scss">
+.el-card {
+  width: calc(100% - 32px);
+  height: calc(100vh - 32px);
+  margin: 16px;
+  padding: 16px;
+  border-radius: 8px;
+}
+</style>

+ 6 - 1
src/views/material/requisition/columns.js

@@ -33,7 +33,12 @@
     { item: { key: "updateTime", title: "最后修改时间" ,width:150,}, attr: {} },
     { item: { key: "reviewedName", title: "最后审批人" ,width:150,}, attr: {} },
      { item: { key: "auditTime", title: "最后审批时间" ,width:150,}, attr: {} },
-    // { item: { key: "orgName", title: "审批语" ,width:150,}, attr: {} },
+     { 
+      item:{ key: "approveUser", title: "当前审批人" ,},
+      attr:{
+      },
+    },
+     // { item: { key: "orgName", title: "审批语" ,width:150,}, attr: {} },
 
 
 

+ 473 - 431
src/views/material/requisition/index.vue

@@ -1,76 +1,107 @@
 <template>
   <div class="requisition" v-loading="failLoad">
     <div class="applyList" v-if="isList">
-     
-      <el-card>
-
-      <el-super-search
-        v-model="params"
-        :size="size"
-        :dict="dict"
-        :columns="SearchColumns"
-        @reset="reset"
-        @submit="getList"
-      ></el-super-search>
-
-      <el-row :gutter="10" class="mb10" type="flex" justify="end" style="margin-top: 15px;">
-        <el-col :span="1.5">
-          <el-button type="primary" :size="size" plain @click="newAdd">新增</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button :size="size" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button type="primary" :size="size" plain
-                     @click="download('/system/apply/material/download',{},'申请单模板.xlsx')">模板下载
-          </el-button>
-        </el-col>
-        <el-col :span="1.5">
-          
-          <el-button-group >
-            <el-button :size="size" @click="handleImport">批量导入</el-button>
-            <!-- <el-button  
+      <el-card
+        :body-style="{
+          height: '100%',
+          padding: 0,
+          display: 'flex',
+          'flex-direction': 'column',
+        }"
+      >
+        <el-super-search
+          v-model="params"
+          :size="size"
+          :dict="dict"
+          :columns="SearchColumns"
+          @reset="reset"
+          @submit="getList"
+        ></el-super-search>
+
+        <el-row
+          :gutter="10"
+          class="mb10"
+          type="flex"
+          justify="end"
+          style="margin-top: 15px"
+        >
+          <el-col :span="1.5">
+            <el-button type="primary" :size="size" plain @click="newAdd"
+              >新增</el-button
+            >
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              :size="size"
+              :disabled="checkedList.length != 1"
+              @click="handleCopy"
+              >复制</el-button
+            >
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              :size="size"
+              plain
+              @click="
+                download(
+                  '/system/apply/material/download',
+                  {},
+                  '申请单模板.xlsx'
+                )
+              "
+              >模板下载
+            </el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button-group>
+              <el-button :size="size" @click="handleImport">批量导入</el-button>
+              <!-- <el-button  
             :size="size"
               @click="handleDownload" 
               v-hasPermi="['system:apply:export']"
             >批量导出</el-button> -->
-            <el-button :size="size" @click="handleBatchSubmit">批量提交</el-button>
-          </el-button-group>
-        </el-col>
-        <!-- 导入弹窗 -->
-        <el-dialog 
-          title="批量导入" 
-          :visible.sync="importData.show" 
-          width="35%" 
-          center
-          :before-close="handlefileDialogColse"
-        >
-          <div class="mb-import">
-            <el-upload 
-              accept=".xls, .xlsx" 
-              ref="upload" 
-              action="#" 
-              :on-remove="handleFileRemove"
-              :file-list="importData.list" 
-              :auto-upload="false" 
-              :on-change="handleChangeFile" 
-              :limit="1"
-              style="text-align: center;"
-            >
-              <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
-              <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
-            </el-upload>
-
-          </div>
-          <span slot="footer">
-        <el-button @click="handleImportData('cancal')">取 消</el-button>
-        <el-button type="primary" @click="handleImportData('confirm')">确 定</el-button>
-      </span>
-        </el-dialog>
-      </el-row>
-
-      <div style="height: 600px;display: flex;">
-        <el-super-table
+              <el-button :size="size" @click="handleBatchSubmit"
+                >批量提交</el-button
+              >
+            </el-button-group>
+          </el-col>
+          <!-- 导入弹窗 -->
+          <el-dialog
+            title="批量导入"
+            :visible.sync="importData.show"
+            width="35%"
+            center
+            :before-close="handlefileDialogColse"
+          >
+            <div class="mb-import">
+              <el-upload
+                accept=".xls, .xlsx"
+                ref="upload"
+                action="#"
+                :on-remove="handleFileRemove"
+                :file-list="importData.list"
+                :auto-upload="false"
+                :on-change="handleChangeFile"
+                :limit="1"
+                style="text-align: center"
+              >
+                <el-button slot="trigger" size="small" type="primary"
+                  >选取文件</el-button
+                >
+                <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
+              </el-upload>
+            </div>
+            <span slot="footer">
+              <el-button @click="handleImportData('cancal')">取 消</el-button>
+              <el-button type="primary" @click="handleImportData('confirm')"
+                >确 定</el-button
+              >
+            </span>
+          </el-dialog>
+        </el-row>
+
+        <el-super-ux-table
           v-model="tableList"
           :dict="dict"
           :columns="TableColumns"
@@ -80,431 +111,442 @@
           checkbox
           convenitentOperation
           :page="pageStatus"
+          storage-key="MaterialRequisitionSuperTable"
           @pagination="getList"
           @row-dblclick="check"
           @selection-change="handleSelectionChange"
           @select="handleSelect"
         >
-          <el-table-column
+          <ux-table-column
             fixed="right"
-            label="操作"
+            title="操作"
             align="center"
             width="180"
           >
             <template slot-scope="scope">
-              <el-button 
-                type="text" 
-                :size="size" 
-                @click.stop="check(scope.row)"
-              >查看</el-button>
-              <el-button 
-                @click.stop="edit(scope.row)" 
-                v-if="scope.row.status == 0 || scope.row.status == 3" 
+              <el-button type="text" :size="size" @click.stop="check(scope.row)"
+                >查看</el-button
+              >
+              <el-button
+                @click.stop="edit(scope.row)"
+                v-if="scope.row.status == 0 || scope.row.status == 3"
                 type="text"
                 :size="size"
-              >编辑</el-button>
-              <el-button 
-                @click.stop="jumpFlow(scope.row)" 
-                v-if="scope.row.oaId && scope.row.oaId !=''" 
+                >编辑</el-button
+              >
+              <el-button
+                @click.stop="jumpFlow(scope.row)"
+                v-if="scope.row.oaId && scope.row.oaId != ''"
                 type="text"
                 :size="size"
-              >流程跳转</el-button>
-              <el-button 
-                type="text" 
+                >流程跳转</el-button
+              >
+              <el-button
+                type="text"
                 :size="size"
                 @click.stop="deleteRow(scope.row)"
                 v-if="scope.row.status == 0 || scope.row.status == 3"
-              >删除</el-button>
-              <el-button 
-                v-if="scope.row.status == '1'" 
-                type="text" 
+                >删除</el-button
+              >
+              <el-button
+                v-if="scope.row.status == '1'"
+                type="text"
                 size="mini"
                 @click.stop="handleBack(scope.row)"
-              >流程收回</el-button>
+                >流程收回</el-button
+              >
             </template>
-          </el-table-column>
-        </el-super-table>
-      </div>
-       
-
+          </ux-table-column>
+        </el-super-ux-table>
       </el-card>
     </div>
 
-    <component 
-      :is="isComponent" 
-      v-model="isList" 
-      :pageStu="page" 
-      :disable="disable" 
-      :row="rowDetail" 
+    <component
+      :is="isComponent"
+      v-model="isList"
+      :pageStu="page"
+      :disable="disable"
+      :row="rowDetail"
       @refresh="getList"
-      v-if="!isList
-    "/>
+      v-if="!isList"
+    />
   </div>
 </template>
 
 <script>
-  import addReq from './add.vue';
-  import {getReqList, delReq, importData, fileImport,betchSubmit,toOA,oaBack} from '@/api/requisition/basic';
-  import {saveAs} from "file-saver";
-  import { blobValidate } from "@/utils/ruoyi";
-  import { SearchColumns, TableColumns } from './columns';
-  import { initDicts } from "@/utils/init.js";
-
-
-  export default {
-    name: 'requisition',
-    dicts:[...initDicts([...SearchColumns,...TableColumns]),'oa_templete_id'],
-    components: {
+import addReq from "./add.vue";
+import {
+  getReqList,
+  delReq,
+  importData,
+  fileImport,
+  betchSubmit,
+  toOA,
+  oaBack,
+} from "@/api/requisition/basic";
+import { saveAs } from "file-saver";
+import { blobValidate } from "@/utils/ruoyi";
+import { SearchColumns, TableColumns } from "./columns";
+import { initDicts } from "@/utils/init.js";
+
+export default {
+  name: "requisition",
+  dicts: [...initDicts([...SearchColumns, ...TableColumns]), "oa_templete_id"],
+  components: {
     addReq,
     ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
-},
-    data() {
-      const params = this.$init.params(SearchColumns);
-      return {
-        failLoad: false,
-        tableList: [],
-        size:'mini',
-        params:params,
-        SearchColumns:SearchColumns,
-        TableColumns:TableColumns,
-        pageStatus: { pageNum: 1, pageSize: 50, total: 0 },
-        queryParams: {
-          billCode: '',
-          name: '',
-          status: '',
-          pageNum: 1,
-          pageSize: 10
+  },
+  data() {
+    const params = this.$init.params(SearchColumns);
+    return {
+      failLoad: false,
+      tableList: [],
+      size: "mini",
+      params: params,
+      SearchColumns: SearchColumns,
+      TableColumns: TableColumns,
+      pageStatus: { pageNum: 1, pageSize: 50, total: 0 },
+      queryParams: {
+        billCode: "",
+        name: "",
+        status: "",
+        pageNum: 1,
+        pageSize: 10,
+      },
+      options: [
+        {
+          value: 0,
+          label: "未提交",
         },
-        options: [{
-          value: 0, label: '未提交'
-        }, {
-          value: 1, label: '审批中'
-        }, {
-          value: 2, label: '已完成'
-        }, {
-          value: 3, label: '已驳回'
-        },],
-        total: 0,
-        // isComponent
-        isComponent: 'addReq',
-        isList: true,
-        // 页面状态
-        page: '',
-        rowDetail: {},
-        disable: false,
-        checkedList: [],
-        importData: {
-          show: false,
-          list: []
+        {
+          value: 1,
+          label: "审批中",
         },
-      }
-    },
-    created() {
-
-    },
-    mounted() {
-      this.params.billCode = this.$route.query.billCode
-      this.getList(this.queryParams)
-    },
-    methods: {
-      // 操作提示弹窗
-    handleConfirmTips(success){
-
-      this.$confirm('是否继续此操作?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-
+        {
+          value: 2,
+          label: "已完成",
+        },
+        {
+          value: 3,
+          label: "已驳回",
+        },
+      ],
+      total: 0,
+      // isComponent
+      isComponent: "addReq",
+      isList: true,
+      // 页面状态
+      page: "",
+      rowDetail: {},
+      disable: false,
+      checkedList: [],
+      importData: {
+        show: false,
+        list: [],
+      },
+    };
+  },
+  created() {},
+  mounted() {
+    this.params.billCode = this.$route.query.billCode;
+    this.getList(this.queryParams);
+  },
+  methods: {
+    // 操作提示弹窗
+    handleConfirmTips(success) {
+      this.$confirm("是否继续此操作?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
           success();
-
-        }).catch(() => {        
-        });
+        })
+        .catch(() => {});
     },
-      // 批量提交
-      async handleBatchSubmit(){
-          let filterList = this.checkedList.filter(item => !(item.status === '0' || item.status === '3') )
-          
-          console.log(filterList,'filterList',this.checkedList.length);
-
-          if(!filterList.length &&  this.checkedList.length){  
-
-            this.handleConfirmTips(async() =>{
-
-              try {
-
-                this.failLoad = true;
+    // 批量提交
+    async handleBatchSubmit() {
+      let filterList = this.checkedList.filter(
+        (item) => !(item.status === "0" || item.status === "3")
+      );
 
-                let ids = this.checkedList.map( item => Number(item.id));
+      console.log(filterList, "filterList", this.checkedList.length);
 
-                let {code,msg} = await betchSubmit({ids});
+      if (!filterList.length && this.checkedList.length) {
+        this.handleConfirmTips(async () => {
+          try {
+            this.failLoad = true;
 
-                if(code == 200){
-                  this.reset();
-                }
-
-                this.$notify({
-                  title: code == 200 ? msg : 'error',
-                  type: code == 200 ? 'success' :'error',
-                  message: code == 200 ?'' :msg,
-                });
+            let ids = this.checkedList.map((item) => Number(item.id));
 
-                } catch (error) {
+            let { code, msg } = await betchSubmit({ ids });
 
-                }finally{
-                this.failLoad = false;
-                }
-
-            })
+            if (code == 200) {
+              this.reset();
+            }
 
-          }else{
-            this.$notify.warning({
-              title: '警告',
-              message: '存在不符合提交条件数据或未选择数据!',
+            this.$notify({
+              title: code == 200 ? msg : "error",
+              type: code == 200 ? "success" : "error",
+              message: code == 200 ? "" : msg,
             });
+          } catch (error) {
+          } finally {
+            this.failLoad = false;
           }
-      },
-
-      async jumpFlow (row){
-
-        const {name} = this.$store.state.user;
-
-        try {
+        });
+      } else {
+        this.$notify.warning({
+          title: "警告",
+          message: "存在不符合提交条件数据或未选择数据!",
+        });
+      }
+    },
 
-          let {code,msg,oaUrl} = await toOA(name,row.oaId);
+    async jumpFlow(row) {
+      const { name } = this.$store.state.user;
 
-          if(code == 200){
-            window.open(oaUrl)
-          }
-          
-        } catch (error) {
-          
-        }finally{
+      try {
+        let { code, msg, oaUrl } = await toOA(name, row.oaId);
 
+        if (code == 200) {
+          window.open(oaUrl);
         }
-      },
-
-      reset() {
-        // this.queryParams.billCode = ''
-        // this.queryParams.name = ''
-        // this.queryParams.status = ''
-        // this.queryParams.pageNum = 1
-        this.pageStatus.pageNum = 1;
-        this.pageStatus.pageSize = 10;
-        this.params = this.$init.params(SearchColumns);
-        this.getList(this.queryParams)
-      },
-      newAdd() {
-        this.isList = false
-        this.isComponent = 'addReq'
-        this.page = 'add'
-        this.disable = false
-      },
-      // 复制
-      handleCopy() {
-        this.isList = false;
-        this.isComponent = 'addReq';
-        this.page = 'copy';
-        this.rowDetail = this.checkedList[0];
-        this.disable = false;
-      },
-      // 导入
-      handleImport() {
-        this.importData.show = true
-      },
-      // 导出
-      handleDownload(){
-        let params = {
-          ...this.params
-        };
-        this.download('/system/apply/material/export', {...params}, `物料申请单${new Date().getTime()}.xlsx`);
-      },
-      // 删除文件
-      handleFileRemove(file, fileList) {
-        // console.log('删除文件', file, 'file', fileList, 'fileList');
-        this.importData.list = fileList;
-      },
-      // 文件发生改变
-      handleChangeFile(file, fileList) {
-        this.importData.list = fileList;
-      },
-      // 导入弹窗操作
-      handleImportData(type) {
-        switch (type) {
-          // 取消
-          case 'cancal':
-            this.importData.list = [];
-            this.importData.show = false;
-            break;
-          // 确认
-          case 'confirm':
-            if (this.importData.list.length) {
-
-              let formData = new FormData();
-
-              formData.append('file', this.importData.list[0].raw);
-              importData(formData).then(res => {
-                if (res.code == 200) {
-                  this.importData.show = false;
-                  this.importData.list = [];
-                  if (res.data.flag) {
-                    this.failLoad = true;
-                    // console.log(res.data.datas)
-                    let param = {failDatas: res.data.datas}
-                    if (null != param) {
+      } catch (error) {
+      } finally {
+      }
+    },
 
-                      fileImport(param).then(res => {
-                        console.log('res',res)
-                        const isBlob = blobValidate(res);
-                        if (isBlob) {
-                          const blob = new Blob([res]);
-                          saveAs(blob, '导入失败的物料申请单数据.xlsx');
-                        }
-                        this.failLoad = false;
-                        this.reset();
-                      })
-                    }
+    reset() {
+      // this.queryParams.billCode = ''
+      // this.queryParams.name = ''
+      // this.queryParams.status = ''
+      // this.queryParams.pageNum = 1
+      this.pageStatus.pageNum = 1;
+      this.pageStatus.pageSize = 10;
+      this.params = this.$init.params(SearchColumns);
+      this.getList(this.queryParams);
+    },
+    newAdd() {
+      this.isList = false;
+      this.isComponent = "addReq";
+      this.page = "add";
+      this.disable = false;
+    },
+    // 复制
+    handleCopy() {
+      this.isList = false;
+      this.isComponent = "addReq";
+      this.page = "copy";
+      this.rowDetail = this.checkedList[0];
+      this.disable = false;
+    },
+    // 导入
+    handleImport() {
+      this.importData.show = true;
+    },
+    // 导出
+    handleDownload() {
+      let params = {
+        ...this.params,
+      };
+      this.download(
+        "/system/apply/material/export",
+        { ...params },
+        `物料申请单${new Date().getTime()}.xlsx`
+      );
+    },
+    // 删除文件
+    handleFileRemove(file, fileList) {
+      // console.log('删除文件', file, 'file', fileList, 'fileList');
+      this.importData.list = fileList;
+    },
+    // 文件发生改变
+    handleChangeFile(file, fileList) {
+      this.importData.list = fileList;
+    },
+    // 导入弹窗操作
+    handleImportData(type) {
+      switch (type) {
+        // 取消
+        case "cancal":
+          this.importData.list = [];
+          this.importData.show = false;
+          break;
+        // 确认
+        case "confirm":
+          if (this.importData.list.length) {
+            let formData = new FormData();
+
+            formData.append("file", this.importData.list[0].raw);
+            importData(formData).then((res) => {
+              if (res.code == 200) {
+                this.importData.show = false;
+                this.importData.list = [];
+                if (res.data.flag) {
+                  this.failLoad = true;
+                  // console.log(res.data.datas)
+                  let param = { failDatas: res.data.datas };
+                  if (null != param) {
+                    fileImport(param).then((res) => {
+                      console.log("res", res);
+                      const isBlob = blobValidate(res);
+                      if (isBlob) {
+                        const blob = new Blob([res]);
+                        saveAs(blob, "导入失败的物料申请单数据.xlsx");
+                      }
+                      this.failLoad = false;
+                      this.reset();
+                    });
                   }
-                  this.$message({
-                    message: res.data.msg,
-                    type: res.data.flag ? 'warning' : 'success'
-                  });
-                } else {
-                  this.$message({
-                    message: res.msg,
-                    type: res.code == 200 ? 'success' : 'warning'
-                  });
                 }
-              })
-            } else {
-              this.$message({
-                message: '请上传文件之后在确认!',
-                type: 'warning'
-              });
-            }
-            break;
-        }
-      },
-      handlefileDialogColse(done){
-        this.importData.list = [];
-        done();
-      },
-      // Select框
-      handleSelect(selection, row) {
-
-        this.checkedList = selection;
-
-        // console.log(this.checkedList, 'this.checkedList');
-
-      },
-      getList(val) {
-        // console.log('val', val)
-        this.failLoad = true;
-        
-        getReqList({...this.params,...this.pageStatus}).then(res => {
-          this.failLoad = false;
-          if (res.code === 200) {
-            this.tableList = res.rows;
-            // this.total = res.total;
-            this.pageStatus.total = res.total;
+                this.$message({
+                  message: res.data.msg,
+                  type: res.data.flag ? "warning" : "success",
+                });
+              } else {
+                this.$message({
+                  message: res.msg,
+                  type: res.code == 200 ? "success" : "warning",
+                });
+              }
+            });
+          } else {
+            this.$message({
+              message: "请上传文件之后在确认!",
+              type: "warning",
+            });
           }
-        })
-        // this.checkedList = [];
-      },
-      // 表格内状态栏判断值
-      statusJug(row) {
-        if (row.status == 0) {
-          return '未提交'
-        } else if (row.status == 1) {
-          return '审批中'
-        } else if (row.status == 2) {
-          return '已完成'
-        } else if (row.status == 3) {
-          return '已驳回'
+          break;
+      }
+    },
+    handlefileDialogColse(done) {
+      this.importData.list = [];
+      done();
+    },
+    // Select框
+    handleSelect(selection, row) {
+      this.checkedList = selection;
+
+      // console.log(this.checkedList, 'this.checkedList');
+    },
+    getList(val) {
+      // console.log('val', val)
+      this.failLoad = true;
+
+      getReqList({ ...this.params, ...this.pageStatus }).then((res) => {
+        this.failLoad = false;
+        if (res.code === 200) {
+          this.tableList = res.rows;
+          // this.total = res.total;
+          this.pageStatus.total = res.total;
         }
-      },
-      //
-      handleSelectionChange(selection) {
-        this.checkedList = selection;
-      },
-      check(row) {
-        console.log('xxxx',this.dict.type)
-        // console.log('查看详情', row)
-        this.isList = false
-        this.isComponent = 'addReq'
-        this.page = 'check'
-        this.rowDetail = row
-        this.disable = true
-      },
-      edit(row) {
-        // console.log('修改先加载详情', row)
-        this.isList = false
-        this.isComponent = 'addReq'
-        this.page = 'edit'
-        this.rowDetail = row
-        this.disable = false
-      },
-      commit(row) {
-        // console.log('row', row)
-      },
-      deleteRow(row) {
-        this.$confirm('是否删除此条数据?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          delReq(row.id).then(res => {
+      });
+      // this.checkedList = [];
+    },
+    // 表格内状态栏判断值
+    statusJug(row) {
+      if (row.status == 0) {
+        return "未提交";
+      } else if (row.status == 1) {
+        return "审批中";
+      } else if (row.status == 2) {
+        return "已完成";
+      } else if (row.status == 3) {
+        return "已驳回";
+      }
+    },
+    //
+    handleSelectionChange(selection) {
+      this.checkedList = selection;
+    },
+    check(row) {
+      console.log("xxxx", this.dict.type);
+      // console.log('查看详情', row)
+      this.isList = false;
+      this.isComponent = "addReq";
+      this.page = "check";
+      this.rowDetail = row;
+      this.disable = true;
+    },
+    edit(row) {
+      // console.log('修改先加载详情', row)
+      this.isList = false;
+      this.isComponent = "addReq";
+      this.page = "edit";
+      this.rowDetail = row;
+      this.disable = false;
+    },
+    commit(row) {
+      // console.log('row', row)
+    },
+    deleteRow(row) {
+      this.$confirm("是否删除此条数据?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          delReq(row.id).then((res) => {
             if (res.code === 200) {
               this.$message({
                 message: res.msg,
-                type: 'success'
+                type: "success",
               });
-              this.getList(this.queryParams)
+              this.getList(this.queryParams);
             }
-          })
-        }).catch(() => {
-        })
-      },
-      // handleSizeChange(val) {
-      //   console.log(`每页 ${val} 条`);
-      //   this.queryParams.pageSize = val
-      //   this.getList(this.queryParams)
-      // },
-      // handleCurrentChange(val) {
-      //   console.log(`当前页: ${val}`);
-      //   this.queryParams.pageNum = val
-      //   this.getList(this.queryParams)
-      // }
-      //流程收回
-      async handleBack(row){
-        try {
-          const { msg, code } = await oaBack({
-            fdTemplateId: this.dict.type.oa_templete_id.find(item => {
-              return item.label == "物料申请单"
-            }).value,
-            fdId: row.oaId,
-            billCode: row.billCode,
-            billMaker: row.createBy
           });
-          if (code === 200) {
-            this.$emit("success");
-            this.$notify.success(msg);
-          }
-        } catch (err) {
-          console.error(err);
-        } finally {
-          this.getList(this.queryParams);
+        })
+        .catch(() => {});
+    },
+    // handleSizeChange(val) {
+    //   console.log(`每页 ${val} 条`);
+    //   this.queryParams.pageSize = val
+    //   this.getList(this.queryParams)
+    // },
+    // handleCurrentChange(val) {
+    //   console.log(`当前页: ${val}`);
+    //   this.queryParams.pageNum = val
+    //   this.getList(this.queryParams)
+    // }
+    //流程收回
+    async handleBack(row) {
+      try {
+        const { msg, code } = await oaBack({
+          fdTemplateId: this.dict.type.oa_templete_id.find((item) => {
+            return item.label == "物料申请单";
+          }).value,
+          fdId: row.oaId,
+          billCode: row.billCode,
+          billMaker: row.createBy,
+        });
+        if (code === 200) {
+          this.$emit("success");
+          this.$notify.success(msg);
         }
-      },
-    }
-  }
+      } catch (err) {
+        console.error(err);
+      } finally {
+        this.getList(this.queryParams);
+      }
+    },
+  },
+};
 </script>
 
 <style scoped lang="scss">
-  .requisition {
-    // height: calc(100vh - 84px);
-    padding: 12px;
-    box-sizing: border-box;
-  }
+.requisition {
+  // height: calc(100vh - 84px);
+  // padding: 12px;
+  // box-sizing: border-box;
+}
+.el-card {
+  width: calc(100% - 32px);
+  height: calc(100vh - 32px);
+  margin: 16px;
+  padding: 16px;
+  border-radius: 8px;
+}
 </style>

+ 186 - 0
src/views/purchase/equipmentData/add.vue

@@ -0,0 +1,186 @@
+<template>
+  <div id="addEquipment">
+    <el-card style="position: relative;">
+      <span>基本信息</span>
+      <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto" :show-message="false">
+        <el-row :gutter="10">
+
+          <el-col :span="1.5">
+            <el-form-item label="物料编码" prop="materialCode">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.materialCode">
+                <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial()"></el-button>
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="物料名称" prop="materialName">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.materialName">
+              </el-input>
+            </el-form-item>
+          </el-col>
+          
+          <el-col :span="1.5">
+            <el-form-item label="设备类别" prop="deviceCategory">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.deviceCategory">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="厂家名称" prop="deviceCategory">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.deviceCategory">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="型号" prop="model">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.model">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="价格" prop="price">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.price">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="省份" prop="province">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.province">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="大区负责人" prop="largeZoneCommander">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.largeZoneCommander">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="业务经理" prop="serviceManager">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.serviceManager">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="售后工程师" prop="afterSalesEngineer">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.afterSalesEngineer">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="参数" prop="parameters">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.parameters">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="备注" prop="parameters">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.parameters">
+              </el-input>
+            </el-form-item>
+          </el-col>
+
+
+        </el-row>
+      </el-form>
+
+      <div class="btn_group">
+        <el-button type="primary" size="mini"  @click="editPage" v-if="sonPageStu == 'check' && row.status == '0'">编辑</el-button>
+        <el-button type="primary" size="mini"  @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
+        <el-button size="mini" plain @click="back">返回</el-button>
+      </div>
+    </el-card>
+
+    <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
+  </div>
+</template>
+
+<script>
+export default {
+  components: {
+    popDialog: () => import("@/components/PopDialog/index2.vue"),
+  },
+  props: ['pageStu','row', 'disable'],
+  model: {
+    prop: 'isList',
+    event: 'jugislist'
+  },
+  data() {
+    return {
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
+      basicForm: {
+        materialCode: '',
+        materialName: '',
+        materialId: '',
+        deviceCategory: '',
+        factoryName: '',
+        model: '',
+        price: '',
+        parameters: '',
+        province: '',
+        largeZoneCommander: '',
+        serviceManager: '',
+        afterSalesEngineer: '',
+        remark: '',
+      },
+      basicRules: {},
+    }
+  },
+  created() {
+    if(this.pageStu == 'check') {
+      console.log('数据', this.row)
+      this.getDetails(this.row)
+    } else if(this.pageStu == 'edit') {
+      this.getDetails(this.row)
+    } else if (this.pageStu == 'add') {
+
+    }
+  },
+  methods: {
+    getDetails() {
+
+    },
+    editPage() {},
+    save() {},
+    back() {
+      this.$emit('jugislist', true)
+      this.$emit('refresh')
+    },
+    // 选择物料编码带出数据
+    chooseMaterial() {
+      // 传0只展示同步NC了的物料
+      this.$refs.materialRefer.init(0)
+    },
+    selectMaterial(selection) {
+      console.log('选中的物料', selection)
+      this.basicForm.materialCode = selection[0].code
+      this.basicForm.materialName = selection[0].name
+      this.basicForm.materialId = selection[0].id
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.btn_group {
+  // width: 100%;
+  // margin: 20px 0;
+  display: flex;
+  justify-content: space-between;
+  position: absolute;
+  top: 10px;right: 20px;
+
+}  
+</style>

+ 279 - 0
src/views/purchase/equipmentData/index.vue

@@ -0,0 +1,279 @@
+<template>
+  <div id="equipmentData">
+    <div v-if="isList">
+      <el-card
+        v-loading="loading"
+        style="position: relative;"
+      >
+      <!-- <span>设备产品数据库</span> -->
+      <el-form class="search_area" label-width="100px">
+        <el-row :gutter="10">
+          <el-col :span="1.5">
+            <el-form-item label="物料编码">
+                <el-input
+                  v-model.trim="params.materialCode"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="物料名称">
+                <el-input
+                  v-model.trim="params.materialName"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="设备类别">
+                <el-input
+                  v-model.trim="params.deviceCategory"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+          </el-col>
+        </el-row>
+
+        <div style="position: absolute;top: 10px;right: 10px;">
+          <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+          <el-button size="mini" plain @click="resetList">重置</el-button>
+        </div>
+      </el-form>
+
+      <div class="btn_grooup">
+        <el-button type="primary" size="mini" @click="addDivision">新增</el-button>
+        <el-button type="primary" size="mini" @click="downLoadMb">下载模板</el-button>
+        <el-button type="primary" size="mini" @click="upload.open = true">导入数据</el-button>
+      </div>
+      <el-super-ux-table
+        v-model="tableData"
+        :size="size"
+        :dict="dict"
+        :page="pageInfo"
+        :height=500
+        :columns="TableColumns"
+        pagination
+        convenitentOperation
+        storage-key="equipmentDataSuperTable"
+        @row-dblclick="useSee"
+        @row-select="useSelect"
+        @pagination="useQuery(params, pageInfo)"
+      >
+        <ux-table-column
+          fixed="right"
+          title="操作"
+          align="center"
+          width="100"
+          >
+          <template slot-scope="scope">
+            <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button>
+          </template>
+        </ux-table-column>
+      </el-super-ux-table>
+      </el-card>
+    </div>
+
+    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="searchList"/>
+
+    <!-- 用户导入对话框 -->
+    <el-dialog title="数据导入" :visible.sync="upload.open" width="400px">
+      <el-upload
+      ref="upload"
+      :limit="1"
+      accept=".xlsx, .xls"
+      :headers="upload.headers"
+      :action="upload.url + '?updateSupport=' + upload.updateSupport"
+      :disabled="upload.isUploading"
+      :on-progress="handleFileUploadProgress"
+      :on-success="handleFileSuccess"
+      :on-error="errorFile"
+      :auto-upload="false"
+      drag
+      >
+      <i class="el-icon-upload"></i>
+      <div class="el-upload__text">
+        将文件拖到此处,或
+        <em>点击上传</em>
+      </div>
+      <!-- <div class="el-upload__tip" slot="tip">
+        <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+      </div> -->
+      <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer">
+      <el-button size="mini" type="primary" @click="submitFileForm">确 定</el-button>
+      <el-button size="mini" @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+// 导入的token
+import { getToken } from "@/utils/auth";
+import { getEquipmentDataList, downLoadMb } from '@/api/purchase/equipmentData.js'
+export default {
+  name: "equipmentData",
+  dicts: [],
+  components: {
+    Add: () => import("./add.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
+  },
+  data() {
+    return {
+      // 导入参数
+      upload: {
+        // 是否显示弹出层(导入)
+        open: false,
+        // 弹出层标题(导入)
+        title: "数据导入",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 1,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/device/origin/importData"
+      },
+      // 页面配置
+      isList: true,
+      // 页面状态
+      page: '',
+      disable: false,
+      rowDetail: {},
+
+      size: "mini",
+      loading: false,
+      params: {
+        materialCode: '',
+        materialName: '',
+        deviceCategory: ''
+      },
+      pageInfo: {
+        pageNum: 1,
+        pageSize: 20,
+        total: 0
+      },
+      tableData: [],
+      selectData: [],
+      // SearchColumns: SearchColumns,
+      TableColumns: [
+        { item: { key: "materialCode", title: "物料编码", width: 150 }, attr: {} },
+        { item: { key: "materialName", title: "物料名称", width: 150 }, attr: {} },
+        { item: { key: "deviceCategory", title: "设备类别", width: 150 }, attr: {} },
+        { item: { key: "factoryName", title: "厂家名称", width: 150 }, attr: {} },
+        { item: { key: "model", title: "型号", width: 150 }, attr: {} },
+        { item: { key: "price", title: "价格", width: 150 }, attr: {} },
+        { item: { key: "parameters", title: "参数", width: 150 }, attr: {} },
+        { item: { key: "province", title: "省份", width: 150 }, attr: {} },
+        { item: { key: "largeZoneCommander", title: "大区负责人", width: 150 }, attr: {} },
+        { item: { key: "serviceManager", title: "业务经理", width: 150 }, attr: {} },
+        { item: { key: "afterSalesEngineer", title: "售后工程师", width: 150 }, attr: {} },
+        { item: { key: "remark", title: "备注", width: 150 }, attr: {} },
+      ],
+    }
+  },
+  created() {
+    this.useQuery(this.params, this.pageInfo)
+  },
+  methods: {
+    useSee() {},
+    useSelect() {},
+    // 加载列表
+    async useQuery(prop, page) {
+      let params = {...prop, ...page}
+      await getEquipmentDataList(params).then(res => {
+        if( res.code === 200 ) {
+          this.tableData = res.rows
+          this.pageInfo.total = res.total
+        }
+      })
+    },
+    // 新增
+    addDivision() {
+      this.isList = false
+      this.page = 'add'
+      this.disable = false
+    },
+    // 下载模板
+    async downLoadMb() {
+      this.$modal.loading("正在下载模板,请稍后...");
+      downLoadMb().then(res => {
+        this.$modal.closeLoading();
+        const blob = new Blob([res], {
+          type: "application/vnd.ms-excel;charset=UTF-8",
+        });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+        const downloadElement = document.createElement("a"); //创建a标签
+        const href = window.URL.createObjectURL(blob); // 创建下载的链接
+        // var temp = res.headers["content-disposition"]; 
+        // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+        // var name = fileName.split(";")[0]; //切割成文件名
+        downloadElement.href = href;  //下载地址
+        downloadElement.download = '设备产品数据库模板'+ this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
+        document.body.appendChild(downloadElement);
+        downloadElement.click(); // 点击下载
+        document.body.removeChild(downloadElement); // 下载完成移除元素
+        window.URL.revokeObjectURL(href); // 释放blob对象
+        this.download.open = false
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+      this.$modal.loading("正在导入数据,请稍后...");
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.$modal.closeLoading();
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+      this.useQuery(this.params, this.pageInfo)
+    },
+    errorFile(err) {
+      this.$modal.closeLoading();
+      this.$modal.notifyError("文件已变动,请重新上传");
+    },
+        // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    searchList() {
+      this.useQuery(this.params, this.pageInfo)
+    },
+    resetList() {
+      this.params = {
+        materialCode: '',
+        materialName: '',
+        deviceCategory: '',
+      }
+      this.useQuery(this.params, this.pageInfo)
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+#equipmentData {
+  padding: 12px;
+  box-sizing: border-box;
+  overflow-y: scroll;
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+</style>

+ 248 - 248
src/views/purchase/purchase-order/add/column.js

@@ -614,130 +614,130 @@ const PurchaseTabColumns =[
       },
     ]
   },
-  {
-    title: '执行结果',
-    key: 'puOrderExecuteList',
-    tableColumns: [
-      // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
-      {
-        key: "rowno",
-        title: "行号",
-        inputType: "Input",
-        disabled:true,
-        require:false,
-      },
-      {
-        key: "materialName",
-        title: "物料",
-        inputType: "PopoverSelect",
-        width: 180,
-        require: true,
-        valueKey: "id",
-        referName: "MATERIAL_PARAM",
-        dataMapping: {
-          material: "id",
-          materialName: "name",
-          materialCode: "code",
-          // materialClassify:'classifyIdName',
-          materialManufacturersCode:'manufacturersMaterialCode',
-          specification:'specification',
-          model:'model',
-          isMedcine:'isMedicine',
-          manufacturer:'manufacturerId',
-          manufacturerName:'manufacturerIdName',
-          unit:'unitId',
-          unitName:'unitIdName',
-          // tax:'materialRateName',
-          storageCondition:'storageCondition',
-          carriageCondition:'transportationCondition',
-          materialClassifyOneName:'oneClass',
-          materialClassifyTwoName:'twoClass',
-          materialClassifyThreeName:'threeClass',
-          materialClassifyFourName:'fourClass',
-          registration:'registrationNo',
-          isDrug:'isDrug',
-        },
-        queryParams: () => ({}),
-        width:180,
-      },
-      {
-        key: "specification",
-        title: "规格",
-        inputType: "Input",
-        disabled:true,
-        readonly:true,
-      },
-      {
-        key: "qty",
-        title: "数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        require: true,
-        isSummary:true,
-      },
-      {
-        key: "stroageQty",
-        title: "累计到货主数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        isSummary:true,
-      },
-      {
-        key: "stockQty",
-        title: "累计入库主数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        isSummary:true,
-      },
-      {
-        key: "invoiceQty",
-        title: "累计开票主数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        isSummary:true,
-      },
-      {
-        key: "rollbackQty",
-        title: "累计退货主数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        isSummary:true,
-      },
-      {
-        key: "backStockQty",
-        title: "累计退库主数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        isSummary:true,
-      },
-      {
-        key: "floatQty",
-        title: "未到货数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        isSummary:true,
-      },
-      // {
-      //   key: "createByName",
-      //   title: "创建人",
-      //   inputType: "Input",
-      //   width: 120
-      // },
-      // {
-      //   key: "updateByName",
-      //   title: "更新人",
-      //   inputType: "Input",
-      //   width: 120
-      // },
-    ]
-  },
+  // {
+  //   title: '执行结果',
+  //   key: 'puOrderExecuteList',
+  //   tableColumns: [
+  //     // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
+  //     {
+  //       key: "rowno",
+  //       title: "行号",
+  //       inputType: "Input",
+  //       disabled:true,
+  //       require:false,
+  //     },
+  //     {
+  //       key: "materialName",
+  //       title: "物料",
+  //       inputType: "PopoverSelect",
+  //       width: 180,
+  //       require: true,
+  //       valueKey: "id",
+  //       referName: "MATERIAL_PARAM",
+  //       dataMapping: {
+  //         material: "id",
+  //         materialName: "name",
+  //         materialCode: "code",
+  //         // materialClassify:'classifyIdName',
+  //         materialManufacturersCode:'manufacturersMaterialCode',
+  //         specification:'specification',
+  //         model:'model',
+  //         isMedcine:'isMedicine',
+  //         manufacturer:'manufacturerId',
+  //         manufacturerName:'manufacturerIdName',
+  //         unit:'unitId',
+  //         unitName:'unitIdName',
+  //         // tax:'materialRateName',
+  //         storageCondition:'storageCondition',
+  //         carriageCondition:'transportationCondition',
+  //         materialClassifyOneName:'oneClass',
+  //         materialClassifyTwoName:'twoClass',
+  //         materialClassifyThreeName:'threeClass',
+  //         materialClassifyFourName:'fourClass',
+  //         registration:'registrationNo',
+  //         isDrug:'isDrug',
+  //       },
+  //       queryParams: () => ({}),
+  //       width:180,
+  //     },
+  //     {
+  //       key: "specification",
+  //       title: "规格",
+  //       inputType: "Input",
+  //       disabled:true,
+  //       readonly:true,
+  //     },
+  //     {
+  //       key: "qty",
+  //       title: "数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       require: true,
+  //       isSummary:true,
+  //     },
+  //     {
+  //       key: "stroageQty",
+  //       title: "累计到货主数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       isSummary:true,
+  //     },
+  //     {
+  //       key: "stockQty",
+  //       title: "累计入库主数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       isSummary:true,
+  //     },
+  //     {
+  //       key: "invoiceQty",
+  //       title: "累计开票主数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       isSummary:true,
+  //     },
+  //     {
+  //       key: "rollbackQty",
+  //       title: "累计退货主数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       isSummary:true,
+  //     },
+  //     {
+  //       key: "backStockQty",
+  //       title: "累计退库主数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       isSummary:true,
+  //     },
+  //     {
+  //       key: "floatQty",
+  //       title: "未到货数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       isSummary:true,
+  //     },
+  //     // {
+  //     //   key: "createByName",
+  //     //   title: "创建人",
+  //     //   inputType: "Input",
+  //     //   width: 120
+  //     // },
+  //     // {
+  //     //   key: "updateByName",
+  //     //   title: "更新人",
+  //     //   inputType: "Input",
+  //     //   width: 120
+  //     // },
+  //   ]
+  // },
 ];
 
 // 事业发展部
@@ -1404,130 +1404,130 @@ const CauseTabColumns =[
 
     ]
   },
-  {
-    title: '执行结果',
-    key: 'puOrderExecuteList',
-    tableColumns: [
-      // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
-      {
-        key: "rowno",
-        title: "行号",
-        inputType: "Input",
-        disabled:true,
-        require:false,
-      },
-      {
-        key: "materialName",
-        title: "物料",
-        inputType: "PopoverSelect",
-        width: 180,
-        require: true,
-        valueKey: "id",
-        referName: "MATERIAL_PARAM",
-        dataMapping: {
-          material: "id",
-          materialName: "name",
-          materialCode: "code",
-          // materialClassify:'classifyIdName',
-          materialManufacturersCode:'manufacturersMaterialCode',
-          specification:'specification',
-          model:'model',
-          isMedcine:'isMedicine',
-          manufacturer:'manufacturerId',
-          manufacturerName:'manufacturerIdName',
-          unit:'unitId',
-          unitName:'unitIdName',
-          // tax:'materialRateName',
-          storageCondition:'storageCondition',
-          carriageCondition:'transportationCondition',
-          materialClassifyOneName:'oneClass',
-          materialClassifyTwoName:'twoClass',
-          materialClassifyThreeName:'threeClass',
-          materialClassifyFourName:'fourClass',
-          registration:'registrationNo',
-          isDrug:'isDrug',
-        },
-        queryParams: () => ({}),
-        width:180,
-      },
-      {
-        key: "specification",
-        title: "规格",
-        inputType: "Input",
-        disabled:true,
-        readonly:true,
-      },
-      {
-        key: "qty",
-        title: "数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        require: true,
-        isSummary:true,
-      },
-      {
-        key: "stroageQty",
-        title: "累计到货主数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        isSummary:true,
-      },
-      {
-        key: "stockQty",
-        title: "累计入库主数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        isSummary:true,
-      },
-      {
-        key: "invoiceQty",
-        title: "累计开票主数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        isSummary:true,
-      },
-      {
-        key: "rollbackQty",
-        title: "累计退货主数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        isSummary:true,
-      },
-      {
-        key: "backStockQty",
-        title: "累计退库主数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        isSummary:true,
-      },
-      {
-        key: "floatQty",
-        title: "未到货数量",
-        inputType: "InputNumber",
-        controlsPosition: "right",
-        width: 180,
-        isSummary:true,
-      },
-      // {
-      //   key: "createByName",
-      //   title: "创建人",
-      //   inputType: "Input",
-      //   width: 120
-      // },
-      // {
-      //   key: "updateByName",
-      //   title: "更新人",
-      //   inputType: "Input",
-      //   width: 120
-      // },
-    ]
-  },
+  // {
+  //   title: '执行结果',
+  //   key: 'puOrderExecuteList',
+  //   tableColumns: [
+  //     // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
+  //     {
+  //       key: "rowno",
+  //       title: "行号",
+  //       inputType: "Input",
+  //       disabled:true,
+  //       require:false,
+  //     },
+  //     {
+  //       key: "materialName",
+  //       title: "物料",
+  //       inputType: "PopoverSelect",
+  //       width: 180,
+  //       require: true,
+  //       valueKey: "id",
+  //       referName: "MATERIAL_PARAM",
+  //       dataMapping: {
+  //         material: "id",
+  //         materialName: "name",
+  //         materialCode: "code",
+  //         // materialClassify:'classifyIdName',
+  //         materialManufacturersCode:'manufacturersMaterialCode',
+  //         specification:'specification',
+  //         model:'model',
+  //         isMedcine:'isMedicine',
+  //         manufacturer:'manufacturerId',
+  //         manufacturerName:'manufacturerIdName',
+  //         unit:'unitId',
+  //         unitName:'unitIdName',
+  //         // tax:'materialRateName',
+  //         storageCondition:'storageCondition',
+  //         carriageCondition:'transportationCondition',
+  //         materialClassifyOneName:'oneClass',
+  //         materialClassifyTwoName:'twoClass',
+  //         materialClassifyThreeName:'threeClass',
+  //         materialClassifyFourName:'fourClass',
+  //         registration:'registrationNo',
+  //         isDrug:'isDrug',
+  //       },
+  //       queryParams: () => ({}),
+  //       width:180,
+  //     },
+  //     {
+  //       key: "specification",
+  //       title: "规格",
+  //       inputType: "Input",
+  //       disabled:true,
+  //       readonly:true,
+  //     },
+  //     {
+  //       key: "qty",
+  //       title: "数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       require: true,
+  //       isSummary:true,
+  //     },
+  //     {
+  //       key: "stroageQty",
+  //       title: "累计到货主数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       isSummary:true,
+  //     },
+  //     {
+  //       key: "stockQty",
+  //       title: "累计入库主数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       isSummary:true,
+  //     },
+  //     {
+  //       key: "invoiceQty",
+  //       title: "累计开票主数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       isSummary:true,
+  //     },
+  //     {
+  //       key: "rollbackQty",
+  //       title: "累计退货主数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       isSummary:true,
+  //     },
+  //     {
+  //       key: "backStockQty",
+  //       title: "累计退库主数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       isSummary:true,
+  //     },
+  //     {
+  //       key: "floatQty",
+  //       title: "未到货数量",
+  //       inputType: "InputNumber",
+  //       controlsPosition: "right",
+  //       width: 180,
+  //       isSummary:true,
+  //     },
+  //     // {
+  //     //   key: "createByName",
+  //     //   title: "创建人",
+  //     //   inputType: "Input",
+  //     //   width: 120
+  //     // },
+  //     // {
+  //     //   key: "updateByName",
+  //     //   title: "更新人",
+  //     //   inputType: "Input",
+  //     //   width: 120
+  //     // },
+  //   ]
+  // },
 ];
 // export const initTabColumns = () => tabColumns;
 

+ 52 - 30
src/views/purchase/purchase-order/add/index.vue

@@ -57,7 +57,8 @@ export default {
       params: {
         ...initParams(NewColumns),
         puOrderItemList: [],
-        puOrderExecuteList: [],
+        // 执行结果
+        // puOrderExecuteList: [],
       },
       tabColumns: NewTabColumns,
       tabName: "puOrderItemList",
@@ -91,26 +92,28 @@ export default {
     },
   },
   watch: {
-    "params.puOrderItemList": {
-      handler(nVal, oVal) {
-        this.visible &&
-          this.handleSynchronousMaterial(
-            "puOrderItemList",
-            "puOrderExecuteList"
-          );
-      },
-      deep: true,
-    },
-    "params.puOrderExecuteList": {
-      handler(nVal, oVal) {
-        this.visible &&
-          this.handleSynchronousMaterial(
-            "puOrderExecuteList",
-            "puOrderItemList"
-          );
-      },
-      deep: true,
-    },
+    // 同步物料信息与执行结果
+    // "params.puOrderItemList": {
+    //   handler(nVal, oVal) {
+    //     this.visible &&
+    //       this.handleSynchronousMaterial(
+    //         "puOrderItemList",
+    //         "puOrderExecuteList"
+    //       );
+    //   },
+    //   deep: true,
+    // },
+    // 执行结果监听
+    // "params.puOrderExecuteList": {
+    //   handler(nVal, oVal) {
+    //     this.visible &&
+    //       this.handleSynchronousMaterial(
+    //         "puOrderExecuteList",
+    //         "puOrderItemList"
+    //       );
+    //   },
+    //   deep: true,
+    // },
     "params.billType": {
       handler(nVal, oVal) {
         // let billList = ['21-Cxx-02','21-Cxx-04','21-Cxx-10','21-Cxx-14','21-Cxx-09','21-Cxx-17','21-Cxx-18'];
@@ -137,6 +140,23 @@ export default {
         this.count++;
       },
     },
+    "params.isBack": {
+      handler(nVal, oVal) {
+        console.log(nVal, "val");
+        if (nVal === "Y") {
+          this.rules.retReasonName = [
+            { required: true, message: "退换原因不能为空", trigger: "change" },
+          ];
+          this.rules.processTypeName = [
+            { required: true, message: "处理方式不能为空", trigger: "change" },
+          ];
+        } else {
+          this.rules.retReasonName = null;
+          this.rules.processTypeName = null;
+        }
+        this.count++;
+      },
+    },
   },
   methods: {
     beforeOpen() {
@@ -209,7 +229,8 @@ export default {
 
           for (const key in this.params) {
             // if (Array.isArray(this.params[key])) {
-            if (key === "puOrderItemList" || key === "puOrderExecuteList") {
+            // if (key === "puOrderItemList" || key === "puOrderExecuteList") {
+            if (key === "puOrderItemList") {
               this.params[key].forEach((v) => {
                 v.id = "";
                 v.demandCode = "";
@@ -234,7 +255,8 @@ export default {
     addTableRow(prop) {
       for (const key in this.params) {
         // if (Array.isArray(this.params[key])) {
-        if (key === "puOrderItemList" || key === "puOrderExecuteList") {
+        // if (key === "puOrderItemList" || key === "puOrderExecuteList") {
+        if (key === "puOrderItemList") {
           const arr = this.tabColumns.find(
             (element) => element.key === key
           ).tableColumns;
@@ -344,7 +366,7 @@ export default {
       this.params = {
         ...initParams(this.columns),
         puOrderItemList: [],
-        puOrderExecuteList: [],
+        // puOrderExecuteList: [],
       };
       this.setVisible(false);
     },
@@ -353,8 +375,8 @@ export default {
       this.$refs["orderAddForm"].validate(async (valid) => {
         if (valid) {
           if (
-            !this.params["puOrderItemList"].length ||
-            !this.params["puOrderExecuteList"].length
+            !this.params["puOrderItemList"].length
+            // || !this.params["puOrderExecuteList"].length
           ) {
             this.$notify.error({
               title: "错误",
@@ -590,7 +612,7 @@ export default {
         this.handleGetPrice();
       }
       this.$refs.puOrderItemList[0].updateFooter();
-      this.$refs.puOrderExecuteList[0].updateFooter();
+      // this.$refs.puOrderExecuteList[0].updateFooter();
 
       // if(this.role === 'syfz-purchaseorder' && row.material && (type == "qty" ||type === "taxPrice" )){
 
@@ -638,7 +660,7 @@ export default {
 
         let tabList = {
           puOrderItemList: [...this.params.puOrderItemList],
-          puOrderExecuteList: [...this.params.puOrderExecuteList],
+          // puOrderExecuteList: [...this.params.puOrderExecuteList],
         };
 
         const blob = new Blob([JSON.stringify(tabList)], {
@@ -757,8 +779,8 @@ export default {
   mounted() {},
   updated() {
     this.$nextTick(() => {
-      this.$refs.puOrderExecuteList &&
-        this.$refs.puOrderExecuteList[0].doLayout();
+      // this.$refs.puOrderExecuteList &&
+      //   this.$refs.puOrderExecuteList[0].doLayout();
       this.$refs.puOrderItemList && this.$refs.puOrderItemList[0].doLayout();
     });
   },

+ 423 - 95
src/views/purchase/purchase-order/column.js

@@ -1,6 +1,6 @@
 import Cookies from "js-cookie";
 
-// 集采中心
+// 集采中心-新修
 const PurColumns = [
   { 
     item:{ 
@@ -111,6 +111,24 @@ const PurColumns = [
     width:100,
   },
   { 
+    item:{ key: "approveUser", title: "当前审批人" ,},
+    attr:{
+      isHidden:true,
+    },
+  },
+  { 
+    item:{ key: "redeployName", title: "转派人" , width:100 ,},
+    attr:{
+      isHidden:true,
+    },
+  },
+  { 
+    item:{ key: "redeployDate", title: "转派时间" ,},
+    attr:{
+      isHidden:true,
+    },
+  },
+  { 
     item:{ key: "remark", title: "备注" ,},
     attr:{
       isHidden:true,
@@ -203,7 +221,7 @@ const PurColumns = [
   item: { ...item, hidden: true, fixed: false },
 }));
 
-// 事业发展部
+// 事业发展部(原本格式)
 const CauseColumns = [
   { 
     item:{ 
@@ -683,6 +701,24 @@ const CauseColumns = [
     },
   },
   { 
+    item:{ key: "approveUser", title: "当前审批人" ,},
+    attr:{
+      isHidden:true,
+    },
+  },
+  { 
+    item:{ key: "redeployName", title: "转派人" , width: 100,},
+    attr:{
+      isHidden:true,
+    },
+  },
+  { 
+    item:{ key: "redeployDate", title: "转派时间" ,},
+    attr:{
+      isHidden:true,
+    },
+  },
+  { 
     item:{ key: "remark", title: "备注" ,},
     attr:{
       isHidden:true,
@@ -694,6 +730,298 @@ const CauseColumns = [
   item: { ...item, hidden: true, fixed: false },
 }));
 
+// 集采中心
+const PurTabColumns = [
+
+  {
+    title: '物料信息',
+    key: 'puOrderItemList',
+    tableColumns: [
+      { 
+        item:{key: "customerName", title: "收货客户" ,width:100,},
+        attr:{
+          isHidden:true,
+        },
+      },
+      { 
+        item:{
+          key: "rowNo", title: "行号",width:80,},
+        attr:{
+          isHidden:true,
+        },
+      },
+      { 
+        item:{key: "materialCode", title: "物料编码", width:150,  },
+        attr:{
+          isHidden:true,
+        },
+       
+      },
+      { 
+        item:{key: "materialName", title: "物料名称",width:150,  },
+        attr:{
+          isHidden:true,
+        },
+        
+      },
+      { 
+        item:{key: "specification", title: "规格",width:100,  },
+        attr:{
+          isHidden:true,
+        },
+        
+      },
+      { 
+        item:{key: "model", title: "型号",width: 100  },
+        attr:{
+          isHidden:true,
+        },
+      },
+      { 
+        item:{key: "manufacturerName", title: "生产厂家代理人", width:150, },
+        attr:{
+          isHidden:true,
+        },
+      },
+      { 
+        item:{key: "unitName", title: "单位", width: 80 },
+        attr:{
+          isHidden:true,
+        },
+      },
+      { 
+        item:{key: "qty", title: "数量",width:120, },
+        attr:{
+          isHidden:true,
+          isSummary:true,
+        },
+      },
+      { 
+        item:{key: "taxPrice", title: "含税单价" ,width:120,},
+        attr:{
+        },
+      },
+      { 
+        item:{key: "money", title: "价税合计" ,width:120, },
+        attr:{
+          isSummary:true,
+        },
+      },
+      {
+        item:{
+          
+          key: "isGift",
+          title: "赠品",
+          inputType: 'Checkbox',
+          width:80,
+        },
+        attr:{
+          is: "el-checkbox",
+          'true-label':"Y",
+          'false-label':"N",
+          disabled:true,
+        },
+      },
+      { 
+        item:{
+          key: "nitemdiscountrate", 
+          title: "折扣(%)", 
+          width:80, 
+        },
+        attr:{},
+       },
+      { 
+        item:{key: "taxDeductMoneya", title: "折扣金额", width:80,  },
+        attr:{
+          isSummary:true,
+        },
+      },
+      { 
+        item:{key: "discountRule", title: "折扣规则编码", width:100,  },
+        attr:{
+          isHidden:true,
+        },
+      },
+      { 
+        item:{key: "tax", title: "税率" ,width:120, },
+        attr:{
+        },
+      },
+      { 
+        item:{key: "registration", title: "注册证号", width:100, },
+        attr:{
+          isHidden:true,
+        },
+        
+      },
+      { 
+        item:{ key: "demandCode", title:"采购需求单号",width:150,},
+        attr:{
+          isHidden:true,
+        },
+        
+      },
+      {
+        item:{
+          
+          key: "isReplenishment",
+          title: "补单标识",
+          inputType: 'Checkbox',
+          width:80,
+        },
+        attr:{
+          is: "el-checkbox",
+          'true-label':"Y",
+          'false-label':"N",
+          disabled:true,
+        },
+      },
+      { 
+        item:{
+          key: "isUrgency", 
+          title: "紧急标识" ,
+          inputType: 'Checkbox',
+          width:80,
+        },
+        attr:{
+          is: "el-checkbox",
+          'true-label':"Y",
+          'false-label':"N",
+          disabled:true,
+        },
+      },
+      {
+        item:{
+          
+          key: "priceType",
+          title: "价格类型"
+          , width:100,
+        },
+        attr:{
+          is: "el-dict-tag",
+          dictName: "sys_price_type",
+        }
+      },
+      { 
+        item:{
+          
+          key: "isDistributionPrice", 
+          title: "配送价",
+          inputType: 'Checkbox',
+          width:80,
+        },
+        attr:{
+          is: "el-checkbox",
+          'true-label':"Y",
+          'false-label':"N",
+          disabled:true,
+        },
+       },
+       { 
+        item:{key: "unarrivedQty", title: "未到货数量" , width:80,},
+        attr:{
+          isSummary:true,
+        },
+      },
+      {
+        item:{
+          
+          key: "isArrival",
+          title: "到货关闭",
+          inputType: 'Checkbox',
+          width:80,
+        },
+        attr:{
+          is: "el-checkbox",
+          'true-label':"Y",
+          'false-label':"N",
+          disabled:true,
+        },
+      },
+      {
+        item:{
+          key: "isStorage",
+          title: "入库关闭",
+          inputType: 'Checkbox',
+          width:80,
+        },
+        attr:{
+          is: "el-checkbox",
+          'true-label':"Y",
+          'false-label':"N",
+          disabled:true,
+        },
+      },
+      {
+        item:{
+          
+          key: "isPayment",
+          title: "付款关闭",
+          inputType: 'Checkbox',
+          width:80,
+        },
+        attr:{
+          is: "el-checkbox",
+          'true-label':"Y",
+          'false-label':"N",
+          disabled:true,
+        },
+      },
+      {
+        item:{
+          
+          key: "isInvoice",
+          title: "开票关闭",
+          inputType: 'Checkbox',
+          width:80,
+        },
+        attr:{
+          is: "el-checkbox",
+          'true-label':"Y",
+          'false-label':"N",
+          disabled:true,
+        },
+      },
+      {
+        item:{
+          key: "isMedcine",
+          title: "医药物料",
+          width:80,
+        },
+        attr:{
+          is: "el-checkbox",
+          'true-label':"Y",
+          'false-label':"N",
+          disabled:true,
+        },
+      },
+      { 
+        item:{key: "originalQty", title: "原始数量" ,width:80,},
+        attr:{
+          isHidden:true,
+          isSummary:true,
+        },
+      },
+      { 
+        item:{
+          key: "originalMoney", 
+          title: "原始金额" ,
+          width:80,
+        },
+        attr:{
+          isSummary:true,
+        },
+      },
+      
+    ].map(({ item, attr }) => ({
+      attr,
+      item: { ...item, hidden: true, fixed: false },
+    }))
+  },
+  
+];
+
+// 事业发展部
 const CommonTabColumns = [
 
   {
@@ -1260,92 +1588,92 @@ const CommonTabColumns = [
       item: { ...item, hidden: true, fixed: false },
     }))
   },
-  {
-    title: '执行结果',
-    key: 'puOrderExecuteList',
-    tableColumns: [
-      // { item:{key: "orderId", title: "采购订单ID",  },
-      { 
-        item:{key: "rowno", title: "行号",width:80, },
-        attr:{
-          isHidden:true,
-        },
-      },
-      { 
-        item:{key: "material", title: "物料ID", width:1, },
-        attr:{
-          isHidden:true,
-        },
-      },
-      { 
-        item:{key: "materialName", title: "物料名称", width:150, },
-        attr:{
-          isHidden:true,
-        },
-      },
-      { 
-        item:{key: "specification", title: "规格", width:100, },
-        attr:{
-          isHidden:true,
-        },
-      },
-      { 
-        item:{key: "qty", title: "数量",width:120, },
-        attr:{
-          isHidden:true,
-          isSummary:true,
-        },
-      },
-      { 
-        item:{key: "stroageQty", title: "累计到货主数量",width:120,  },
-        attr:{
-          isHidden:true,
-          isSummary:true,
-        },
-      },
-      { 
-        item:{key: "stockQty", title: "累计入库主数量",width:120,  },
-        attr:{
-          isHidden:true,
-          isSummary:true,
-        },
-      },
-      { 
-        item:{key: "invoiceQty", title: "累计开票主数量",width:120,  },
-        attr:{
-          isHidden:true,
-          isSummary:true,
-        },
-      },
-      { 
+  // {
+  //   title: '执行结果',
+  //   key: 'puOrderExecuteList',
+  //   tableColumns: [
+  //     // { item:{key: "orderId", title: "采购订单ID",  },
+  //     { 
+  //       item:{key: "rowno", title: "行号",width:80, },
+  //       attr:{
+  //         isHidden:true,
+  //       },
+  //     },
+  //     { 
+  //       item:{key: "material", title: "物料ID", width:1, },
+  //       attr:{
+  //         isHidden:true,
+  //       },
+  //     },
+  //     { 
+  //       item:{key: "materialName", title: "物料名称", width:150, },
+  //       attr:{
+  //         isHidden:true,
+  //       },
+  //     },
+  //     { 
+  //       item:{key: "specification", title: "规格", width:100, },
+  //       attr:{
+  //         isHidden:true,
+  //       },
+  //     },
+  //     { 
+  //       item:{key: "qty", title: "数量",width:120, },
+  //       attr:{
+  //         isHidden:true,
+  //         isSummary:true,
+  //       },
+  //     },
+  //     { 
+  //       item:{key: "stroageQty", title: "累计到货主数量",width:120,  },
+  //       attr:{
+  //         isHidden:true,
+  //         isSummary:true,
+  //       },
+  //     },
+  //     { 
+  //       item:{key: "stockQty", title: "累计入库主数量",width:120,  },
+  //       attr:{
+  //         isHidden:true,
+  //         isSummary:true,
+  //       },
+  //     },
+  //     { 
+  //       item:{key: "invoiceQty", title: "累计开票主数量",width:120,  },
+  //       attr:{
+  //         isHidden:true,
+  //         isSummary:true,
+  //       },
+  //     },
+  //     { 
         
-        item:{key: "rollbackQty", title: "累计退货主数量",width:120,  },
-        attr:{
-          isHidden:true,
-          isSummary:true,
-        },
-      },
-      { 
-        item:{key: "backStockQty", title: "累计退库主数量",width:120,  },
-        attr:{
-          isHidden:true,
-          isSummary:true,
-        },
-      },
-      { 
-        item:{key: "floatQty", title: "未到货数量",width:120, },
-        attr:{
-          isHidden:true,
-          isSummary:true,
-        },
-      },
-      // { item:{key: "createByName", title: "创建人", },
-      // { item:{key: "updateByName", title: "更新人", },
-    ].map(({ item, attr }) => ({
-      attr,
-      item: { ...item, hidden: true, fixed: false },
-    }))
-  },
+  //       item:{key: "rollbackQty", title: "累计退货主数量",width:120,  },
+  //       attr:{
+  //         isHidden:true,
+  //         isSummary:true,
+  //       },
+  //     },
+  //     { 
+  //       item:{key: "backStockQty", title: "累计退库主数量",width:120,  },
+  //       attr:{
+  //         isHidden:true,
+  //         isSummary:true,
+  //       },
+  //     },
+  //     { 
+  //       item:{key: "floatQty", title: "未到货数量",width:120, },
+  //       attr:{
+  //         isHidden:true,
+  //         isSummary:true,
+  //       },
+  //     },
+  //     // { item:{key: "createByName", title: "创建人", },
+  //     // { item:{key: "updateByName", title: "更新人", },
+  //   ].map(({ item, attr }) => ({
+  //     attr,
+  //     item: { ...item, hidden: true, fixed: false },
+  //   }))
+  // },
 ];
 
 export const SearchColumns = [
@@ -1616,17 +1944,17 @@ export const SearchColumns = [
 
 export const judgeColumns = () =>{
 
-  // let Columns =  _.cloneDeep(PurColumns);
-  // let TabColumns =  _.cloneDeep(CommonTabColumns);
+  let Columns =  _.cloneDeep(PurColumns);
+  let TabColumns =  _.cloneDeep(PurTabColumns);
 
-  // let roles =  Cookies.get('roles').split(',');
-  // let role = roles.find(item => item === "syfz-purchaseorder") || "procurementManager";
+  let roles =  Cookies.get('roles').split(',');
+  let role = roles.find(item => item === "syfz-purchaseorder") || "procurementManager";
 
-  // if(role === "syfz-purchaseorder"){
+  if(role === "syfz-purchaseorder"){
     // 事业发展部
-    let Columns =  _.cloneDeep(CauseColumns);
-    let TabColumns =  _.cloneDeep(CommonTabColumns);
-  // }
+    // Columns =  _.cloneDeep(PurColumns);
+    TabColumns =  _.cloneDeep(CommonTabColumns);
+  }
 
   return { Columns,TabColumns }
 

+ 51 - 38
src/views/purchase/purchase-order/edit/index.vue

@@ -31,7 +31,7 @@ export default {
       params: {
         ...initParams(editColumns),
         puOrderItemList: [],
-        puOrderExecuteList: [],
+        // puOrderExecuteList: [],
       },
 
       tabColumns: editTabColumns,
@@ -72,28 +72,28 @@ export default {
       const { id } = this.params;
       // this.fetchTable(id, newProp);
     },
-    "params.puOrderItemList": {
-      handler(nVal, oVal) {
-        this.params.source == 3 &&
-          this.handleSynchronousMaterial(
-            "puOrderItemList",
-            "puOrderExecuteList"
-          );
-      },
-      deep: true,
-      immediate: true,
-    },
-    "params.puOrderExecuteList": {
-      handler(nVal, oVal) {
-        this.params.source == 3 &&
-          this.handleSynchronousMaterial(
-            "puOrderExecuteList",
-            "puOrderItemList"
-          );
-      },
-      deep: true,
-      immediate: true,
-    },
+    // "params.puOrderItemList": {
+    //   handler(nVal, oVal) {
+    //     this.params.source == 3 &&
+    //       this.handleSynchronousMaterial(
+    //         "puOrderItemList",
+    //         "puOrderExecuteList"
+    //       );
+    //   },
+    //   deep: true,
+    //   immediate: true,
+    // },
+    // "params.puOrderExecuteList": {
+    //   handler(nVal, oVal) {
+    //     this.params.source == 3 &&
+    //       this.handleSynchronousMaterial(
+    //         "puOrderExecuteList",
+    //         "puOrderItemList"
+    //       );
+    //   },
+    //   deep: true,
+    //   immediate: true,
+    // },
     "params.billType": {
       handler(nVal, oVal) {
         // let billList = ['21-Cxx-02','21-Cxx-04','21-Cxx-10','21-Cxx-14','21-Cxx-09','21-Cxx-17','21-Cxx-18'];
@@ -114,6 +114,23 @@ export default {
         this.count++;
       },
     },
+    "params.isBack": {
+      handler(nVal, oVal) {
+        console.log(nVal, "val");
+        if (nVal === "Y") {
+          this.rules.retReasonName = [
+            { required: true, message: "退换原因不能为空", trigger: "change" },
+          ];
+          this.rules.processTypeName = [
+            { required: true, message: "处理方式不能为空", trigger: "change" },
+          ];
+        } else {
+          this.rules.retReasonName = null;
+          this.rules.processTypeName = null;
+        }
+        this.count++;
+      },
+    },
   },
   methods: {
     setVisible(prop) {
@@ -186,8 +203,8 @@ export default {
     // 新增行
     addTableRow(prop) {
       for (const key in this.params) {
-        // if (Array.isArray(this.params[key])) {
-        if (key === "puOrderItemList" || key === "puOrderExecuteList") {
+        // if (key === "puOrderItemList" || key === "puOrderExecuteList") {
+        if (key === "puOrderItemList") {
           const arr = this.tabColumns.find(
             (element) => element["key"] === key
           ).tableColumns;
@@ -243,15 +260,11 @@ export default {
         });
       } else {
         for (const key in this.params) {
-          if (key === "puOrderItemList" || key === "puOrderExecuteList") {
+          // if (key === "puOrderItemList" || key === "puOrderExecuteList") {
+          if (key === "puOrderItemList") {
             this.params[key].forEach((item, index) => {
               let flag = key === "puOrderItemList" ? "rowNo" : "rowno";
 
-              // if(item.id && item.id === row.id){
-              //   console.log('删除已有ID的');
-              //   item['delFlag'] = '2';
-              // }
-
               if (item[flag] && item[flag] === row[delNo]) {
                 item.id
                   ? (item["delFlag"] = "2")
@@ -273,7 +286,7 @@ export default {
       this.params = {
         ...initParams(this.columns),
         puOrderItemList: [],
-        puOrderExecuteList: [],
+        // puOrderExecuteList: [],
       };
       this.setVisible(false);
     },
@@ -417,8 +430,8 @@ export default {
       // 组织
       if (type === "ORG_PARAM") {
         for (const key in this.params) {
-          // if (Array.isArray(this.params[key])) {
-          if (key === "puOrderItemList" || key === "puOrderExecuteList") {
+          // if (key === "puOrderItemList" || key === "puOrderExecuteList") {
+          if (key === "puOrderItemList") {
             this.params[key] = [];
           } else if (key === "sysFileRecordList") {
             this.params[key] = [];
@@ -535,7 +548,7 @@ export default {
         }
 
         this.$refs.puOrderItemList[0].updateFooter();
-        this.$refs.puOrderExecuteList[0].updateFooter();
+        // this.$refs.puOrderExecuteList[0].updateFooter();
       }
 
       // // 物料数量变化----询价
@@ -622,7 +635,7 @@ export default {
 
         let tabList = {
           puOrderItemList: [...this.params.puOrderItemList],
-          puOrderExecuteList: [...this.params.puOrderExecuteList],
+          // puOrderExecuteList: [...this.params.puOrderExecuteList],
         };
 
         const blob = new Blob([JSON.stringify(tabList)], {
@@ -734,8 +747,8 @@ export default {
   mounted() {},
   updated() {
     this.$nextTick(() => {
-      this.$refs.puOrderExecuteList &&
-        this.$refs.puOrderExecuteList[0].doLayout();
+      // this.$refs.puOrderExecuteList &&
+      //   this.$refs.puOrderExecuteList[0].doLayout();
       this.$refs.puOrderItemList && this.$refs.puOrderItemList[0].doLayout();
     });
   },

+ 8 - 6
src/views/purchase/purchase-order/index.vue

@@ -32,6 +32,7 @@ export default {
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
     Retrieve: () => import("@/components/Retrieve/index.vue"),
     ZpButton: () => import("./zhuan-pai/index.vue"),
+    ZpjlButton: () => import("./zhuan-pai/record.vue"),
     QueryScheme: () => import("@/components/query-scheme/index.vue"),
   },
   data() {
@@ -722,13 +723,13 @@ export default {
 
         <el-button-group style="margin-left: 10px">
           <el-button
-            type="primary"
+          
             :size="size"
             :disabled="checkedList.length != 1"
             @click="handleCopy"
             >复制</el-button
           >
-          <el-button type="primary" :size="size" @click="handleBatchSubmit"
+          <el-button :size="size" @click="handleBatchSubmit"
             >批量提交</el-button
           >
         </el-button-group>
@@ -738,13 +739,13 @@ export default {
           :key="checkedList.length + 1"
         >
           <el-button
-            type="primary"
+          
             :size="size"
             @click="handleAllReturn"
             :disabled="judgeIsAllReturn()"
             >整单退回</el-button
           >
-          <!-- <el-button type="primary" :size="size" @click="handleAllClose" :disabled="judgeIsAllClose()">整单关闭</el-button> -->
+          <!-- <el-button :size="size" @click="handleAllClose" :disabled="judgeIsAllClose()">整单关闭</el-button> -->
         </el-button-group>
 
         <el-button-group style="margin: 0 10px">
@@ -753,10 +754,10 @@ export default {
             :key="checkedList.length"
             @click="handlePurchaseReturn"
           >采购退货</el-button> -->
-          <el-button type="primary" size="mini" @click="handlePaymentRequest"
+          <el-button size="mini" @click="handlePaymentRequest"
             >付款申请</el-button
           >
-          <el-button type="primary" size="mini" @click="handleDownload"
+          <el-button size="mini" @click="handleDownload"
             >批量导出</el-button
           >
         </el-button-group>
@@ -767,6 +768,7 @@ export default {
             @success="handleQueryList"
           >
           </zp-button>
+          <zpjl-button :size="size" :select-data="checkedList"> </zpjl-button>
         </el-button-group>
       </el-col>
     </el-row>

+ 2 - 2
src/views/purchase/purchase-order/see/index.vue

@@ -49,7 +49,7 @@ export default {
       params: {
         ...initParams(NewColumns),
         puOrderItemList: [],
-        puOrderExecuteList: [],
+        // puOrderExecuteList: [],
       },
 
       tabColumns: NewTabColumns,
@@ -110,7 +110,7 @@ export default {
       this.params = {
         ...initParams(this.columns),
         puOrderItemList: [],
-        puOrderExecuteList: [],
+        // puOrderExecuteList: [],
       };
       this.setVisible(false);
     },

+ 112 - 0
src/views/purchase/purchase-order/zhuan-pai/record.vue

@@ -0,0 +1,112 @@
+<!-- 转派记录 -->
+<script>
+import { RECORD } from "@/api/business/purchase/task";
+export default {
+  name: "Record",
+  props: {
+    selectData: {
+      type: [Array],
+      default: () => [],
+    },
+  },
+  components: {
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
+  },
+  data() {
+    return {
+      title: "转派记录",
+      visible: false,
+      columns: [
+        {
+          item: {
+            title: "转派人名称",
+            key: "redeployName",
+          },
+          attr: {},
+        },
+        {
+          item: {
+            title: "被转派人名称",
+            key: "redeployByName",
+          },
+          attr: {},
+        },
+        {
+          item: {
+            title: "来源单据号",
+            key: "source",
+          },
+          attr: {},
+        },
+        {
+          item: {
+            title: "改派时间",
+            key: "createTime",
+          },
+          attr: {},
+        },
+      ],
+      record: [],
+    };
+  },
+  computed: {
+    disabled: {
+      get() {
+        return this.selectData.length !== 1;
+      },
+      set() {},
+    },
+  },
+  methods: {
+    async open() {
+      try {
+        let { code, rows } = await RECORD({ source: this.selectData[0].code });
+
+        if (code == 200) {
+          this.record = rows;
+
+          rows.length && (this.visible = true);
+
+          !rows.length &&
+            this.$notify.warning({
+              title: "无转派记录",
+            });
+        }
+      } catch (error) {}
+    },
+    close() {
+      this.visible = false;
+    },
+  },
+  created() {},
+};
+</script>
+
+<template>
+  <el-button :size="$attrs.size" @click="open" :disabled="disabled">
+    {{ title }}
+    <el-dialog
+      class="zhuan-pai-record"
+      :title="title"
+      :visible.sync="visible"
+      append-to-body
+      @close="close"
+    >
+      <el-super-ux-table
+        v-model="record"
+        index
+        :size="$attrs.size"
+        :height="300"
+        :columns="columns"
+        style="width: 100%"
+      >
+      </el-super-ux-table>
+    </el-dialog>
+  </el-button>
+</template>
+
+<style lang="scss" scoped>
+::v-deep.zhuan-pai-record .el-dialog__body {
+  padding: 10px 20px 20px;
+}
+</style>

+ 16 - 0
src/views/purchase/task/columns.js

@@ -57,6 +57,10 @@ export default function useColumns() {
       attr: {},
     },
     { item: { key: "code", title: "订单生成单号",width :160 }, attr: {} },
+    { 
+      item: { key: "createTime", title: "创建时间",width :160 }, 
+      attr: {} 
+    },
     // {
     //   item: { key: "demandOrgName", title: "需求组织" ,width :100},
     //   attr: {},
@@ -81,6 +85,18 @@ export default function useColumns() {
       item: { key: "demandDeptName", title: "需求部门",width :100 },
       attr: {},
     },
+    { 
+      item:{ key: "redeployName", title: "转派人" , width:100 ,},
+      attr:{
+        isHidden:true,
+      },
+    },
+    { 
+      item:{ key: "redeployDate", title: "转派时间" ,},
+      attr:{
+        isHidden:true,
+      },
+    },
     // {
     //   item: { 
     //     key: "isUrgency", 

+ 7 - 0
src/views/purchase/task/index.vue

@@ -13,6 +13,7 @@ export default {
     ThxqButton: () => import("./tui-hui-xu-qiu/index.vue"),
     XyzcButton: () => import("./xie-yi-zhi-cai/index.vue"),
     lcButton: () => import("./line-close/index.vue"),
+    ZpjlButton: () => import("./zhuan-pai/record.vue"),
     ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
@@ -156,6 +157,12 @@ export default {
           @success="useQuery(params, page)"
         >
         </zp-button>
+        <zpjl-button
+          :size="size"
+          :select-data="selectData"
+        >
+        </zpjl-button>
+
         <lc-button
           :size="size"
           :select-data="selectData"

+ 112 - 0
src/views/purchase/task/zhuan-pai/record.vue

@@ -0,0 +1,112 @@
+<!-- 转派记录 -->
+<script>
+import { RECORD } from "@/api/business/purchase/task";
+export default {
+  name: "Record",
+  props: {
+    selectData: {
+      type: [Array],
+      default: () => [],
+    },
+  },
+  components: {
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
+  },
+  data() {
+    return {
+      title: "转派记录",
+      visible: false,
+      columns: [
+        {
+          item: {
+            title: "转派人名称",
+            key: "redeployName",
+          },
+          attr: {},
+        },
+        {
+          item: {
+            title: "被转派人名称",
+            key: "redeployByName",
+          },
+          attr: {},
+        },
+        {
+          item: {
+            title: "来源单据号",
+            key: "source",
+          },
+          attr: {},
+        },
+        {
+          item: {
+            title: "改派时间",
+            key: "createTime",
+          },
+          attr: {},
+        },
+      ],
+      record: [],
+    };
+  },
+  computed: {
+    disabled: {
+      get() {
+        return this.selectData.length !== 1;
+      },
+      set() {},
+    },
+  },
+  methods: {
+    async open() {
+      try {
+        let { code, rows } = await RECORD({ source: this.selectData[0].code });
+
+        if (code == 200) {
+          this.record = rows;
+
+          rows.length && (this.visible = true);
+
+          !rows.length &&
+            this.$notify.warning({
+              title: "无转派记录",
+            });
+        }
+      } catch (error) {}
+    },
+    close() {
+      this.visible = false;
+    },
+  },
+  created() {},
+};
+</script>
+
+<template>
+  <el-button :size="$attrs.size" @click="open" :disabled="disabled">
+    {{ title }}
+    <el-dialog
+      class="zhuan-pai-record"
+      :title="title"
+      :visible.sync="visible"
+      append-to-body
+      @close="close"
+    >
+      <el-super-ux-table
+        v-model="record"
+        index
+        :size="$attrs.size"
+        :height="300"
+        :columns="columns"
+        style="width: 100%"
+      >
+      </el-super-ux-table>
+    </el-dialog>
+  </el-button>
+</template>
+
+<style lang="scss" scoped>
+::v-deep.zhuan-pai-record .el-dialog__body {
+  padding: 10px 20px 20px;
+}
+</style>