소스 검색

出入库复制新增修改

wengyuwen 4 년 전
부모
커밋
62b108bb3a
5개의 변경된 파일310개의 추가작업 그리고 261개의 파일을 삭제
  1. 1 2
      src/combination/MainForm.vue
  2. 23 41
      src/views/morePage/stock/index.vue
  3. 9 3
      src/views/project/index1.vue
  4. 46 23
      src/views/warehouse/inStock/index.vue
  5. 231 192
      src/views/warehouse/outStock/index.vue

+ 1 - 2
src/combination/MainForm.vue

@@ -63,9 +63,8 @@ export default {
       })
     },
     saveRules(res){
-      console.log("333")
       this.$refs["form"].validate((valid) => {
-        if (res == 1){
+        if (res == 1 || res == 2){
           this.$emit('backSave',valid,res)
         }else {
           this.$emit('backSave',valid)

+ 23 - 41
src/views/morePage/stock/index.vue

@@ -38,15 +38,23 @@
           </el-form-item>
         </el-col>
         <el-col :span="6">
-          <el-form-item label-width="100px" label="提单号" prop="actId">
-            <el-input
-              v-model="queryParams.actId"
-              placeholder="请输入提单号"
-              clearable
+          <el-form-item
+            label-width="100px"
+            label="提交日期"
+            prop="sendTime"
+          >
+            <el-date-picker
+              v-model="queryParams.sendTime"
               size="small"
               @keyup.enter.native="handleQuery"
               style="max-width: 187px"
-            />
+              type="datetimerange"
+              align="right"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              :default-time="['00:00:00', '23:59:59']"
+            >
+            </el-date-picker>
           </el-form-item>
         </el-col>
         <el-col :span="6">
@@ -100,26 +108,6 @@
             <el-col :span="6">
               <el-form-item
                 label-width="100px"
-                label="提交日期"
-                prop="sendTime"
-              >
-                <el-date-picker
-                  v-model="queryParams.sendTime"
-                  size="small"
-                  @keyup.enter.native="handleQuery"
-                  style="max-width: 187px"
-                  type="datetimerange"
-                  align="right"
-                  start-placeholder="开始日期"
-                  end-placeholder="结束日期"
-                  :default-time="['00:00:00', '23:59:59']"
-                >
-                </el-date-picker>
-              </el-form-item>
-            </el-col>
-            <el-col :span="6">
-              <el-form-item
-                label-width="100px"
                 label="业务日期"
                 prop="billTime"
               >
@@ -134,8 +122,6 @@
                 >
                 </el-date-picker> </el-form-item
             ></el-col>
-          </el-row>
-          <el-row>
             <el-col :span="6"
               ><el-form-item
                 label-width="100px"
@@ -359,7 +345,7 @@
       <el-table-column label="操作" width="80">
         <template slot-scope="scope">
           <span style="cursor: pointer" @click="approval(scope.row)"
-            >查看详情</span
+            >审核业务</span
           >
         </template>
       </el-table-column>
@@ -438,19 +424,12 @@ export default {
         },
         {
           surface: "2",
-          label:Cookies.get("sysType") == 3 ? "sendTime" : "billTime",
+          label: "sendTime",
           name: "日期",
           checked: 0,
           width: 120,
         },
         {
-          surface: "3",
-          label: "refno3",
-          name: "提单号",
-          checked: 0,
-          width: 120,
-        },
-        {
           surface: "4",
           label: "refno2",
           name: "业务类型",
@@ -460,7 +439,7 @@ export default {
         {
           surface: "5",
           label: "fAmount",
-          name: "出入库费",
+          name: "金额",
           checked: 0,
           width: 120,
         },
@@ -722,7 +701,8 @@ export default {
                   size: 'mini',
                   icon: 'el-icon-edit-outline',
                   name: '审批',
-                  disabled: false
+                  disabled: false,
+                  pendingPage:true
                 }
               )
             }
@@ -739,7 +719,8 @@ export default {
                   size: 'mini',
                   icon: 'el-icon-edit-outline',
                   name: '审批',
-                  disabled: false
+                  disabled: false,
+                  pendingPage:true
                 }
               )
             }
@@ -756,7 +737,8 @@ export default {
                   size: 'mini',
                   icon: 'el-icon-edit-outline',
                   name: '审批',
-                  disabled: false
+                  disabled: false,
+                  pendingPage:true
                 }
               )
             }

+ 9 - 3
src/views/project/index1.vue

@@ -295,6 +295,15 @@
       />
     </div>
     <div v-if="mainTabel == true">
+      <el-breadcrumb separator="/" style="display:flex;align-items: center;margin-bottom: 10px">
+        <el-breadcrumb-item>项目管理</el-breadcrumb-item>
+        <el-breadcrumb-item>项目管理详情页</el-breadcrumb-item>
+        <el-breadcrumb-item>
+          <el-button plain size="mini" type="danger" icon="el-icon-arrow-left" @click="goBack">
+            返回列表
+          </el-button>
+        </el-breadcrumb-item>
+      </el-breadcrumb>
       <el-form label-width="88px" ref="detailform" :model="detailform" :rules="rules">
         <el-row>
           <el-col :span="6">
@@ -350,9 +359,6 @@
       </el-form>
       <el-row :gutter="10" class="mb8">
         <el-col :span="1.5">
-          <el-button v-if="cancelButton === true" size="mini" type="danger" icon="el-icon-refresh-left" @click="goBack">返回列表</el-button>
-        </el-col>
-        <el-col :span="1.5">
           <el-button v-if="cancelButton === false" size="mini" icon="el-icon-refresh-left" type="danger" @click="cancelTwo">返回首页</el-button>
         </el-col>
         <el-col :span="1.5">

+ 46 - 23
src/views/warehouse/inStock/index.vue

@@ -41,7 +41,7 @@
     <div v-if="MainTable == true">
       <el-breadcrumb separator="/" style="display:flex;align-items: center;margin-bottom: 10px">
         <el-breadcrumb-item>仓库入库</el-breadcrumb-item>
-        <el-breadcrumb-item>仓库入库详情</el-breadcrumb-item>
+        <el-breadcrumb-item>仓库入库详情</el-breadcrumb-item>
         <el-breadcrumb-item>
           <el-button plain size="mini" type="danger" icon="el-icon-arrow-left" @click="backRules">
             返回列表
@@ -735,7 +735,7 @@ export default {
           type:'primary',
           size:'mini',
           icon:'el-icon-edit',
-          name:'录入',
+          name:'录入明细',
           disabled:false,
         },
         {
@@ -749,7 +749,7 @@ export default {
           type:'primary',
           size:'mini',
           icon:'el-icon-edit',
-          name:'新',
+          name:'新',
           plain: true,
           disabled:false,
         },
@@ -757,7 +757,7 @@ export default {
           type:'primary',
           size:'mini',
           icon:'el-icon-edit',
-          name:'复制新',
+          name:'复制新',
           copyeRow:true,
           plain: true,
           disabled:false,
@@ -1163,14 +1163,14 @@ export default {
         }
         for(let li in this.detailButton){
           if(this.detailForm.fBillstatus == '6'){
-            if(this.detailButton[li].name == '录入' || this.detailButton[li].name == '保存' ||
+            if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
               this.detailButton[li].name == '入库确认' || this.detailButton[li].name == '刷新' || this.detailButton[li].name == '修改'){
               this.detailButton[li].disabled = true
             }else{
               this.detailButton[li].disabled = false
             }
           } else {
-            if(this.detailButton[li].name == '录入' || this.detailButton[li].name == '保存' ||
+            if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
               this.detailButton[li].name == '入库确认' || this.detailButton[li].name == '刷新'){
               this.detailButton[li].disabled = true
             }else{
@@ -1341,8 +1341,22 @@ export default {
                 this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
                 this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
               }
-              this.$message.success("操作成功")
+              this.$message.success("保存成功")
               this.getList();
+              if(i == 2){
+                let data = {
+                  fBilltype:'RK',
+                  fId:this.detailForm.fId
+                }
+                copyNew(data).then(res=>{
+                  if(res.code == 200) {
+                    this.$message.success("操作成功")
+                    this.copyeId = res.data
+                    this.getList()
+                    this.viewMethod(null,1)
+                  }
+                })
+              }
               if(i == 1){
                 this.MainTable = false
                 this.inDex = 4
@@ -1375,7 +1389,27 @@ export default {
           }
           this.MainTable = true
           break
-        case '录入':
+        case '新单':
+          this.detailList.columnList = this.detailStyle
+          this.detailForm = {}
+          this.detailData = []
+          this.inDex = this.detailOption.length
+          //从表修改按钮
+          for(let li in this.detailStyle){
+            if(!this.detailStyle[li].doNot){
+              this.detailStyle[li].disabled = false
+            }
+          }
+          for(let item in this.detailOption){
+            if(!this.detailOption[item].doNot){
+              this.detailOption[item].disabled = false
+            }
+          }
+          for(let li in this.detailButton){
+            this.detailButton[li].disabled = false
+          }
+          break
+        case '录入明细':
           this.$refs.detailForm.rules()
           break
         case '返回列表':
@@ -1429,18 +1463,12 @@ export default {
                 this.detailOption[item].disabled = true
               }
               for(let li in this.detailButton) {
-                if(this.detailButton[li].name == '录入' || this.detailButton[li].name == '保存' ||
+                if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
                   this.detailButton[li].name == '入库确认' || this.detailButton[li].name == '刷新' || this.detailButton[li].name == '修改'){
                   this.detailButton[li].disabled = true
                 }else{
                   this.detailButton[li].disabled = false
                 }
-                // if (this.detailButton[li].name == '返回列表' || this.detailButton[li].name == '新增' ||
-                //   this.detailButton[li].name == '复制新增' || this.detailButton[li].name == '打印') {
-                //   this.detailButton[li].disabled = false
-                // }else{
-                //   this.detailButton[li].disabled = true
-                // }
               }
             })
 
@@ -1464,13 +1492,6 @@ export default {
           }
           break
         case '复制新增':
-          if(row.copyeRow){
-            if(this.selection.length == 0){
-              this.$message.error("请选择行")
-            }else{
-              this.detailData = this.detailData.concat(this.selection)
-            }
-          }else{
             let formDate = {
               fBilltype:'RK',
               fId:this.selection[0].fId
@@ -1483,7 +1504,9 @@ export default {
                 this.viewMethod(null,1)
               }
             })
-          }
+          break
+        case '复制新单':
+          this.$refs.detailForm.saveRules('2')
           break
         case '打印':
           this.formList = this.detailForm

+ 231 - 192
src/views/warehouse/outStock/index.vue

@@ -41,7 +41,7 @@
     <div v-if="MainTable == true">
       <el-breadcrumb separator="/" style="display:flex;align-items: center;margin-bottom: 10px">
         <el-breadcrumb-item>仓库出库</el-breadcrumb-item>
-        <el-breadcrumb-item>仓库出库详情</el-breadcrumb-item>
+        <el-breadcrumb-item>仓库出库详情</el-breadcrumb-item>
         <el-breadcrumb-item>
           <el-button plain size="mini" type="danger" icon="el-icon-arrow-left" @click="backRules">
             返回列表
@@ -103,11 +103,11 @@
             <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">供货商</td>
             <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">供货人</td>
             <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">联系电话</td>
-<!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">生产日期或批号</td>-->
-<!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">保质期限</td>-->
-<!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">保存条件</td>-->
-<!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">索证索票情况</td>-->
-<!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">采购人</td>-->
+            <!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">生产日期或批号</td>-->
+            <!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">保质期限</td>-->
+            <!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">保存条件</td>-->
+            <!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">索证索票情况</td>-->
+            <!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">采购人</td>-->
             <td class="column" style="border: 1px solid #000; padding:10px" align="center" colspan="2">检验结果</td>
 
             <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">验收人</td>
@@ -124,11 +124,11 @@
             <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{detailForm.corpName}}</td>
             <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fAmount}}</td>
             <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fStltypeid}}</td>
