Browse Source

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002201 1 năm trước cách đây
mục cha
commit
d61ad79036

+ 28 - 0
src/api/changeApply/basic.js

@@ -70,3 +70,31 @@ export function getRecordList(params) {
     params: params
   })
 }
+
+// 模板下载
+export function changeDownload(data) {
+  return request({
+    url: `/material/change/download`,
+    method: 'post',
+    data: data
+  })
+}
+
+// 导入
+export function changeImport(data) {
+  return request({
+    url: `/material/change/import`,
+    method: 'post',
+    data: data
+  })
+}
+
+// 下载失败导入文件数据
+export function downloadFailData(data) {
+  return request({
+    url: `/material/change/downloadFailData`,
+    method: 'post',
+    data: data,
+    responseType: 'blob',
+  })
+}

+ 7 - 0
src/api/purchase/purchaseDemand.js

@@ -78,4 +78,11 @@ export function queryMan(id) {
     url: `/material/division/queryBuyer?materialId=${id}`,
     method: 'get',
   })
+}
+// 跳转OA
+export function toOA(userName, fdId) {
+  return request({
+    url: `/oaflow/redirectToOa/${userName}/${fdId}`,
+    method: 'get',
+  })
 }

+ 26 - 0
src/main.js

@@ -95,6 +95,32 @@ Vue.use(VueMeta);
 Vue.use(Print); //注册
 DictData.install();
 
+// el-table无限滚动解决页面渲染卡死
+Vue.directive("myscroll", {
+  bind(el, bind, vnode) {
+    const self = vnode.context;
+    let target = el.querySelector('.el-table__body-wrapper');
+    target.addEventListener("scroll", () => {
+      // 检测触底
+      if (target.scrollTop + target.clientHeight >= target.scrollHeight) {
+        if (self.over >= self.basicForm.puDemandItemList) {
+          return;
+        }
+        self.over +=15
+      }
+    })
+  }
+})
+Vue.mixin({
+  data() {
+    return {
+      // scrollTop: 0,
+      // tableHeight: 300
+      start: 0,
+      over: 15
+    }
+  }
+})
 /**
  * If you don't want to use mock-server
  * you want to use MockJs for mock api

+ 51 - 45
src/views/business/spd/bo/basic/index.vue

@@ -4,13 +4,14 @@
     <el-form
       :model="queryParams"
       ref="queryForm"
-      size="small"
+      size="mini"
       :inline="true"
       v-show="showSearch"
       label-width="68px"
     >
       <el-form-item label="商机名称" prop="boName">
         <el-input
+          size="mini"
           v-model="queryParams.boName"
           clearable
           @keyup.enter.native="handleQuery"
@@ -18,6 +19,7 @@
       </el-form-item>
       <el-form-item label="客户名称" prop="customerName">
         <el-input
+          size="mini"
           v-model="queryParams.customerName"
           clearable
           @keyup.enter.native="handleQuery"
@@ -25,6 +27,7 @@
       </el-form-item>
       <el-form-item label="商机负责人" prop="principalName">
         <el-input
+          size="mini"
           v-model="queryParams.principalName"
           clearable
           @keyup.enter.native="handleQuery"
@@ -32,6 +35,7 @@
       </el-form-item>
       <el-form-item label="商机类型" prop="boType">
         <el-select
+          size="mini"
           v-model="queryParams.boType"
           @change="boTypeChange"
           clearable
@@ -45,7 +49,7 @@
         </el-select>
       </el-form-item>
       <el-form-item label="商机阶段" prop="boStage">
-        <el-select v-model="queryParams.boStage" clearable>
+        <el-select size="mini" v-model="queryParams.boStage" clearable>
           <el-option
             v-for="item in mk_bo_stage"
             :key="item.code"
@@ -55,7 +59,7 @@
         </el-select>
       </el-form-item>
       <el-form-item label="商机状态" prop="boState" clearable>
-        <el-select v-model="queryParams.boState" clearable>
+        <el-select size="mini" v-model="queryParams.boState" clearable>
           <el-option
             v-for="dict in dict.type.mk_bo_state"
             :key="dict.value"
@@ -64,7 +68,7 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="商机来源" prop="boSource">
+      <el-form-item size="mini" label="商机来源" prop="boSource">
         <el-select v-model="queryParams.boSource" clearable>
           <el-option
             v-for="dict in dict.type.mk_bo_source"
@@ -86,6 +90,7 @@
       </el-form-item> -->
       <el-form-item label="创建时间">
         <el-date-picker
+          size="mini"
           v-model="dateRange"
           style="width: 240px"
           value-format="yyyy-MM-dd"
@@ -109,9 +114,8 @@
       </el-form-item>
     </el-form>
 
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
+    <div class="btn_grooup">
+      <el-button
           type="primary"
           plain
           icon="el-icon-plus"
@@ -119,52 +123,29 @@
           @click="handleAdd"
           >新增</el-button
         >
-      </el-col>
-      <!-- <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-        >删除</el-button>
-      </el-col> -->
-      <right-toolbar
-        :showSearch.sync="showSearch"
-        @queryTable="getList"
-      ></right-toolbar>
-    </el-row>
+    </div>
 
     <el-table
       v-loading="loading"
       :data="basicList"
       @selection-change="handleSelectionChange"
       @cell-dblclick="enterDetails"
+      height="700px"
     >
       <el-table-column type="selection" align="center" />
       <el-table-column
+        width="150"
         label="编号"
         align="center"
         prop="boCode"
       />
-      <el-table-column label="商机名称" align="center" prop="boName" />
-      <el-table-column label="商机类型" align="center" prop="boType">
+      <el-table-column label="商机名称" show-overflow-tooltip width="300" align="center" prop="boName" />
+      <el-table-column label="商机类型" width="150" align="center" prop="boType">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.mk_bo_type" :value="scope.row.boType" />
         </template>
       </el-table-column>
-      <el-table-column label="商机状态" align="center" prop="boState">
+      <el-table-column label="商机状态" width="150" align="center" prop="boState">
         <template slot-scope="scope">
           <dict-tag
             :options="dict.type.mk_bo_state"
@@ -172,7 +153,7 @@
           />
         </template>
       </el-table-column>
-      <el-table-column label="商机来源" align="center" prop="boSource">
+      <el-table-column label="商机来源" width="150" align="center" prop="boSource">
         <template slot-scope="scope">
           <dict-tag
             :options="dict.type.mk_bo_source"
@@ -180,15 +161,16 @@
           />
         </template>
       </el-table-column>
-      <el-table-column label="商机阶段" align="center" prop="boStageName" />
-      <el-table-column label="客户名称" align="center" prop="customerName" />
+      <el-table-column label="商机阶段" width="150" align="center" prop="boStageName" />
+      <el-table-column label="客户名称" show-overflow-tooltip width="150" align="center" prop="customerName" />
       <el-table-column
+        width="150"
         label="预估值(万元)"
         align="center"
         prop="hosDiscreetValue"
       />
-      <el-table-column label="赢单率" align="center" prop="winningRate" />
-      <el-table-column label="赢单率状态" align="center" prop="winningState">
+      <el-table-column label="赢单率" width="150" align="center" prop="winningRate" />
+      <el-table-column label="赢单率状态" width="150" align="center" prop="winningState">
         <template slot-scope="scope">
           <dict-tag
             :options="dict.type.mk_bo_winstate"
@@ -197,19 +179,22 @@
         </template>
       </el-table-column>
       <el-table-column
+        width="150"
         label="销售区域"
         align="center"
         prop="marketingAreaName"
       />
       <el-table-column
+        width="150"
+        show-overflow-tooltip
         label="销售组织"
         align="center"
         prop="marketingOrganizingName"
       />
-      <el-table-column label="部门" align="center" prop="deptName" />
-      <el-table-column label="商机负责人" align="center" prop="principalName" />
-      <el-table-column label="创建人" align="center" prop="createBy" />
-      <el-table-column label="创建时间" align="center" prop="createTime" />
+      <el-table-column label="部门" width="150" align="center" prop="deptName" />
+      <el-table-column label="商机负责人" width="150" align="center" prop="principalName" />
+      <el-table-column label="创建人" width="150" align="center" prop="createBy" />
+      <el-table-column label="创建时间" width="150" align="center" prop="createTime" />
       <el-table-column
         label="操作"
         fixed="right"
@@ -918,3 +903,24 @@ export default {
   },
 };
 </script>
+
+<style lang="scss" scoped>
+#deliveryAddressList {
+  height: calc(100vh - 84px);
+  padding: 12px;
+  box-sizing: border-box;
+  overflow-y: scroll;
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.lines {
+  margin-top: 0;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+</style>

+ 8 - 8
src/views/business/spd/bo/behavior/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="任务" prop="taskCode">
         <el-input
           v-model="queryParams.taskCode"
@@ -14,7 +14,7 @@
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <el-table v-loading="loading" :data="behaviorList">
+    <el-table v-loading="loading" :data="behaviorList" height="700px">
       <el-table-column label="负责人" align="center" prop="staffName" />
       <el-table-column label="行动日期" align="center" prop="time" />
       <el-form-item label="行动日期" prop="time">
@@ -36,22 +36,22 @@
           <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.assist"/>
         </template>
       </el-table-column>
-      <el-table-column label="协助内容" align="center" prop="assistContent" />
-      <el-table-column label="洽谈内容" align="center" prop="content" />
-      <el-table-column label="任务编码" align="center" prop="taskCode"/>
+      <el-table-column show-overflow-tooltip label="协助内容" align="center" prop="assistContent" />
+      <el-table-column show-overflow-tooltip label="洽谈内容" align="center" prop="content" />
+      <el-table-column width="150" label="任务编码" align="center" prop="taskCode"/>
       <el-table-column label="行动类型" align="center" prop="type">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.mk_bo_behavior_type" :value="scope.row.type"/>
         </template>
       </el-table-column>
-      <el-table-column label="客户" align="center" prop="customerName"/>
+      <el-table-column show-overflow-tooltip label="客户" align="center" prop="customerName"/>
       <el-table-column label="拜访目的" align="center" prop="purpose">
         <template slot-scope="scope">
             <dict-tag :options="dict.type.mk_bo_behavior_goal" :value="scope.row.purpose"/>
         </template>
       </el-table-column>
-      <el-table-column label="销售组织" align="center" prop="salesOrgName"/>
-      <el-table-column label="部门" align="center" prop="deptName"/>
+      <el-table-column show-overflow-tooltip label="销售组织" align="center" prop="salesOrgName"/>
+      <el-table-column show-overflow-tooltip label="部门" align="center" prop="deptName"/>
       <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
           <el-button

+ 28 - 11
src/views/business/spd/bo/contact/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="姓名" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -30,7 +30,7 @@
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <el-row :gutter="10" class="mb8">
+    <!-- <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
           type="primary"
@@ -41,18 +41,27 @@
         >新增</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-    <el-table v-loading="loading" :data="contactList">
-      <el-table-column label="编号" align="center" prop="code" />
-      <el-table-column label="姓名" align="center" prop="name" />
+    </el-row> -->
+    <div class="btn_grooup">
+      <el-button
+        type="primary"
+        plain
+        icon="el-icon-plus"
+        size="mini"
+        @click="handleAdd"
+      >新增</el-button>
+    </div>
+    <el-table v-loading="loading" :data="contactList" height="700px">
+      <el-table-column width="200" label="编号" align="center" prop="code" />
+      <el-table-column show-overflow-tooltip label="姓名" align="center" prop="name" />
       <el-table-column label="性别" align="center" prop="gander" >
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.gander"/>
         </template>
       </el-table-column>
       <el-table-column label="联系电话" align="center" prop="telephone" />
-      <el-table-column label="所属客户" align="center" prop="customerName" />
-      <el-table-column label="部门名称" align="center" prop="departmentName" />
+      <el-table-column width="200" show-overflow-tooltip label="所属客户" align="center" prop="customerName" />
+      <el-table-column show-overflow-tooltip label="部门名称" align="center" prop="departmentName" />
       <el-table-column label="职务" align="center" prop="position" >
         <template slot-scope="scope">
           <dict-tag :options="dict.type.mk_bo_position" :value="scope.row.position"/>
@@ -63,14 +72,14 @@
           <dict-tag :options="dict.type.mk_bo_power" :value="scope.row.power"/>
         </template>
       </el-table-column>
-      <el-table-column label="兴趣爱好" align="center" prop="hobby" />
-      <el-table-column label="家庭地址" align="center" prop="address" />
+      <el-table-column show-overflow-tooltip label="兴趣爱好" align="center" prop="hobby" />
+      <el-table-column show-overflow-tooltip label="家庭地址" align="center" prop="address" />
       <el-table-column label="状态" align="center" prop="state" >
         <template slot-scope="scope">
           <dict-tag :options="dict.type.mk_bo_contact_state" :value="scope.row.state"/>
         </template>
       </el-table-column>
-      <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" >
+      <el-table-column width="200" label="操作" fixed="right" align="center" >
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -591,3 +600,11 @@ export default {
   }
 };
 </script>
+
+<style lang="scss" scoped>
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+</style>

+ 24 - 6
src/views/business/spd/bo/filetemplate/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="商机类型" prop="boType">
         <el-select
           v-model="queryParams.boType"
@@ -23,12 +23,12 @@
         />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
-    <el-row :gutter="10" class="mb8">
+    <!-- <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
           type="primary"
@@ -39,9 +39,19 @@
         >上传</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
+    </el-row> -->
 
-    <el-table v-loading="loading" :data="filetemplateList" @selection-change="handleSelectionChange">
+    <div class="btn_grooup">
+      <el-button
+        type="primary"
+        plain
+        icon="el-icon-plus"
+        size="mini"
+        @click="uploadAccessory"
+      >上传</el-button>
+    </div>
+
+    <el-table v-loading="loading" :data="filetemplateList" @selection-change="handleSelectionChange"  height="700px">
       <el-table-column
         type="index"
         label="序号"
@@ -271,3 +281,11 @@ export default {
   }
 };
 </script>
+
+<style lang="scss" scoped>
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+</style>

+ 3 - 3
src/views/business/spd/bo/statement/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="商机名称" prop="boName">
         <el-input
           v-model="queryParams.boName"
@@ -36,8 +36,8 @@
         </el-select>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
     <el-tabs v-model="activeName" @tab-click="handleClick">

+ 4 - 4
src/views/business/spd/bo/statement/proportion/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="商机日期" prop="yearMonth">
         <el-date-picker
           type="month"
@@ -44,12 +44,12 @@
         />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
-    <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange" height="700px">
       <el-table-column label="中心部门" align="center" prop="deptName" />
       <el-table-column label="当月新增商机数(个)" align="center" prop="sumTotal" />
       <el-table-column label="当月审核通过数(个)" align="center" prop="passAudit" />

+ 33 - 7
src/views/business/spd/bo/task/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="任务编码" prop="code">
         <el-input
           v-model="queryParams.code"
@@ -47,8 +47,8 @@
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <el-row :gutter="10" class="mb8">
-      <!-- <el-col :span="1.5">
+    <!-- <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
         <el-button
           type="primary"
           plain
@@ -77,28 +77,43 @@
           @click="handleDelete"
           >删除</el-button
         >
-      </el-col> -->
+      </el-col>
       <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
       ></right-toolbar>
-    </el-row>
+    </el-row> -->
+
+    <div class="btn_grooup">
+      <el-button
+        type="primary"
+        plain
+        icon="el-icon-plus"
+        size="mini"
+        @click="handleAdd"
+        >新增</el-button
+      >
+    </div>
 
     <el-table
       v-loading="loading"
       :data="taskList"
       @selection-change="handleSelectionChange"
+      height="700px"
     >
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="任务编码" align="center" prop="code" />
-      <el-table-column label="任务名称" align="center" prop="name" />
+      <el-table-column width="150" label="任务编码" align="center" prop="code" />
+      <el-table-column width="200" show-overflow-tooltip label="任务名称" align="center" prop="name" />
       <el-table-column
+        width="200"
+        show-overflow-tooltip
         label="商机名称"
         align="center"
         prop="boName"
       />
       <el-table-column label="商机阶段" align="center" prop="boStageName"/>
       <el-table-column
+        show-overflow-tooltip
         label="客户名称"
         align="center"
         prop="customerName"
@@ -121,6 +136,7 @@
       </el-table-column>
       <el-table-column label="联系人" align="center" prop="linkmanName" />
       <el-table-column
+        show-overflow-tooltip
         label="销售组织名称"
         align="center"
         prop="salesOrgName"
@@ -139,6 +155,7 @@
       </el-table-column>
       <el-table-column label="任务内容" align="center" prop="content" />
       <el-table-column
+        show-overflow-tooltip
         label="操作"
         fixed="right"
         align="center"
@@ -607,6 +624,7 @@ export default {
       this.reset();
       this.open = true;
       this.title = "添加任务";
+      this.operatingState = "Insert";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -746,3 +764,11 @@ export default {
   }
 };
 </script>
+
+<style lang="scss" scoped>
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+</style>

+ 18 - 8
src/views/business/spd/target/targetMk/add.vue

@@ -36,7 +36,7 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="1.5">
+          <!-- <el-col :span="1.5">
             <el-form-item label="包含下级组织" >
               <el-select v-model="form.includeOrg" size="mini" style="width: 200px">
                 <el-option
@@ -47,7 +47,7 @@
                 ></el-option>
               </el-select>
             </el-form-item>
-          </el-col>
+          </el-col> -->
           <el-col :span="1.5">
             <el-form-item label="模板" prop="template">
               <dr-popover-select size="mini" v-model="form.templateName" title="模板" type="MK_TARGET_TEMPLATE_PARAM" :dataMapping="{
@@ -94,15 +94,17 @@
         </el-card>
       </el-form>
     </el-card>
-    <Item ref="child" v-if="isItem" :pageStu="pageStu" :template="template" :form="form" :columns="headers"></Item>
+    <el-card  style="height:500px">
+      <Item ref="child" v-if="isItem" :pageStu="pageStu" :template="template" :form="form" :columns="headers" :latestTemplate="latestTemplate"></Item>
+    </el-card>
     <el-card>
       <div class="btn_group">
+        <el-col :span="1.5">
+          <el-button size="mini" plain @click="useBack">取消</el-button>
+        </el-col>
         <el-col :span="1.5" style="margin: 0 10px;">
           <el-button type="primary" size="mini" plain @click="useSave" v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
         </el-col>
-        <el-col :span="1.5">
-          <el-button size="mini" plain @click="useBack">返回</el-button>
-        </el-col>
       </div>
     </el-card>
   </div>
@@ -143,24 +145,32 @@ export default {
       loading: false,
       //是否展示Item组件
       isItem:false,
+      //是否为最新模板
+      latestTemplate:false,
     }
   },
   async created() {
+    if(this.pageStu == 'add'){
+      this.form.date = new Date();
+    }
     if(this.pageStu == 'edit' || this.pageStu == 'see') {
       await this.fetchTarget(this.row);
       await this.fetchTemplate(this.row.template);
       await this.fetchHeaderData(this.row.template);
+      this.latestTemplate = true;
       this.isItem = true;
     }
   },
   watch: {
 	  'form.template': {
       async handler(newVal) {
+        console.log('111');
         this.isItem = false;
         await this.fetchTemplate(newVal);
         await this.fetchHeaderData(newVal);
         this.isItem = true;
       },
+      immediate:false,
     }
   },
   methods: {
@@ -239,7 +249,7 @@ export default {
           this.headers = res.rows
         }
       })
-    }
+    },
   }
 }
 </script>
@@ -249,6 +259,6 @@ export default {
   width: 100%;
   margin: 20px 0;
   display: flex;
-  justify-content: center;
+  justify-content: right;
 } 
 </style>

+ 3 - 0
src/views/business/spd/target/targetMk/index.vue

@@ -61,6 +61,8 @@
       
         <div class="btn_grooup">
           <el-button type="primary" size="mini" @click="useAdd">新增</el-button>
+          <el-button type="primary" size="mini" @click="useAdd">模板导出</el-button>
+          <el-button type="primary" size="mini" @click="useAdd">导入</el-button>
         </div>
 
         <el-table 
@@ -171,6 +173,7 @@ export default {
       //列表数据
       tableList:[],
       disable: false,
+      rowDetail:{},
     }
   },
   created() {

+ 75 - 42
src/views/business/spd/target/targetMk/item.vue

@@ -1,51 +1,66 @@
 <template>
   <div>
-    <el-card>
-      <el-row>
-        <div class="btn_add">
-          <el-button type="primary" size="mini" @click="useAdd" v-if="this.pageStu != 'see'">增行</el-button>
-        </div>
-      </el-row>
-      <!-- 渲染表头 -->
-      <el-table :data="items" style="width: 100%" height="500px">
-        <el-table-column label="序号" type="index" width="50" align="center" fixed>
-        </el-table-column>
-        <el-table-column v-for="head in headers" :prop="head.prop" :label="head.modelName" width="150" align="center">
-          <template slot-scope="scope">
-            <div v-if="pageStu == 'add' || pageStu == 'edit'">
-              <dr-popover-select size="mini" v-if="scope.row[head.prop].type == 'D'" v-model="scope.row[head.prop].valueName" title="参照选择" :type="scope.row[head.prop].model" :dataMapping="{
+    <el-row>
+      <div class="btn_add">
+        <el-button type="primary" size="mini" @click="useAdd" v-if="this.pageStu != 'see'">增行</el-button>
+      </div>
+    </el-row>
+    <!-- 渲染表头 -->
+    <el-table :data="items" style="width: 100%" height="500px">
+      <el-table-column label="序号" type="index" width="50" align="center" fixed>
+      </el-table-column>
+      <el-table-column show-overflow-tooltip v-for="head in headers" :prop="head.prop" :label="head.modelName" width="150" align="center">
+        <template slot-scope="scope">
+          <div v-if="pageStu == 'add' || pageStu == 'edit'">
+            <div v-if="scope.row[head.prop].type == 'D'">
+              <dr-popover-select 
+                size="mini" 
+                v-if="scope.row[head.prop].model == 'MK_TARGET_CYCLE_PARAM' || scope.row[head.prop].model == 'MK_TARGET_INDEX_PARAM'" 
+                v-model="scope.row[head.prop].valueName" 
+                title="参照选择" 
+                :type="scope.row[head.prop].model" 
+                :dataMapping="{
+                  value: 'id',
+                  valueName: 'name',
+                }" 
+                :source.sync="scope.row[head.prop]"
+                :queryParams="additionalCondition"
+              />
+              <dr-popover-select size="mini" v-else v-model="scope.row[head.prop].valueName" title="参照选择" :type="scope.row[head.prop].model" :dataMapping="{
                 value: 'id',
                 valueName: 'name',
               }" :source.sync="scope.row[head.prop]"></dr-popover-select>
-              <el-input size="mini" v-if="scope.row[head.prop].type == 'C' || scope.row[head.prop].type == 'I'" v-model="scope.row[head.prop].value"></el-input>
             </div>
-            <div v-else-if="pageStu == 'see'">
-              <div v-if="scope.row[head.prop].type == 'D'">
-                {{scope.row[head.prop].valueName}}
-              </div>
-              <div v-else>
-                {{scope.row[head.prop].value}}
-              </div>
+            <div v-if="scope.row[head.prop].type == 'C' || scope.row[head.prop].type == 'I'">
+              <el-input size="mini"  v-model="scope.row[head.prop].value"></el-input>
             </div>
-          </template>
-          <el-table-column v-if="head.children" v-for="headChi in head.children" :prop="headChi.prop" :label="headChi.modelName" width="150" align="center">
-            <template slot-scope="scope">
-              <div v-if="pageStu == 'add' || pageStu == 'edit'">
-                <el-input size="mini" v-model="scope.row[headChi.prop].value"></el-input>
-              </div>
-              <div v-else-if="pageStu == 'see'">
-                {{scope.row[headChi.prop].value}}
-              </div>
-            </template>
-          </el-table-column>
-        </el-table-column>
-        <el-table-column fixed="right" label="操作" align="center" width="100" v-if="this.pageStu != 'see'">
+          </div>
+          <div v-else-if="pageStu == 'see'">
+            <div v-if="scope.row[head.prop].type == 'D'">
+              {{scope.row[head.prop].valueName}}
+            </div>
+            <div v-else>
+              {{scope.row[head.prop].value}}
+            </div>
+          </div>
+        </template>
+        <el-table-column show-overflow-tooltip v-if="head.children" v-for="headChi in head.children" :prop="headChi.prop" :label="headChi.modelName" width="150" align="center">
           <template slot-scope="scope">
-            <el-button type="text" size="mini" @click="useDel(scope.$index, scope.row)">删除</el-button>
+            <div v-if="pageStu == 'add' || pageStu == 'edit'">
+              <el-input size="mini" v-model="scope.row[headChi.prop].value"></el-input>
+            </div>
+            <div v-else-if="pageStu == 'see'">
+              {{scope.row[headChi.prop].value}}
+            </div>
           </template>
         </el-table-column>
-      </el-table>
-    </el-card>
+      </el-table-column>
+      <el-table-column fixed="right" label="操作" align="center" width="100" v-if="this.pageStu != 'see'">
+        <template slot-scope="scope">
+          <el-button type="text" size="mini" @click="useDel(scope.$index, scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
   </div>
 </template>
 
@@ -54,7 +69,7 @@ import { getTargetItem } from "@/api/business/spd/starget/target";
 
 export default {
   name: 'item',
-  props: ['pageStu','template','form','columns'],  
+  props: ['pageStu','template','form','columns','latestTemplate'],  
   dicts: ['sys_yes_no','mk_periodic_unit','mk_dimensionality','mk_index_type','mk_expansion_mode'],
   data() {
     return {
@@ -69,15 +84,15 @@ export default {
     this.itemTemplate = this.formatItem(this.columns);
     console.log('this.itemTemplate',this.itemTemplate);
     if(this.pageStu == 'edit' || this.pageStu == 'see'){
-      await this.fetchTargetItem(this.form.id);
-      console.log('this.items',this.items);
+      if(!this.latestTemplate){
+        await this.fetchTargetItem(this.form.id);
+      }
     }
   },
   methods: {
     //增行
     useAdd(){
       this.items.push(this.itemTemplate);
-      console.log('this.items',this.items);
     },
     //删行
     useDel(index){
@@ -119,18 +134,27 @@ export default {
       }else if("cycle" == unfold){
         for(let i in columns){
           columns[i].prop = columns[i].model
+          if(columns[i].model == 'MK_TARGET_CYCLE_PARAM' || columns[i].model == 'MK_TARGET_INDEX_PARAM'){
+            columns[i].templateId = this.template.id
+          }
           array.push(columns[i]);
         }
         this.headers = array;
       }else if("unfold" == unfold){
         for(let i in columns){
           columns[i].prop = columns[i].model
+          if(columns[i].model == 'MK_TARGET_CYCLE_PARAM' || columns[i].model == 'MK_TARGET_INDEX_PARAM'){
+            columns[i].templateId = this.template.id
+          }
           array.push(columns[i]);
         }
         this.headers = array;
       }else if("" == unfold){
         for(let i in columns){
           columns[i].prop = columns[i].model
+          if(columns[i].model == 'MK_TARGET_CYCLE_PARAM' || columns[i].model == 'MK_TARGET_INDEX_PARAM'){
+            columns[i].templateId = this.template.id
+          }
           array.push(columns[i]);
         }
         this.headers = array;
@@ -157,6 +181,15 @@ export default {
     merge(){
       this.items.push(...this.delItems);
       return this.items;
+    },
+    //附加查询条件
+    additionalCondition(prop){
+      console.log("prop",prop);
+      return {
+        parame:{
+          templateId: prop.templateId
+        }
+      }
     }
   }
 }

+ 2 - 2
src/views/business/spd/target/targetTemplate/add/columns.js

@@ -106,7 +106,7 @@ export default function useColumns() {
           },
           attr: {
             is: "el-date-picker",
-            valueFormat: "yyyy-MM-dd",
+            // valueFormat: "yyyy-MM-dd",
             // value: new Date(),
           },
         },
@@ -119,7 +119,7 @@ export default function useColumns() {
           },
           attr: {
             is: "el-date-picker",
-            valueFormat: "yyyy-MM-dd",
+            // valueFormat: "yyyy-MM-dd",
             // value: new Date(),
           },
         },

+ 172 - 69
src/views/business/spd/target/targetTemplate/add/index.vue

@@ -13,7 +13,7 @@ export default {
       type: Object,
     },
     selectData: {
-      type: [Array],
+      type: Object,
       require: true,
     },
     addType: {
@@ -62,30 +62,6 @@ export default {
       },
       set() {},
     },
-    disabled: {
-      get() {
-        const {
-          addType,
-          selectData,
-          selectData: [{ status } = {}],
-        } = this.$props;
-        if (addType === "add") {
-          return false;
-        }
-        if (addType === "edit") {
-          if (selectData.length !== 1) {
-            return true;
-          }
-          if (selectData.length === 1 && status === "1") {
-            return true;
-          }
-          if (selectData.length === 1 && status === "2") {
-            return true;
-          }
-        }
-      },
-      set() {},
-    },
   },
   watch: {},
   methods: {
@@ -121,28 +97,33 @@ export default {
       const { addType, selectData } = this.$props;
       if (addType === "add") {
         this.visible = true;
+        var date = new Date();
+        this.params.year = date.getFullYear() + '-' + '01' + '-' + '01';
+        this.params.startTime = date.getFullYear() + '-' + '01' + '-' + '01';
+        this.params.deadlineTime = date.getFullYear() + '-' + '12' + '-' + '31';
+        this.params.cycle = 'month';
       }
       if (addType === "edit") {
-        const [{ id }] = selectData;
         //校验目标模板是否存在引用
-        const { code, data } = await checkQuote(id);
-        if(code == '200'){
-          if(data){
+        const { code, data } = await checkQuote(selectData.id);
+        if (code == "200") {
+          if (data) {
             this.$modal.msgError("该目标模板存在引用,无法修改!");
             this.visible = false;
             return;
           }
-        }else{
+        } else {
           this.$modal.msgError("校验该目标模板是否存在引用异常,无法修改!");
           this.visible = false;
           return;
         }
-        this.visible = await this.fetchTemplate(id);
-        this.params.indexs = this.params.indexs.map((item) => ({ ...item }));
+        this.visible = await this.fetchTemplate(selectData.id);
+        this.params.indexs = this.params.indexs.map((item) => ({ ...item}));
         this.params.dimensionalitys = this.params.dimensionalitys.map(
-          (item) => ({ ...item })
+          (item) => ({ ...item})
         );
-        this.params.cycles = this.params.cycles.map((item) => ({ ...item }));
+        this.params.cycles = this.params.cycles.map((item) => ({ ...item}));
+        console.log("this.params",this.params);
       }
     },
     //关闭页面
@@ -166,29 +147,25 @@ export default {
       const { TableColumns } = TabColumns.find(
         ({ item: { key } }) => key === prop
       );
-      console.log(prop, this.$init.params(TableColumns));
       this.params[prop].push({
         delFlag: "0",
+        $index: new Date().getTime(),
         ...this.$init.params(TableColumns),
       });
-      console.log("this.params[prop]", this.params[prop]);
     },
     //删行
     async useRowRemove(prop, scope) {
-      const { addType } = this.$props;
-      const {
-        row: { $index },
-      } = scope;
-      if (addType === "add") {
-        this.params[prop].splice($index, 1);
-      }
-      if (addType === "edit") {
-        this.params[prop] = this.params[prop].map((item, index) => ({
-          ...item,
-          delFlag: index === $index ? "2" : item.delFlag,
-        }));
-        console.log(this.params[prop]);
+      // const { addType } = this.$props;
+      if (scope.row.id) {
+        this.params[prop].forEach(e => {
+          if(e.id == scope.row.id){
+            e.delFlag = '2'
+          }
+        });
+      }else{
+        this.params[prop] = this.params[prop].filter(item => item.$index != scope.row.$index);
       }
+      console.log("this.params[prop]",this.params[prop]);
     },
     //确认
     async useSubmit(prop) {
@@ -196,18 +173,6 @@ export default {
         if (valid) {
           try {
             this.loading = true;
-            // const {
-            //   params,
-            //   params: { paramsOrgs, paramsItems },
-            // } = this;
-            // if (this.addType === "edit") {
-            //   params.paramsOrgs = paramsOrgs.filter(
-            //     (item) => item.orgName
-            //   );
-            //   params.paramsItems = paramsItems.filter(
-            //     (item) => item.materialName
-            //   );
-            // }
             const { addType } = this.$props;
             let res = null;
             if (addType === "add") {
@@ -233,21 +198,149 @@ export default {
         }
       });
     },
+    //保存并新增
+    useSaveAndAdd(prop){
+      this.$refs[prop].$refs[prop].validate(async (valid) => {
+        if (valid) {
+          try {
+            this.loading = true;
+            const { addType } = this.$props;
+            let res = null;
+            if (addType === "add") {
+              res = await addTargetTemplate(this.params);
+            }
+            if (addType === "edit") {
+              res = await updateTargetTemplate(this.params);
+            }
+            if (res.code === 200) {
+              this.$notify.success(res.msg);
+              this.params={};
+            }
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    //重置周期
+    useResetCycle(){
+      if(!this.params.startTime || !this.params.deadlineTime || !this.params.cycle){
+        this.$modal.msgError("开始日期、结束日期、周期不能存在空值!");
+        return;
+      }
+      if(this.params.startTime > this.params.deadlineTime){
+        this.$modal.msgError("开始日期不能大于结束日期!");
+        return;
+      }
+      this.params.cycles = [];
+      var cycles = [];
+      var start = new Date(this.params.startTime);
+      var deadline = new Date(this.params.deadlineTime);
+      start.setHours( 0, 0, 0);
+      deadline.setHours( 0, 0, 0);
+      if(this.params.cycle == 'period'){
+        cycles.push({
+          name:'目标期间',
+          startTime:start,
+          deadlineTime:deadline,
+        });
+      }else{
+        while(deadline >= start){
+          console.log(start);
+          if(this.params.cycle == 'day'){
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:start,
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+1);
+            start = new Date(start);
+          }
+          if(this.params.cycle == 'week'){
+            var de = start;
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:de.setDate(de.getDate()+7),
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+7);
+            start = new Date(start);
+          }
+          if(this.params.cycle == 'month'){
+            var de = start;
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:de.setDate(de.getDate()+30),
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+30);
+            start = new Date(start);
+          }
+          if(this.params.cycle == 'season'){
+            var de = start;
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:de.setDate(de.getDate()+90),
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+90);
+            start = new Date(start);
+          }
+        }
+      }
+      this.params.cycles = cycles;
+      console.log('this.params.cycles',this.params.cycles);
+    },
+    //日期名称格式化
+    formatDateTime(date, format) {
+      const o = {
+        'M+': date.getMonth() + 1, // 月份
+        'd+': date.getDate(), // 日
+        'h+': date.getHours() % 12 === 0 ? 12 : date.getHours() % 12, // 小时
+        'H+': date.getHours(), // 小时
+        'm+': date.getMinutes(), // 分
+        's+': date.getSeconds(), // 秒
+        'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+        S: date.getMilliseconds(), // 毫秒
+        a: date.getHours() < 12 ? '上午' : '下午', // 上午/下午
+        A: date.getHours() < 12 ? 'AM' : 'PM', // AM/PM
+      };
+      if (/(y+)/.test(format)) {
+        format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+      }
+      for (let k in o) {
+        if (new RegExp('(' + k + ')').test(format)) {
+          format = format.replace(
+            RegExp.$1,
+            RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
+          );
+        }
+      }
+      return format;
+    }
   },
   created() {
-    console.log("params", this.params);
   },
   mounted() {},
   destroyed() {},
 };
 </script>
 <template>
-  <el-button
-    v-bind="$attrs"
-    v-on="$listeners"
-    :disabled="disabled"
-    @click="open"
-  >
+  <el-button v-bind="$attrs" v-on="$listeners" @click="open">
     {{ title }}
     <el-drawer
       :size="width"
@@ -304,9 +397,11 @@ export default {
               >
               </component>
             </template> -->
-            <el-table-column fixed="right" label="操作" width="75">
+            <el-table-column fixed="right" label="操作" width="100">
               <template slot="header" slot-scope="scope">
+                <el-button v-if="tabName == 'cycles'" type="primary" size="mini" @click="useResetCycle">重算周期</el-button>
                 <el-button
+                  v-else
                   circle
                   icon="el-icon-plus"
                   :size="$attrs.size"
@@ -316,6 +411,7 @@ export default {
               </template>
               <template slot-scope="scope">
                 <el-button
+                  v-if="tabName == 'indexs' || tabName == 'dimensionalitys'"
                   circle
                   icon="el-icon-minus"
                   :size="$attrs.size"
@@ -331,6 +427,13 @@ export default {
         <el-button :size="$attrs.size" :loading="loading" @click="hide"
           >取 消</el-button
         >
+        <!-- <el-button
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="useSaveAndAdd('superForm')"
+          >保存并新增</el-button
+        > -->
         <el-button
           type="primary"
           :size="$attrs.size"

+ 16 - 36
src/views/business/spd/target/targetTemplate/delete/index.vue

@@ -3,45 +3,28 @@ import { delTargetTemplate,checkQuote, } from "@/api/business/spd/starget/target
 
 export default {
   name: "DeleteDialog",
-  props: {
-    selectData: {
-      type: [Array],
-      require: true,
-    },
-  },
+  props: ['selectData'],
   data() {
     return {
       title: "删 除",
     };
   },
-  computed: {
-    disabled: {
-      get() {
-        const { selectData } = this;
-        if (selectData.length < 1) {
-          return true;
-        }
-        if (
-          selectData.length >= 1 &&
-          selectData.findIndex(({ status }) => status === "1") > -1
-        ) {
-          return true;
-        }
-        if (
-          selectData.length >= 1 &&
-          selectData.findIndex(({ status }) => status === "2") > -1
-        ) {
-          return true;
-        }
-      },
-      set() {},
-    },
-  },
   watch: {},
   methods: {
-    //
-    open() {
-
+    async open() {
+      const { selectData } = this.$props;
+      const { code, data } = await checkQuote(selectData.id);
+      if(code == '200'){
+        if(data){
+          this.$modal.msgError("该目标模板存在引用,无法删除!");
+          this.visible = false;
+          return;
+        }
+      }else{
+        this.$modal.msgError("校验该目标模板是否存在引用异常,无法删除!");
+        this.visible = false;
+        return;
+      }
       this.$confirm(`是否删除数据项?`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -52,9 +35,7 @@ export default {
             instance.confirmButtonText = "执行中...";
             try {
               // try
-              const { selectData } = this.$props;
-              const ids = selectData.map((item) => item.id).join(",");
-              const { msg, code } = await delTargetTemplate(ids);
+              const { msg, code } = await delTargetTemplate(selectData.id);
               if (code === 200) {
                 done();
                 this.$emit("success");
@@ -86,7 +67,6 @@ export default {
   <el-button
     v-bind="$attrs"
     v-on="$listeners"
-    :disabled="disabled"
     @click="open"
   >
     {{ title }}

+ 17 - 16
src/views/business/spd/target/targetTemplate/index.vue

@@ -106,18 +106,6 @@ export default {
           ref="SeeButton"
           @success="useQuery(params, page)"
         ></see-button>
-        <add-button
-          :size="size"
-          :dict="dict"
-          :select-data="selectData"
-          add-type="edit"
-          @success="useQuery(params, page)"
-        ></add-button>
-        <dele-button
-          :size="size"
-          :select-data="selectData"
-          @success="useQuery(params, page)"
-        ></dele-button>
       </el-button-group>
     </div>
     <el-super-table
@@ -130,11 +118,24 @@ export default {
       @row-dblclick="useSee"
       @selection-change="useSelect"
     >
-      <!-- <el-table-column fixed width="55" align="center" label="#" prop="$index">
-      </el-table-column> -->
-      
-      <el-table-column fixed width="55" align="center" type="selection">
+      <el-table-column fixed="right" label="操作" align="center" width="150">
+        <template slot-scope="scope">
+          <add-button
+          :size="size"
+          :dict="dict"
+          :select-data="scope.row"
+          add-type="edit"
+          @success="useQuery(params, page)"
+        ></add-button>
+        <dele-button
+          :size="size"
+          :select-data="scope.row"
+          @success="useQuery(params, page)"
+        ></dele-button>
+        </template>
       </el-table-column>
+      <!-- <el-table-column fixed width="55" align="center" type="selection">
+      </el-table-column> -->
     </el-super-table>
     <pagination
       :total="page.total"

+ 45 - 39
src/views/material/changeApply/batchImport/index.vue

@@ -1,5 +1,6 @@
 <script>
 import { importData, fileImport} from '@/api/requisition/basic';
+import { changeImport, downloadFailData} from '@/api/changeApply/basic';
 export default {
   name:'BatchImport',
   props:{},
@@ -7,52 +8,57 @@ export default {
     return {
       title:'批量导入',
       visible:false,
-      fileData:[]
+      fileData:[],
+      size:'mini',
     }
   },
   methods:{
-    beforeColse(){},
+    beforeColse(done){
+      this.cancal();
+      done();
+
+    },
     handleClick(){
       this.visible = true;
     },
     confirmUpdate(){
-  if (this.fileData.length) {
+      if (this.fileData.length) {
 
-    let formData = new FormData();
+        let formData = new FormData();
 
-    formData.append('file', this.fileData[0].raw);
-    importData(formData).then(res => {
-      if (res.code == 200) {
-        this.visible = false;
-        this.fileData = [];
-        if (res.data.flag) {
-          this.failLoad = true;
-          console.log(res.data.datas)
-          let param = {failDatas: res.data.datas}
-          if (null != param) {
+        formData.append('file', this.fileData[0].raw);
+        importData(formData).then(res => {
+          if (res.code == 200) {
+            this.visible = false;
+            this.fileData = [];
+            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');
+                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.failLoad = false;
-            })
+            }
+            this.$notify({
+              message: res.data.msg,
+              type: res.data.flag ? 'warning' : 'success'
+            });
+          } else {
+            this.$notify({
+              message: res.msg,
+              type: res.code == 200 ? 'success' : 'warning'
+            });
           }
-        }
-        this.$notify({
-          message: res.data.msg,
-          type: res.data.flag ? 'warning' : 'success'
-        });
-      } else {
-        this.$notify({
-          message: res.msg,
-          type: res.code == 200 ? 'success' : 'warning'
-        });
-      }
-    })
+        })
       } else {
       this.$notify({
         title:'警告',
@@ -96,7 +102,7 @@ export default {
       append-to-body
       :before-close="beforeColse"
     >
-      <div>
+      <div style="display: flex;justify-content: center;">
         <el-upload 
           accept=".xls, .xlsx" 
           ref="upload" 
@@ -107,10 +113,10 @@ export default {
           :on-change="handleChangeFile" 
           :limit="1"
         >
-          <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
+          <el-button slot="trigger" :size="size" type="primary">选取文件</el-button>
           <el-button 
             style="margin-left: 10px;" 
-            size="small" 
+            :size="size"
             type="success"
             @click="handleDownTemplate"
           >下载模板
@@ -120,8 +126,8 @@ export default {
 
       </div>
       <span slot="footer">
-        <el-button @click="cancal">取 消</el-button>
-        <el-button type="primary" @click="confirmUpdate">确 定</el-button>
+        <el-button :size="size" @click="cancal">取 消</el-button>
+        <el-button type="primary" :size="size" @click="confirmUpdate">确 定</el-button>
       </span>
     </el-dialog>
   </el-button>

+ 3 - 2
src/views/material/changeApply/index.vue

@@ -40,8 +40,8 @@
         style="margin-top: 20px;"
       >
         <el-col :span="1.5">
-          <el-button type="primary" size="small" @click="newAdd">新增</el-button>
-          
+          <el-button type="primary" size="mini" @click="newAdd">新增</el-button>
+          <!-- <BatchImport></BatchImport> -->
         </el-col>
       </el-row>
 
@@ -79,6 +79,7 @@ export default {
   components: {
     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"),
   },

+ 1 - 1
src/views/purchase/DemandSummary/add.vue

@@ -236,7 +236,6 @@ export default {
       console.log('数据', this.row)
       let param = JSON.parse(JSON.stringify(this.query))
       param.sumFlag = this.row.sumFlag
-      param.demandItemId = this.row.demandItemId
       this.getDetails(param)
     }
   },
@@ -256,6 +255,7 @@ export default {
     },
     // 如果需要回显则调用详情接口
     getDetails(row) {
+      row.demandItemId = this.row.demandItemId
       getSummaryDetail(row).then(res => {
         if (res.code === 200) {
           this.tableList = res.data

+ 24 - 23
src/views/purchase/PurchaseDemandList/add.vue

@@ -84,7 +84,7 @@
 
         <el-col :span="1.5">
           <el-form-item label="是否客户指定">
-            <el-select clearable v-model="basicForm.isSpeical" :disabled="sonDisable" size="mini" style="width: 200px">
+            <el-select clearable v-model="basicForm.isCustomerSpecified" :disabled="sonDisable" size="mini" style="width: 200px">
               <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
               </el-option>
             </el-select>
@@ -167,7 +167,8 @@
       </div>
 
       <el-table
-          :data="basicForm.puDemandItemList"
+          v-myscroll
+          :data="basicForm.puDemandItemList.slice(0, over)"
           fit
           border
           :cell-style="{ borderColor: '#c0c0c0' }"
@@ -179,8 +180,8 @@
           @selection-change="handleSelectionChange"
           :cell-class-name="cellClassName"
         >
-          <el-table-column show-overflow-tooltip type="selection" fixed="left"/>
-          <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px" fixed="left"/>
+          <el-table-column show-overflow-tooltip type="selection"/>
+          <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px"/>
           <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo">
             <template slot-scope="scope">
               {{ scope.$index + 1 + '0' }}
@@ -374,11 +375,11 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="是否客户指定" align="center"  prop="isSpeical" width="120px">
+          <el-table-column show-overflow-tooltip label="是否客户指定" align="center"  prop="isCustomerSpecified" width="120px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-switch
-                  v-model="scope.row.isSpeical"
+                  v-model="scope.row.isCustomerSpecified"
                   disabled
                   active-value="Y"
                   inactive-value="N"
@@ -417,18 +418,11 @@
       </el-table>
     </el-form>
       <div class="btn_group">
-        <el-col :span="1.5">
-          <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button type="primary" size="mini"  @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
-        </el-col>
-        <el-col :span="1.5" style="margin: 0 10px;">
-          <el-button type="primary" size="mini"  @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button size="mini" plain @click="back">返回</el-button>
-        </el-col>
+        <el-button type="primary" size="mini"  @click="jumpOA" v-if="sonPageStu == 'check' && (row.status == '1' || row.status == '2')">跳转OA</el-button>
+        <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
+        <el-button type="primary" size="mini"  @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
+        <el-button type="primary" size="mini"  @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
+        <el-button size="mini" plain @click="back">返回</el-button>
       </div>
   </el-card>
 
@@ -523,7 +517,7 @@
 <script>
 import Reserved from './reserved.vue'
 import Refers from '@/components/Refers/refers.vue'
-import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan } from '@/api/purchase/purchaseDemand.js'
+import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan, toOA } from '@/api/purchase/purchaseDemand.js'
 // 用于回显参照框数据
 import {getRefer} from '@/api/purchase/basic.js'
 // 明细行选择物料参照
@@ -568,7 +562,7 @@ export default {
         createTime: '',
         source: '4',
         billType: 'ZQBH',
-        isSpeical: 'N',
+        isCustomerSpecified: 'N',
         isProcess: '',
         isMonthleyCalculate: '',
         createTime: this.parseTime(new Date().getTime()),
@@ -708,7 +702,7 @@ export default {
       this.basicForm.code = ''
       this.basicForm.createBy = ''
       this.basicForm.source = '4'
-      this.basicForm.isSpeical = 'N'
+      this.basicForm.isCustomerSpecified = 'N'
       this.basicForm.demandPersonal = this.$store.state.user.name
       this.basicForm.demandDept = this.$store.state.user.deptId
       if (this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
@@ -1002,7 +996,7 @@ export default {
     },
     // 单元格标红
     cellClassName({row, column, rowIndex, columnIndex}) {
-      if(this.basicForm.isSpeical == 'N' && column.label == '需求可用周期' && Number(row.demandPeriod) > 1.5 && Number(row.demandPeriod) > Number(row.minOrderQty)) {
+      if(this.basicForm.isCustomerSpecified == 'N' && column.label == '需求可用周期' && Number(row.demandPeriod) > 1.5 && Number(row.demandPeriod) > Number(row.minOrderQty)) {
         return 'success-row';
       }
     },
@@ -1739,6 +1733,13 @@ export default {
         ]; 
       }
     },
+    jumpOA() {
+      toOA(this.$store.state.user.name, this.basicForm.flowId).then(res => {
+        if(res.code === 200) {
+          window.open(res.oaUrl)
+        }
+      })
+    }
   }
 }
 </script>
@@ -1748,7 +1749,7 @@ export default {
   // width: 100%;
   // margin: 20px 0;
   display: flex;
-  // justify-content: center;
+  justify-content: space-between;
   position: absolute;
   top: 10px;right: 20px;
 

+ 12 - 9
src/views/purchase/purchase-order/index.vue

@@ -598,16 +598,17 @@ export default {
     </el-row>
 
     <el-super-table
+      class="purchaseTable"
       v-model="tableData"
       ref="purchaseTable"
-      max-height="480"
       :dict="dict"
       :columns="tableColumns"
       :selectable="setSelectable"
+      index
       checkbox
       pagination
       :page="page"
-      :iconOperation="false"
+      convenitentOperation
       @pagination="fetchList(params, page)"
       @row-dblclick="handleOpenSeeDrawer" 
       @row-click="handleDetailsData" 
@@ -677,17 +678,11 @@ export default {
             :columns="column.tableColumns"
             :selectable="setTabSelectable"
             :checkbox="setTabSelectable()"
-            :iconOperation="false"
+            convenitentOperation
             @select="handleTabSelect"
             @selection-change="handleTabSelectionChange"
 
           >
-            <!-- <el-table-column
-              v-if=" tabName === 'puOrderItemList'" 
-              type="selection" 
-              width="45"
-            ></el-table-column> -->
-            <!-- <el-table-column type="index" width="50" label="序号"></el-table-column> -->
           </el-super-table>
          
         </el-tab-pane>
@@ -697,3 +692,11 @@ export default {
     </div>
   </el-card>
 </template>
+
+<style lang="scss">
+.purchaseTable{
+  .el-table__body-wrapper{
+    height: 480px;
+  }
+}
+</style>

+ 140 - 274
src/views/purchase/transferOrder/add.vue

@@ -1,73 +1,40 @@
 <template>
   <div id="addOder">
-    <el-card style="position: relative;">
+    <el-card style="position: relative">
       <span>基本信息</span>
-      <el-form
-        :model="basicForm"
-        :rules="basicRules"
-        ref="basic"
-        label-width="auto"
-      >
+      <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="调出库存组织">
-              <el-select
-                clearable
-                size="mini"
-                v-model="basicForm.deliveryInventoryOrg"
-                :disabled="sonDisable"
+              <el-select clearable :disabled="sonDisable" size="mini" v-model="basicForm.deliveryInventoryOrg" 
                 @clear="clean('调出库存组织')"
                 @change="controlCk('调出库存组织')"
                 @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in chuOrgOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in chuOrgOptions" :key="item.id" :label="item.name" :value="item.id"/>
               </el-select>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="订单类型">
-              <el-select
-                v-model="basicForm.billType"
-                :disabled="sonDisable"
-                size="mini"
-                style="width: 200px"
-                clearable
-              >
-                <el-option
-                  v-for="dict in dict.type.sys_allot_billtype"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                >
+              <el-select clearable v-model="basicForm.billType" :disabled="sonDisable" size="mini" style="width: 200px">
+                <el-option v-for="dict in dict.type.sys_allot_billtype" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="单据号">
-              <el-input
-                v-model="basicForm.code"
-                size="mini"
-                :disabled="sonDisable"
-                clearable
-                style="width: 200px"
-              />
+              <el-input clearable :disabled="sonDisable" v-model="basicForm.code" size="mini" style="width: 200px"/>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="单据日期">
-              <el-date-picker
-                v-model="basicForm.billDate"
-                size="mini"
-                :disabled="sonDisable"
-                type="date"
-                clearable
+              <el-date-picker clearable :disabled="sonDisable" v-model="basicForm.billDate" size="mini" type="date"
                 @change="changeBillDate"
                 value-format="yyyy-MM-dd"
                 style="width: 200px"
@@ -75,25 +42,16 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="调拨方式">
-              <el-select
-                v-model="basicForm.allotType"
-                disabled
-                size="mini"
-                style="width: 200px"
-                clearable
-              >
-                <el-option
-                  v-for="dict in dict.type.sys_to_type"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                >
+              <el-select clearable disabled v-model="basicForm.allotType" size="mini" style="width: 200px">
+                <el-option v-for="dict in dict.type.sys_to_type" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="调拨出库单号">
               <el-input
@@ -105,6 +63,7 @@
               />
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="调拨入库单号">
               <el-input
@@ -116,228 +75,130 @@
               />
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="调入库存组织">
-              <el-select
-                clearable
-                size="mini"
-                v-model="basicForm.storageInventoryOrg"
-                :disabled="sonDisable"
+              <el-select clearable :disabled="sonDisable" size="mini" v-model="basicForm.storageInventoryOrg"
                 @clear="clean('调入库存组织')"
                 @change="controlCk('调入库存组织')"
                 @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in ruOrgOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in ruOrgOptions" :key="item.id" :label="item.name" :value="item.id"/>
               </el-select>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="调出业务员">
-              <el-select
-                clearable
+              <el-select clearable :disabled="sonDisable"
                 size="mini"
                 v-model="basicForm.businessPersonal"
-                :disabled="sonDisable"
                 @clear="clean('调出业务员')"
                 @focus="chooseRefer('CONTACTS_PARAM', true, '调出业务员')"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in manOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.code"
-                />
+                <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code"/>
               </el-select>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="调出部门">
-              <el-select
-                clearable
+              <el-select clearable :disabled="sonDisable || isOrg"
                 size="mini"
                 v-model="basicForm.deliveryDept"
-                :disabled="sonDisable || isOrg"
-                @focus="
-                  chooseRefer(
-                    'DEPT_PARAM',
-                    true,
-                    '调出部门',
-                    basicForm.deliveryInventoryOrg
-                  )
-                "
+                @focus="chooseRefer('DEPT_PARAM', true, '调出部门', basicForm.deliveryInventoryOrg)"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in deptOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id"/>
               </el-select>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="币种">
-              <el-select
-                clearable
+              <el-select clearable :disabled="sonDisable"
                 size="mini"
                 v-model="basicForm.currency"
-                :disabled="sonDisable"
                 @focus="chooseRefer('CURRENCY_PARAM', true, '币种')"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in currencyOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in currencyOptions" :key="item.id" :label="item.name" :value="item.id"/>
               </el-select>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="折本汇率">
               <el-input-number
-                v-model="basicForm.rate"
-                size="mini"
-                disabled
-                :precision="2"
-                :step="0.1"
-                :max="10"
-                style="width: 200px"
-              ></el-input-number>
+                v-model="basicForm.rate" size="mini" disabled :precision="2" :step="0.1" :max="10" style="width: 200px"></el-input-number>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="在途归属">
-              <el-input
-                v-model="basicForm.onRouteAffilliation"
-                size="mini"
-                disabled
-                clearable
-                style="width: 200px"
-              />
+              <el-input clearable disabled v-model="basicForm.onRouteAffilliation" size="mini" style="width: 200px"/>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="总数量">
-              <el-input
-                v-model="basicForm.qty"
-                type="number"
-                min="0"
-                size="mini"
-                :disabled="sonDisable"
-                clearable
-                style="width: 200px"
-              />
+              <el-input clearable :disabled="sonDisable" v-model="basicForm.qty" type="number" min="0" size="mini" style="width: 200px"/>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="结算路径">
-              <el-input
-                v-model="basicForm.accountPath"
-                size="mini"
-                :disabled="sonDisable"
-                clearable
-                style="width: 200px"
-              />
+              <el-input clearable :disabled="sonDisable" v-model="basicForm.accountPath" size="mini" style="width: 200px"/>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="客户">
-              <el-select
-                clearable
+              <el-select clearable :disabled="sonDisable"
                 size="mini"
-                :disabled="sonDisable"
                 v-model="basicForm.customer"
                 @clear="clean('客户')"
                 @focus="chooseRefer('CUSTOMER_PARAM', true, '客户')"
                 style="width: 200px"
               >
                 <!-- @change="controlDRHW"  -->
-                <el-option
-                  v-for="item in customerOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id"/>
               </el-select>
-              <!-- <el-input
-                  v-model="basicForm.customer"
-                  size="mini"
-                  :disabled="sonDisable"
-                  clearable
-                  style="width: 200px"
-                /> -->
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="调入仓库">
-              <el-select
-                clearable
+              <el-select clearable :disabled="sonDisable || isOrg"
                 size="mini"
                 v-model="basicForm.storageWarehouse"
-                :disabled="sonDisable || isOrg"
                 @clear="clean('调入仓库')"
                 @change="controlDRHW"
-                @focus="
-                  chooseRefer(
-                    'WAREHOUSE_PARAM',
-                    true,
-                    '调入仓库',
-                    basicForm.storageInventoryOrg,
-                    'N',
-                    'N'
-                  )
-                "
+                @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in ruHouseOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in ruHouseOptions" :key="item.id" :label="item.name" :value="item.id"/>
               </el-select>
             </el-form-item>
           </el-col>
+
           <el-col :span="1.5">
             <el-form-item label="调出仓库">
-              <el-select
-                clearable
+              <el-select clearable :disabled="sonDisable || isOrg"
                 size="mini"
                 v-model="basicForm.deliveryWarehouse"
-                :disabled="sonDisable || isOrg"
                 @clear="clean('调出仓库')"
                 @change="controlDCHW"
-                @focus="
-                  chooseRefer(
-                    'WAREHOUSE_PARAM',
-                    true,
-                    '调出仓库',
-                    basicForm.deliveryInventoryOrg,
-                    'N',
-                    'N'
-                  )
-                "
+                @focus="chooseRefer('WAREHOUSE_PARAM', true, '调出仓库', basicForm.deliveryInventoryOrg, 'N', 'N')"
                 style="width: 200px"
               >
-                <el-option
-                  v-for="item in chuHouseOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+                <el-option v-for="item in chuHouseOptions" :key="item.id" :label="item.name" :value="item.id"/>
               </el-select>
             </el-form-item>
           </el-col>
+          
           <el-col :span="1.5">
             <el-form-item label="物流项目组">
               <el-select
@@ -1491,55 +1352,53 @@
       </el-form>
 
       <div class="btn_group">
-        <el-col :span="1.5">
-          <el-button
-            style="margin-right: 10px"
-            type="primary"
-            size="mini"
-            plain
-            @click="copy"
-            v-if="sonPageStu == 'check'"
-            >复制</el-button
-          >
-        </el-col>
-        <el-col :span="1.5">
-          <el-button
-            style="margin-right: 10px"
-            type="danger"
-            size="mini"
-            plain
-            @click="toNC"
-            v-if="sonPageStu == 'check' && row.status == '2'"
-            >重传NC</el-button
-          >
-        </el-col>
-        <el-col :span="1.5">
-          <el-button
-            style="margin-right: 10px"
-            type="primary"
-            size="mini"
-            plain
-            @click="save"
-            v-if="sonPageStu == 'add' || sonPageStu == 'edit'"
-            >保存</el-button
-          >
-        </el-col>
-        <el-col :span="1.5">
-          <el-button
-            style="margin-right: 10px"
-            type="primary"
-            size="mini"
-            plain
-            @click="submit"
-            v-if="
-              sonPageStu == 'check' && (row.status == '0' || row.status == '3')
-            "
-            >提交</el-button
-          >
-        </el-col>
-        <el-col :span="1.5">
-          <el-button size="mini" plain @click="back">返回</el-button>
-        </el-col>
+        <el-button
+          type="primary"
+          size="mini"
+          plain
+          @click="jumpOA"
+          v-if="
+            sonPageStu == 'check' &&
+            (row.status == '1' || row.status == '2') &&
+            row.oaId
+          "
+          >跳转OA</el-button
+        >
+        <el-button
+          type="primary"
+          size="mini"
+          plain
+          @click="copy"
+          v-if="sonPageStu == 'check'"
+          >复制</el-button
+        >
+        <el-button
+          type="danger"
+          size="mini"
+          plain
+          @click="toNC"
+          v-if="sonPageStu == 'check' && row.status == '2'"
+          >重传NC</el-button
+        >
+        <el-button
+          type="primary"
+          size="mini"
+          plain
+          @click="save"
+          v-if="sonPageStu == 'add' || sonPageStu == 'edit'"
+          >保存</el-button
+        >
+        <el-button
+          type="primary"
+          size="mini"
+          plain
+          @click="submit"
+          v-if="
+            sonPageStu == 'check' && (row.status == '0' || row.status == '3')
+          "
+          >提交</el-button
+        >
+        <el-button size="mini" plain @click="back">返回</el-button>
       </div>
     </el-card>
 
@@ -1551,6 +1410,7 @@
 </template>
 
 <script>
+import { toOA } from "@/api/purchase/purchaseDemand.js";
 import {
   addOrder,
   getOrderDetail,
@@ -1692,8 +1552,8 @@ export default {
       this.getDetails(this.row);
     } else if (this.pageStu == "edit") {
       this.getDetails(this.row);
-      this.isDRCk = false
-      this.isDCCk = false
+      this.isDRCk = false;
+      this.isDCCk = false;
     }
   },
   methods: {
@@ -1705,8 +1565,11 @@ export default {
     },
     // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
     controlCk(val) {
-      console.log("进了吗");
-      if (this.basicForm.deliveryInventoryOrg && this.basicForm.storageInventoryOrg){
+      if (val = '调出库存组织') {console.log("进了吗");}
+      if (
+        this.basicForm.deliveryInventoryOrg &&
+        this.basicForm.storageInventoryOrg
+      ) {
         this.isOrg = false;
       } else {
         this.basicForm.deliveryDept = "";
@@ -1757,25 +1620,20 @@ export default {
       this.basicForm.updateBy = "";
       this.basicForm.updateByName = "";
       this.basicForm.updateTime = "";
-      this.isDRCk = false
-      this.isDCCk = false
-    },
-    handleData() {
-      console.log("222");
+      this.basicForm.storageCode = "";
+      this.basicForm.deliveryCode = "";
       // 复制新增把id,编码,创建人置为空,子表去掉id
-      this.basicForm.id = "";
-      this.basicForm.code = "";
-      this.basicForm.createBy = "";
-      this.basicForm.createByName = "";
-      this.basicForm.createTime = "";
-      this.basicForm.isSendWms = "";
-      this.basicForm.ncCode = "";
-      this.basicForm.oaId = "";
-      this.basicForm.updateBy = "";
-      this.basicForm.updateByName = "";
-      this.basicForm.updateTime = "";
       if (this.materialInfo.length !== 0) {
         this.materialInfo.forEach((item) => {
+          if (item.deliveryCode) {
+            item.deliveryCode = "";
+          }
+          if (item.storageCode) {
+            item.storageCode = "";
+          }
+          if (item.demandCode) {
+            item.demandCode = "";
+          }
           if (item.allotId) {
             delete item.allotId;
           }
@@ -1794,6 +1652,8 @@ export default {
           }
         });
       }
+      this.isDRCk = false;
+      this.isDCCk = false;
     },
     toNC() {
       againToNC(this.row)
@@ -1825,7 +1685,6 @@ export default {
     save() {
       if (this.materialInfo.length !== 0) {
         if (this.sonPageStu == "add") {
-          this.handleData();
           this.basicForm.stAllotMaterialList = this.materialInfo;
           this.basicForm.stAllotReceiveDeliverList = this.receiveInfo;
           this.basicForm.stAllotReceiveExecuteList = this.priceList;
@@ -1901,7 +1760,7 @@ export default {
           if (this.basicForm.deliveryDept) {
             this.reBackRefer("DEPT_PARAM", this.basicForm.deliveryDept);
           }
-          
+
           if (this.basicForm.currency) {
             this.reBackRefer("CURRENCY_PARAM", this.basicForm.currency);
           }
@@ -1934,7 +1793,6 @@ export default {
     },
     // 回显参照框
     reBackRefer(type, id, title) {
-      console.log(type, id, title,'回显参照框');
       getRefer({ type: type, id: id, title: title }).then((res) => {
         if (type == "ORG_PARAM" && title == "调出库存组织") {
           this.chuOrgOptions = res.rows;
@@ -2016,7 +1874,7 @@ export default {
         classify: null,
         customerLogistic: null,
         customerLogisticName: null,
-        delFlag: 0
+        delFlag: 0,
       };
       this.materialInfo.push(newLine);
     },
@@ -2026,7 +1884,7 @@ export default {
         ...item,
         delFlag: index === $index ? "2" : item.delFlag,
       }));
-      console.log('看看列表',this.materialInfo)
+      console.log("看看列表", this.materialInfo);
     },
     //
     rowClassName(prop) {
@@ -2179,25 +2037,23 @@ export default {
     },
     selectMaterial(selection) {
       console.log("选中的物料", selection);
+      // 先清空通用名,调入调出结算规则明细
+      this.materialInfo[this.tableIndex].ruleDetail = ''
+      this.materialInfo[this.tableIndex].commonCode = ''
       this.materialInfo[this.tableIndex].material = selection[0].id;
       this.materialInfo[this.tableIndex].materialCode = selection[0].code;
       this.materialInfo[this.tableIndex].materialName = selection[0].name;
-      this.materialInfo[this.tableIndex].specification =
-        selection[0].specification;
+      this.materialInfo[this.tableIndex].specification = selection[0].specification;
       this.materialInfo[this.tableIndex].model = selection[0].model;
       this.materialInfo[this.tableIndex].originPlace = selection[0].originPlace;
-      this.materialInfo[this.tableIndex].originPlaceName =
-        selection[0].originPlaceName;
+      this.materialInfo[this.tableIndex].originPlaceName = selection[0].originPlaceName;
       this.materialInfo[this.tableIndex].unit = selection[0].unitId;
       this.materialInfo[this.tableIndex].mainUnit = selection[0].unitId;
       this.materialInfo[this.tableIndex].unitName = selection[0].unitIdName;
       this.materialInfo[this.tableIndex].mainUnitName = selection[0].unitIdName;
-      this.materialInfo[this.tableIndex].manufacturer =
-        selection[0].manufacturerIdName;
-      this.materialInfo[this.tableIndex].marketingApprovalPersonal =
-        selection[0].registrant;
-      this.materialInfo[this.tableIndex].production =
-        selection[0].productionPermit;
+      this.materialInfo[this.tableIndex].manufacturer = selection[0].manufacturerIdName;
+      this.materialInfo[this.tableIndex].marketingApprovalPersonal = selection[0].registrant;
+      this.materialInfo[this.tableIndex].production = selection[0].productionPermit;
       // 根据物料单位id查询单位code
       this.reBackRefer("UNIT_PARAM", selection[0].unitId);
     },
@@ -2206,7 +2062,7 @@ export default {
       this.tableIndex = index;
       this.referConditionMx.orgId = this.basicForm.deliveryInventoryOrg;
       this.referConditionMx.materialCode =
-        this.materialInfo[this.tableIndex].materialCode;
+      this.materialInfo[this.tableIndex].materialCode;
       this.referConditionMx.unitId = this.materialInfo[this.tableIndex].unit;
       this.referConditionMx.warehouseId = this.basicForm.deliveryWarehouse;
       this.$refs.batchRefer.init(this.referConditionMx);
@@ -2279,6 +2135,8 @@ export default {
         this.materialInfo[index].unitName = "";
         this.materialInfo[index].mainUnitName = "";
         this.materialInfo[index].manufacturer = "";
+        this.materialInfo[index].ruleDetail = ''
+        this.materialInfo[index].commonCode = ''
         this.materialInfo[index].marketingApprovalPersonal = "";
         this.materialInfo[index].production = "";
         this.materialInfo[index].unitCode = "";
@@ -2296,6 +2154,13 @@ export default {
         this.materialInfo[index].storageAllocation = "";
       }
     },
+    jumpOA() {
+      toOA(this.$store.state.user.name, this.basicForm.oaId).then((res) => {
+        if (res.code === 200) {
+          window.open(res.oaUrl);
+        }
+      });
+    },
   },
 };
 </script>
@@ -2311,7 +2176,8 @@ export default {
   display: flex;
   // justify-content: center;
   position: absolute;
-  top: 10px;right: 20px;
+  top: 10px;
+  right: 20px;
 }
 .btn_grooup {
   margin-bottom: 10px;