-<!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.tProductdate}}/{{item.fLotno}}</td>-->
-<!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fValid}}</td>-->
-<!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fStoreEnv}}</td>-->
-<!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fIsfilles}}</td>-->
-<!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{detailForm.fPurchase}}</td>-->
+            <!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.tProductdate}}/{{item.fLotno}}</td>-->
+            <!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fValid}}</td>-->
+            <!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fStoreEnv}}</td>-->
+            <!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fIsfilles}}</td>-->
+            <!--            <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{detailForm.fPurchase}}</td>-->
             <td class="column" style="border: 1px solid #000; padding:10px" align="center" ></td>
             <td class="column" style="border: 1px solid #000; padding:10px" align="center" ></td>
             <td class="column" style="border: 1px solid #000; padding:10px" align="center" ></td>
@@ -156,8 +156,7 @@ export default {
   name: 'inStock',
   data(){
     return{
-      copyId:'',
-      setRowList:[],
+      copyeId:'',
       hasPermi:{
         lookup:['anpin:stockControl:query'],
         disappear:['anpin:stockControl:remove']
@@ -205,6 +204,7 @@ export default {
       detailForm:{
 
       },
+      setRowList:[],
       //主页面默认显示4个表单数据
       formOption:[
         {
@@ -392,8 +392,8 @@ export default {
           name: "操作",
           checked: 0,
           width: 200,
-          fixed:'right',
-          operation:1
+          operation:1,
+          fixed:'right'
         }
 
       ],
@@ -413,6 +413,7 @@ export default {
           checked: 0,
           width: 200,
           changeable:1,
+          data:[],
         },
         {
           surface: "3",
@@ -479,73 +480,73 @@ export default {
           data:[],
           disabled:false
         },
-        // {
-        //   surface: "9",
-        //   label: "tProductdate",
-        //   name: "生产日期",
-        //   checked: 0,
-        //   width: 100,
-        //   operation:2,
-        //   changeable: 3,
-        //   data:[],
-        //   disabled:false
-        // },{
-        //   surface: "10",
-        //   label: "fLotno",
-        //   name: "批号",
-        //   checked: 0,
-        //   width: 100,
-        //   operation:2,
-        //   changeable: 2,
-        //   data:[],
-        //   disabled:false
-        // },
-        // {
-        //   surface: "11",
-        //   label: "fValid",
-        //   name: "保质期限",
-        //   checked: 0,
-        //   width: 100,
-        //   operation:2,
-        //   changeable: 2,
-        //   data:[],
-        //   disabled:false,
-        //   onabort:'this.value=this.value.replace(/[^\\d^\\.]+/g,\'\')'
-        // },
-        // {
-        //   surface: "12",
-        //   label: "fUnits",
-        //   name: "单位",
-        //   checked: 0,
-        //   width: 100,
-        //   operation:2,
-        //   changeable: 1,
-        //   data:[],
-        //   disabled:false
-        // },
-        // {
-        //   surface: "13",
-        //   label: "fStoreEnv",
-        //   name: "存储环境",
-        //   checked: 0,
-        //   width: 100,
-        //   operation:2,
-        //   changeable: 1,
-        //   data:[],
-        //   disabled:false
-        // },
-        // {
-        //   surface: "14",
-        //   label: "fIsfilles",
-        //   name: "索证索票",
-        //   checked: 0,
-        //   width: 100,
-        //   operation:2,
-        //   changeable: 1,
-        //   disabled:false
-        // },
         {
           surface: "10",
+          label: "tProductdate",
+          name: "生产日期",
+          checked: 0,
+          width: 100,
+          operation:2,
+          changeable: 3,
+          data:[],
+          disabled:false
+        },{
+          surface: "11",
+          label: "fLotno",
+          name: "批号",
+          checked: 0,
+          width: 100,
+          operation:2,
+          changeable: 2,
+          data:[],
+          disabled:false
+        },
+        {
+          surface: "12",
+          label: "fValid",
+          name: "保质期限",
+          checked: 0,
+          width: 100,
+          operation:2,
+          changeable: 2,
+          data:[],
+          disabled:false,
+          onabort:'this.value=this.value.replace(/[^\\d^\\.]+/g,\'\')'
+        },
+        {
+          surface: "13",
+          label: "fUnits",
+          name: "单位",
+          checked: 0,
+          width: 100,
+          operation:2,
+          changeable: 1,
+          data:[],
+          disabled:false
+        },
+        {
+          surface: "14",
+          label: "fStoreEnv",
+          name: "存储环境",
+          checked: 0,
+          width: 100,
+          operation:2,
+          changeable: 1,
+          data:[],
+          disabled:false
+        },
+        {
+          surface: "15",
+          label: "fIsfilles",
+          name: "索证索票",
+          checked: 0,
+          width: 100,
+          operation:2,
+          changeable: 1,
+          disabled:false
+        },
+        {
+          surface: "16",
           label: "remark",
           name: "备注",
           checked: 0,
@@ -554,7 +555,7 @@ export default {
           changeable: 2,
           disabled:false
         },{
-          surface: "11",
+          surface: "17",
           label: "fReviewDate",
           name: "审核日期",
           checked: 0,
@@ -562,14 +563,14 @@ export default {
           operation:2,
         },
         {
-          surface: "12",
+          surface: "18",
           label: "createBy",
           name: "申请人",
           checked: 0,
           width: 100,
           operation:2,
         },{
-          surface: "13",
+          surface: "19",
           label: "fMaterial10",
           name: "操作",
           checked: 0,
@@ -617,18 +618,18 @@ export default {
           data:[],
           disabled:false
         },
-        // {
-        //   index:'4',
-        //   span:6,
-        //   label: 'fPurchase',
-        //   name:"采购人",
-        //   form:1,
-        //   width:200,
-        //   labelSize:'80',
-        //   rules:{ required: true, message: ' ', trigger: 'blur' },
-        //   data:[],
-        //   disabled:false
-        // },
+        {
+          index:'4',
+          span:6,
+          label: 'fPurchase',
+          name:"采购人",
+          form:1,
+          width:200,
+          labelSize:'80',
+          rules:{ required: true, message: ' ', trigger: 'blur' },
+          data:[],
+          disabled:false
+        },
         {
           index:'5',
           span:6,
@@ -723,13 +724,21 @@ export default {
         }
       ],
       detailButton:[
+        // {
+        //   type:'danger',
+        //   size:'mini',
+        //   icon:'el-icon-refresh-left',
+        //   name:'返回列表',
+        //   disabled:false,
+        // },
         {
           type:'primary',
           size:'mini',
           icon:'el-icon-edit',
-          name:'录入',
+          name:'录入明细',
           disabled:false,
-        },{
+        },
+        {
           type:'success',
           size:'mini',
           icon:'el-icon-check',
@@ -740,7 +749,7 @@ export default {
           type:'primary',
           size:'mini',
           icon:'el-icon-edit',
-          name:'新',
+          name:'新',
           plain: true,
           disabled:false,
         },
@@ -748,7 +757,7 @@ export default {
           type:'primary',
           size:'mini',
           icon:'el-icon-edit',
-          name:'复制新',
+          name:'复制新',
           copyeRow:true,
           plain: true,
           disabled:false,
@@ -840,6 +849,10 @@ export default {
     this.selectMethods()
   },
   methods:{
+    //返回列表
+    goBack(){
+
+    },
     change(scope){
       for(let item in this.detailData){
         for(let li in this.listData.fFeeid){
@@ -946,7 +959,8 @@ export default {
 
             }
           })
-        }else if(this.detailOption[li].name == '供应商'){
+        }
+        if(this.detailOption[li].name == '供应商'){
           //获取供应商
           let queryParams = { pageNum: 1, fTypeid: 1}
           getustomer(queryParams).then(res => {
@@ -957,7 +971,8 @@ export default {
               })
             }
           })
-        }else if(this.detailOption[li].name == '开票公司'){
+        }
+        if(this.detailOption[li].name == '开票公司'){
           //获取付款单位
           let queryParams = { pageNum: 1, fTypeid: 2}
           getustomer(queryParams).then(res => {
@@ -968,7 +983,8 @@ export default {
               })
             }
           })
-        }else if(this.detailOption[li].name == '库管员'){
+        }
+        if(this.detailOption[li].name == '库管员'){
           let queryParams = { pageNum: 1,roleName:'库管'}
           getWarehousekeeper(queryParams).then(res=>{
             for(let item in res.rows){
@@ -979,9 +995,8 @@ export default {
             }
           })
         }
-        else if(this.detailOption[li].name == '采购人'){
+        if(this.detailOption[li].name == '采购人'){
           getliable().then((res) => {
-            console.log(res)
             for(let item in res.rows){
               this.detailOption[li].data.push({
                 label:res.rows[item].userName,
@@ -1037,7 +1052,6 @@ export default {
       //获取品名
       let queryParams = { pageNum: 1 }
       getGoodName(queryParams).then(res=>{
-        console.log(res)
         for(let item in res.rows){
           this.listData.fFeeid.push({
             label:res.rows[item].fName,
@@ -1086,7 +1100,6 @@ export default {
             this.$set(this.detailList,'columnList',this.$options.data().detailStyle)
             this.setRowList = this.$options.data().detailStyle
           }
-          // this.pageDisplay = false
           this.isItHidden = false
           this.inDex = this.detailOption.length
         }else {
@@ -1101,7 +1114,6 @@ export default {
             this.$set(this.queryList,'columnList',this.$options.data().listStyle)
             this.setRowList = this.$options.data().listStyle
           }
-          // this.pageDisplay = true
           this.isItHidden = true
           this.inDex = 4
         }
@@ -1125,65 +1137,61 @@ export default {
       if(scope){
         fId = scope.row.fId
       }else if(res){
-        fId = this.copyId
+        fId = this.copyeId
       } else{
         fId = this.ids
       }
-        getSave(fId).then(res=>{
-          if(res.code == 200){
-            if(res.data.warehouseBills){
-              this.detailForm = res.data.warehouseBills
-              this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
-            }
-            if(res.data.tWarehousebillsfees){
-              this.detailData = res.data.tWarehousebillsfees
-              for(let li in this.detailData){
-                this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
-                if(this.detailData[li].fStltypeid == null){
-                  this.$set(this.detailData[li],'fStltypeid','')
-                }else{
-                  this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
-                }
-              }
-            }
-          }
-          for(let li in this.detailStyle){
-            this.detailStyle[li].disabled = true
+      getSave(fId).then(res=>{
+        if(res.code == 200){
+          if(res.data.warehouseBills){
+            this.detailForm = res.data.warehouseBills
+            this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
           }
-          for(let item in this.detailOption){
-            this.detailOption[item].disabled = true
+          if(res.data.tWarehousebillsfees){
+            this.detailData = res.data.tWarehousebillsfees
+            for(let li in this.detailData){
+              this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
+              this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
+            }
           }
-          for(let li in this.detailButton){
-            if(this.detailForm.fBillstatus == '6'){
-              if(this.detailButton[li].name == '录入' || this.detailButton[li].name == '保存' ||
-                this.detailButton[li].name == '出库确认' || this.detailButton[li].name == '刷新' || this.detailButton[li].name == '修改'){
-                this.detailButton[li].disabled = true
-              }else{
-                this.detailButton[li].disabled = false
-              }
-            } else {
-              if(this.detailButton[li].name == '录入' || this.detailButton[li].name == '保存' ||
-                this.detailButton[li].name == '出库确认' || this.detailButton[li].name == '刷新'){
-                this.detailButton[li].disabled = true
-              }else{
-                this.detailButton[li].disabled = false
-              }
+        }
+        for(let li in this.detailStyle){
+          this.detailStyle[li].disabled = true
+        }
+        for(let item in this.detailOption){
+          this.detailOption[item].disabled = true
+        }
+        for(let li in this.detailButton){
+          if(this.detailForm.fBillstatus == '6'){
+            if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
+              this.detailButton[li].name == '出库确认' || this.detailButton[li].name == '刷新' || this.detailButton[li].name == '修改'){
+              this.detailButton[li].disabled = true
+            }else{
+              this.detailButton[li].disabled = false
+            }
+          } else {
+            if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
+              this.detailButton[li].name == '出库确认' || this.detailButton[li].name == '刷新'){
+              this.detailButton[li].disabled = true
+            }else{
+              this.detailButton[li].disabled = false
             }
           }
-          getArea(this.detailForm.fWarehouseid).then(res=>{
-            if(res.code == 200){
-              this.listData.fWarehouseid = []
-              for(let item in res.data){
-                this.listData.fWarehouseid.push({
-                  label:res.data[item].fWarehouseInformation,
-                  value:res.data[item].id
-                })
-              }
+        }
+        getArea(this.detailForm.fWarehouseid).then(res=>{
+          if(res.code == 200){
+            this.listData.fWarehouseid = []
+            for(let item in res.data){
+              this.listData.fWarehouseid.push({
+                label:res.data[item].fWarehouseInformation,
+                value:res.data[item].id
+              })
             }
-          })
-          this.MainTable = true
-          this.inDex = this.detailOption.length
+          }
         })
+        this.MainTable = true
+        this.inDex = this.detailOption.length
+      })
     },
     //修改
     modification(scope){
@@ -1331,14 +1339,24 @@ export default {
             this.detailData = res.data.tWarehousebillsCntrs
             for(let li in this.detailData){
               this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
-              if(this.detailData[li].fStltypeid == null){
-                this.$set(this.detailData[li],'fStltypeid','')
-              }else{
-                this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
-              }
+              this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
             }
-            this.$message.success("操作成功")
+            this.$message.success("保存成功")
             this.getList();
+            if(i == 2){
+              let data = {
+                fBilltype:'CK',
+                fId:this.detailForm.fId
+              }
+              copyNew(data).then(res=>{
+                if(res.code == 200) {
+                  this.$message.success("操作成功")
+                  this.copyeId = res.data
+                  this.getList()
+                  this.viewMethod(null,1)
+                }
+              })
+            }
             if(i == 1){
               this.MainTable = false
               this.inDex = 4
@@ -1371,14 +1389,36 @@ export default {
           }
           this.MainTable = true
           break
-        case '录入':
+        case '新单':
+          this.detailList.columnList = this.detailStyle
+          this.detailForm = {}
+          this.detailData = []
+          this.inDex = this.detailOption.length
+          //从表修改按钮
+          for(let li in this.detailStyle){
+            if(!this.detailStyle[li].doNot){
+              this.detailStyle[li].disabled = false
+            }
+          }
+          for(let item in this.detailOption){
+            if(!this.detailOption[item].doNot){
+              this.detailOption[item].disabled = false
+            }
+          }
+          for(let li in this.detailButton){
+            this.detailButton[li].disabled = false
+          }
+          break
+        case '录入明细':
           this.$refs.detailForm.rules()
           break
+        case '返回列表':
+          this.backRules()
+          break
         case '保存':
           this.$refs.detailForm.saveRules()
           break
         case '出库确认':
-          console.log(this.detailData)
           if(this.detailData.length == 0){
             this.$message.error("请维护明细")
           }else{
@@ -1423,10 +1463,11 @@ export default {
                 this.detailOption[item].disabled = true
               }
               for(let li in this.detailButton) {
-                if (this.detailButton[li].name == '返回列表') {
-                  this.detailButton[li].disabled = false
-                }else{
+                if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
+                  this.detailButton[li].name == '出库确认' || this.detailButton[li].name == '刷新' || this.detailButton[li].name == '修改'){
                   this.detailButton[li].disabled = true
+                }else{
+                  this.detailButton[li].disabled = false
                 }
               }
             })
@@ -1451,26 +1492,21 @@ export default {
           }
           break
         case '复制新增':
-          if(row.copyeRow){
-            if(this.selection.length == 0){
-              this.$message.error("请选择行")
-            }else{
-              this.detailData = this.detailData.concat(this.selection)
-            }
-          }else{
-            let formDate = {
-              fBilltype:'CK',
-              fId:this.selection[0].fId
-            }
-            copyNew(formDate).then(res=>{
-              if(res.code == 200) {
-                this.$message.success("操作成功")
-                this.copyeId = res.data
-                this.getList()
-                this.viewMethod(null,1)
-              }
-            })
+          let formDate = {
+            fBilltype:'CK',
+            fId:this.selection[0].fId
           }
+          copyNew(formDate).then(res=>{
+            if(res.code == 200) {
+              this.$message.success("操作成功")
+              this.copyeId = res.data
+              this.getList()
+              this.viewMethod(null,1)
+            }
+          })
+          break
+        case '复制新单':
+          this.$refs.detailForm.saveRules('2')
           break
         case '打印':
           this.formList = this.detailForm
@@ -1502,11 +1538,15 @@ export default {
       this.getList()
     },
     //点击刷新会调用此方法
-    getList(){
+    getList(res){
       this.queryParms.fBilltype = 'CK'
-      listInStock(this.queryParms).then(res=>{
-        this.tableData = res.rows
-        this.total = res.total
+      listInStock(this.queryParms).then(response=>{
+        this.tableData = response.rows
+        this.total = response.total
+        if(res == 1){
+          this.copyeId = this.tableData[0].fId
+          this.viewMethod(null,1)
+        }
       })
     },
   }
@@ -1520,5 +1560,4 @@ export default {
 .app-container ::v-deep .el-table__body-wrapper{
   z-index: 2;
 }
-
 </style>