DESKTOP-B78GIPM\admin il y a 2 ans
Parent
commit
f5ce649df3

+ 2 - 2
src/mixins/JeecgListMixin.js

@@ -227,8 +227,8 @@ export const JeecgListMixin = {
       }
       console.log('currentIndex',currentIndex)
     },
-    handleEdit: function (record) {
-      this.$refs.modalForm.edit(record);
+    handleEdit: function (record, flag) {
+      this.$refs.modalForm.edit(record, flag);
       this.$refs.modalForm.title = "编辑";
       this.$refs.modalForm.disableSubmit = false;
     },

+ 88 - 23
src/views/finance/financeModules/depository.vue

@@ -47,14 +47,23 @@
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div> -->
 
-        <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columnsCopy" :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{
-          selectedRowKeys: selectedRowKeys,
-          onChange: onSelectChange,
-        }" class="j-table-force-nowrap" @change="handleTableChange">
+        <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columnsCopy" :dataSource="dataSource" :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" @change="handleTableChange">
 
-        <template slot="action" slot-scope="text, record" >
-            {{record | sum}}
-        </template>
+            <template slot="action" slot-scope="text, record">
+                {{record | sum}}
+            </template>
+
+            <template slot="footer" slot-scope="currentPageData">
+                <div class="tableData">
+
+                </div>
+                <a-table size="middle" bordered :showHeader="false" :pagination="false" :columns="columnsCopy" :dataSource="dataList">
+                    <template slot="action" slot-scope="text, record">
+                        {{record | sum}}
+                    </template>
+
+                </a-table>
+            </template>
 
         </a-table>
     </div>
@@ -82,10 +91,36 @@ export default {
         // DepositoryModal,
     },
     computed: {
-        
+        dataList() {
+            if (this.dataSource.length == 0) {
+                return []
+            }
+            let arr = Object.keys(this.dataSource[0])
+            let brr = [] 
+            arr = arr.filter(item => item != 'department' && item != 'hotel_name' && item != 'flag')
+            let sum = 0
+            arr.forEach(item => {
+                sum += this.dataSource[this.dataSource.length - 1][item]
+            })
+            arr.forEach(item => {
+                console.log(item);
+                // this.columnsCopy.push({
+                //     title: item,
+                //     align: 'center',
+                //     dataIndex: item
+                // })
+                let a = {}
+                a[item] = this.dataSource.reduce((a, b) => a + b[item], 0)
+                brr.push(a)
+            })
+            let obj1 = {}
+            obj1=Object.assign({}, ...brr, {hotel_name: '合计'},{flag:true});
+            console.log(obj1);
+            return [obj1]
+        }
     },
-    filters:{
-        sum(data){
+    filters: {
+        sum(data) {
             let arr = Object.keys(data)
             arr = arr.filter(item => item != 'department' && item != 'hotel_name' && item != 'flag')
             let sum = 0
@@ -97,7 +132,7 @@ export default {
     },
     watch: {
         dataSource(newVal) {
-            if (newVal[newVal.length-1].flag) {
+            if (newVal[newVal.length - 1].flag) {
                 return
             }
             let obj = Object.keys(newVal[0])
@@ -105,11 +140,13 @@ export default {
                     title: "商家",
                     align: "center",
                     dataIndex: "hotel_name",
+                    width:'330px'
                 },
                 {
                     title: "部门",
                     align: "center",
                     dataIndex: "department",
+                    width:'120px'
                 }
             ]
             //去除数组中某个字符串
@@ -119,11 +156,12 @@ export default {
                 this.columnsCopy.push({
                     title: item,
                     align: 'center',
-                    dataIndex: item
+                    dataIndex: item,
+                    width:'120px'
                 })
-                let a = {}
-                a[item] = this.dataSource.reduce((a, b) => a + b[item], 0)
-                this.arr.push(a)
+                // let a = {}
+                // a[item] = this.dataSource.reduce((a, b) => a + b[item], 0)
+                // this.arr.push(a)
                 // arr.push({
                 //     item : this.dataSource.reduce((a, b) => a + b[item], 0)
                 // })
@@ -136,13 +174,13 @@ export default {
                     customRender: 'action'
                 }
             })
-            let obj1 = {}
-            obj1=Object.assign({}, ...this.arr, {hotel_name: '合计'},{flag:true});
-            this.dataSource.push(obj1)
+            // let obj1 = {}
+            // obj1=Object.assign({}, ...this.arr, {hotel_name: '合计'},{flag:true});
+            // this.dataSource.push(obj1)
 
         }
     },
-    mounted(){
+    mounted() {
 
     },
     data() {
@@ -151,8 +189,8 @@ export default {
             queryParam: {
                 departmentId: '0',
             },
-            arr:[],
-            dataList:[],
+            arr: [],
+            // dataList:[],
             examineVisible: false,
             // 分页参数
             ipagination: {
@@ -171,14 +209,16 @@ export default {
                     title: "商家",
                     align: "center",
                     dataIndex: "hotel_name",
+                    width:'200px'
                 },
                 {
                     title: "部门",
                     align: "center",
                     dataIndex: "department",
+                    width:'200px'
                 }
             ],
-            columnsCopy:[
+            columnsCopy: [
 
             ],
             url: {
@@ -240,6 +280,31 @@ export default {
 };
 </script>
 
-<style scoped>
+<style lang="less" scoped>
 @import "~@assets/less/common.less";
+
+/deep/ .ant-table-content .ant-table-body {
+    position: relative;
+    z-index: 2;
+    background: #FFFFFF;
+}
+
+/deep/ .ant-table-footer .ant-table-body {
+    overflow: hidden !important;
+    position: relative !important;
+    z-index: 1 !important;
+}
+
+/deep/ .ant-table-content>.ant-table-footer {
+    padding: 0 !important;
+    top: -47px;
+    position: relative;
+    z-index: 0;
+}
+/deep/.ant-table-footer{
+    padding: 0 !important;
+    top: -8px;
+    position: relative;
+    z-index: 2;
+}
 </style>

+ 26 - 30
src/views/finance/financeModules/detailedReport.vue

@@ -47,10 +47,7 @@
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div> -->
 
-        <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{
-          selectedRowKeys: selectedRowKeys,
-          onChange: onSelectChange,
-        }" class="j-table-force-nowrap" @change="handleTableChange">
+        <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" @change="handleTableChange">
 
         <template slot="action" slot-scope="text, record" >
             {{record | sum}}
@@ -210,11 +207,6 @@ export default {
                     align: "center",
                     dataIndex: "department",
                 },
-                // {
-                //     title: "账单类型",
-                //     align: "center",
-                //     dataIndex: "department",
-                // },
                 {
                     title: "付款方式",
                     align: "center",
@@ -225,11 +217,6 @@ export default {
                     align: "center",
                     dataIndex: "order_id",
                 },
-                // {
-                //     title: "系统单号",
-                //     align: "center",
-                //     dataIndex: "department",
-                // },
                 {
                     title: "姓名",
                     align: "center",
@@ -250,21 +237,6 @@ export default {
                     align: "center",
                     dataIndex: "create_time",
                 },
-                // {
-                //     title: "操作人员",
-                //     align: "center",
-                //     dataIndex: "department",
-                // },
-                // {
-                //     title: "营业日",
-                //     align: "center",
-                //     dataIndex: "department",
-                // },
-                // {
-                //     title: "备注",
-                //     align: "center",
-                //     dataIndex: "department",
-                // }
             ],
             url: {
                 list: "/finance/summary/financePage?departmentId=0",
@@ -325,7 +297,7 @@ export default {
 };
 </script>
 
-<style scoped>
+<style lang="less" scoped>
 @import "~@assets/less/common.less";
 .ant-table.ant-table-small {
   border: none;
@@ -333,4 +305,28 @@ export default {
 .ant-table.ant-table-small .ant-table-tbody > tr > td {
   border: none;
 }
+/deep/ .ant-table-content .ant-table-body {
+    position: relative;
+    z-index: 2;
+    background: #FFFFFF;
+}
+
+/deep/ .ant-table-footer .ant-table-body {
+    overflow: hidden !important;
+    position: relative !important;
+    z-index: 1 !important;
+}
+
+/deep/ .ant-table-content>.ant-table-footer {
+    padding: 0 !important;
+    top: -47px;
+    position: relative;
+    z-index: 0;
+}
+/deep/.ant-table-footer{
+    padding: 0 !important;
+    top: -8px;
+    position: relative;
+    z-index: 2;
+}
 </style>

+ 4 - 1
src/views/stock/modules/DepositoryForm copy.vue

@@ -299,7 +299,10 @@ export default {
                     }
                     this.model.stockDetailList = this.dataSource
                     this.model.stockDetailList.forEach(element => {
-                        element.supplierInGoodsId = element.supplierInGoodsId;
+                        // element.supplierInGoodsId = element.supplierInGoodsId;
+                        if (!element.supplierInGoodsId) {
+                            element.supplierInGoodsId = element.id;
+                        }
                         element.price = element.costPrice;
                         element.num = Number(element.num);
                     });

+ 1 - 1
src/views/stock/stockChecks/selectGoodsModal/SelectGoods.vue

@@ -126,7 +126,7 @@ export default {
           dataIndex: "goodsSpec",
         },
         {
-          title: "库存数量",
+          title: "现有库存",
           align: "center",
           dataIndex: "num",
         },

+ 67 - 37
src/views/stock/stockChecks/stockChecks.vue

@@ -6,25 +6,25 @@
             <a-row :gutter="24">
                 <a-col :span="3">
                     <a-form-item label="">
-                        <a-select v-model="queryParam.depositoryId" style="width: 100%" placeholder="入仓仓库" :allowClear="true">
+                        <a-select v-model="queryParam.depositoryId" style="width: 100%" placeholder="盘点仓库" :allowClear="true">
                             <a-select-option v-for="(item, index) in depositoryList" :key="index" :value="item.id">{{ item.name }}</a-select-option>
                         </a-select>
                     </a-form-item>
                 </a-col>
-                <a-col :span="3">
+                <!-- <a-col :span="3">
                     <a-form-item label="">
                         <a-select v-model="queryParam.supplierId" style="width: 100%" placeholder="供应商" :allowClear="true">
                             <a-select-option v-for="(item, index) in supplierList" :key="index" :value="item.id">{{ item.name }}</a-select-option>
                         </a-select>
                     </a-form-item>
-                </a-col>
-                <a-col :span="3">
+                </a-col> -->
+                <!-- <a-col :span="3">
                     <a-form-item label="">
                         <a-select v-model="queryParam.stockType" style="width: 100%" placeholder="入库类型" :allowClear="true">
                             <a-select-option v-for="(item, index) in storageTypeList" :key="index" :value="item.value">{{ item.title }}</a-select-option>
                         </a-select>
                     </a-form-item>
-                </a-col>
+                </a-col> -->
                 <a-col :span="3">
                     <a-form-item label="">
                         <a-select v-model="queryParam.status" style="width: 100%" placeholder="审核状态" :allowClear="true">
@@ -34,11 +34,11 @@
                         </a-select>
                     </a-form-item>
                 </a-col>
-                <a-col :span="3">
+                <!-- <a-col :span="3">
                     <a-form-item label="">
                         <j-input placeholder="入库内容" v-model="queryParam.stockInfo"></j-input>
                     </a-form-item>
-                </a-col>
+                </a-col> -->
                 <a-col :md="6" :sm="8">
                     <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
                         <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
@@ -74,6 +74,12 @@
             <template slot="iconslot" slot-scope="text, record, index">
                 <a-icon :type="record.icon" theme="filled" />
             </template>
+
+            <!-- 盘点状态 -->
+            <template slot="status" slot-scope="record">
+                {{record.status==0?'有差异':record.status==1?'无差异':'有差异'}}
+            </template>
+
             <template slot="htmlSlot" slot-scope="text">
                 <div v-html="text"></div>
             </template>
@@ -94,7 +100,7 @@
                 <a-divider type="vertical"  v-if="record.status==0" />
                 <a @click="examine(record)"  v-if="record.status==0" >审核</a>
                 <a-divider type="vertical"  v-if="record.status==0" />
-                <a @click="detailed(record)">明细</a>
+                <a @click="handleEdit(record,true)">查看</a>
                 <a-divider type="vertical"  v-if="record.status==0" />
                 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"  v-if="record.status==0" >
                     <a>删除</a>
@@ -201,6 +207,7 @@ export default {
         return {
             activeKey: "1",
             queryParam: {},
+            loading: false,
             //明细弹窗
             detailedVisible: false,
             // 明细数据
@@ -251,67 +258,90 @@ export default {
             ],
             // 表头
             columns: [{
-                    title: "单号",
+                    title: "盘点单号",
                     align: "center",
                     dataIndex: "code",
                 },
+                // {
+                //     title: "申请日期",
+                //     align: "center",
+                //     dataIndex: "createTime",
+                // },
                 {
-                    title: "申请日期",
-                    align: "center",
-                    dataIndex: "createTime",
-                },
-                {
-                    title: "入库仓库",
+                    title: "仓库",
                     align: "center",
                     dataIndex: "depositoryName",
                 },
                 {
-                    title: "入库类型",
+                    title: "状态",
                     align: "center",
-                    dataIndex: "stockTypeName",
+                    dataIndex: "status",
+                    customRender(text) {
+                        var msg = "待审核";
+                        if (text == 1) {
+                            msg = "审核通过";
+                        } else if (text == 2) {
+                            msg = "审核未通过";
+                        }
+                        return msg;
+                    },
                 },
                 {
-                    title: "供应商",
+                    title: "盘点状态",
                     align: "center",
-                    dataIndex: "supplierName",
+                    scopedSlots: {
+                        customRender: "status"
+                    },
+                    // dataIndex: "status",
+                    
+                    // customRender(text) {
+                    //     var msg = "有差异";
+                    //     if (text == 1) {
+                    //         msg = "无差异";
+                    //     } else if (text == 2) {
+                    //         msg = "有差异";
+                    //     }
+                    //     return msg;
+                    // },
                 },
                 {
-                    title: "入库内容",
+                    title: "审批人",
                     align: "center",
-                    dataIndex: "stockInfo",
+                    dataIndex: "verifyAt",
                 },
                 {
-                    title: "制单人",
+                    title: "审批时间",
                     align: "center",
-                    dataIndex: "createAt",
+                    dataIndex: "verifyTime",
                 },
                 {
-                    title: "状态",
+                    title: "备注",
                     align: "center",
-                    dataIndex: "status",
-                    customRender(text) {
-                        var msg = "待审核";
-                        if (text == 1) {
-                            msg = "审核通过";
-                        } else if (text == 2) {
-                            msg = "审核未通过";
-                        }
-                        return msg;
-                    },
+                    dataIndex: "remarks",
                 },
+                // {
+                //     title: "入库类型",
+                //     align: "center",
+                //     dataIndex: "stockTypeName",
+                // },
+                // {
+                //     title: "供应商",
+                //     align: "center",
+                //     dataIndex: "supplierName",
+                // },
                 {
                     title: "操作",
                     dataIndex: "action",
                     align: "center",
-                    fixed: "right",
-                    width: 147,
+                    // fixed: "right",
+                    // width: 147,
                     scopedSlots: {
                         customRender: "action"
                     },
                 },
             ],
             url: {
-                list: "/kc/kcStock/list?type=2",
+                list: "/kc/kcStock/list?type=3",
                 delete: "/kc/kcStock/delete",
                 deleteBatch: "/kc/kcStock/deleteBatch",
                 exportXlsUrl: "/kc/kcStock/exportXls",

+ 82 - 52
src/views/stock/stockChecks/stockChecksForm.vue

@@ -1,33 +1,41 @@
 <template>
 <a-spin :spinning="confirmLoading">
     <j-form-container :disabled="formDisabled">
-        <a-form-model ref="form" :model="model" layout="horizontal" :rules="validatorRules" slot="detail">
-            <a-row :gutter="2" align="top" type="flex">
-                <a-col :span="5" flex>
-                    <a-form-item label="" prop="depositoryList">
-                        <a-select v-model="model.depositoryId" style="width: 100%" placeholder="盘点仓库" :allowClear="true">
-                            <a-select-option v-for="(item, index) in depositoryList" :key="index" :value="item.id">{{ item.name }}</a-select-option>
-                        </a-select>
-                    </a-form-item>
-                </a-col>
-                <!-- <a-col :span="5">
+        <a-form-model ref="form" :model="model" layout="inline" :rules="validatorRules" slot="detail">
+            <!-- <a-row :gutter="2" align="top" type="flex"> -->
+            <!-- <a-col :span="5" flex> -->
+            <a-form-item label="盘点仓库" prop="depositoryList">
+                <a-select :disabled="flag" v-model="model.depositoryId" style="width: 200px" placeholder="盘点仓库" :allowClear="true">
+                    <a-select-option v-for="(item, index) in depositoryList" :key="index" :value="item.id">{{ item.name }}</a-select-option>
+                </a-select>
+            </a-form-item>
+            <!-- </a-col> -->
+            <!-- <a-col :span="5" flex> -->
+            <a-form-item label="盘点单号" prop="depositoryList">
+                <a-input disabled v-model="model.code"></a-input>
+            </a-form-item>
+            <a-form-item label="" prop="depositoryList">
+                <a-button :disabled="!model.depositoryId" @click="handleGoods" type="primary" icon="plus">添加商品</a-button>
+            </a-form-item>
+            <!-- </a-col> -->
+            <!-- <a-col :span="5">
                     <a-form-item label="" prop="supplierList">
                         <a-select v-model="model.supplierId" style="width: 100%" placeholder="供应商" :allowClear="true">
                             <a-select-option v-for="(item, index) in supplierList" :key="index" :value="item.id">{{ item.name }}</a-select-option>
                         </a-select>
                     </a-form-item>
                 </a-col> -->
-                <!-- <a-col :span="5">
+            <!-- <a-col :span="5">
                     <a-form-item label="" prop="storageTypeList">
                         <a-select v-model="model.stockType" style="width: 100%" placeholder="入库类型" :allowClear="true">
                             <a-select-option v-for="(item, index) in storageTypeList" :key="index" :value="item.value">{{ item.title }}</a-select-option>
                         </a-select>
                     </a-form-item>
                 </a-col> -->
-                <a-col :span="6" style="margin-top:5px;">
-                    <a-button :disabled="!model.depositoryId" @click="handleGoods" type="primary" icon="plus">批量添加</a-button>
-                </a-col>
-            </a-row>
+            <!-- <a-col :span="6"> -->
+
+            <!-- </a-col> -->
+            <!-- </a-row> -->
         </a-form-model>
     </j-form-container>
 
@@ -38,11 +46,11 @@
                 {{ record ? "启用" : "停用" }}
                 <!-- {{record}} -->
             </span>
-            <template slot="price" slot-scope="record">
+            <!-- <template slot="price" slot-scope="record">
                 <a-input-number :min="0" :placeholder="record.costPrice" v-model="record.costPrice"></a-input-number>
-            </template>
+            </template> -->
             <template slot="num" slot-scope="record">
-                <a-input-number :min="0" v-model="record.num"></a-input-number>
+                <a-input-number :disabled="flag" :min="0" :max="record.stockNum" v-model="record.num"></a-input-number>
             </template>
             <span slot="action" slot-scope="text, record">
                 <!-- <a @click="handleEdit(record)">修改</a>
@@ -50,7 +58,7 @@
                 <a @click="moreSet(record)">更多设置</a>
                 <a-divider type="vertical" /> -->
                 <a-popconfirm title="确定删除吗?" @confirm="() => deleteGoods(record.id)">
-                    <a>删除</a>
+                    <a :disabled="flag">删除</a>
                 </a-popconfirm>
             </span>
         </a-table>
@@ -59,7 +67,7 @@
     <a-row>
         <a-col :span="12">
             <a-form-item label="备注" :label-col="labelCol">
-                <a-textarea v-model="model.remarks" :rows="4" />
+                <a-textarea :disabled="flag" v-model="model.remarks" :rows="4" />
             </a-form-item>
         </a-col>
     </a-row>
@@ -71,7 +79,8 @@
 <script>
 import {
     httpAction,
-    getAction
+    getAction,
+    postAction
 } from "@/api/manage";
 import {
     validateDuplicateValue
@@ -94,10 +103,10 @@ export default {
             required: false,
         },
     },
-    watch:{
-        "model.supplierId":function(newVal, oldVal){
-            if (newVal!=oldVal) {
-                this.dataSource = [];             
+    watch: {
+        "model.supplierId": function (newVal, oldVal) {
+            if (newVal != oldVal) {
+                this.dataSource = [];
             }
         }
     },
@@ -114,15 +123,15 @@ export default {
                 status: 0,
                 num: 0,
                 // stockInfo: "",
-                // stockType: 0,
+                stockType: 0,
                 // supplierId: "",
                 tenantId: "",
                 type: 3,
                 verifyAt: "",
                 verifyRemarks: "",
-                verifyTime: ""
-
+                verifyTime: "",
             },
+            flag: false,
             labelCol: {
                 xs: {
                     span: 24,
@@ -156,6 +165,11 @@ export default {
             },
             // 表头
             columns: [{
+                    title: "商品条码",
+                    align: "center",
+                    dataIndex: "code",
+                },
+                {
                     title: "商品名称",
                     align: "center",
                     dataIndex: "name",
@@ -171,17 +185,17 @@ export default {
                     dataIndex: "spec",
                 },
                 {
-                    title: "成本价",
+                    title: "库存数量",
                     align: "center",
-                    // dataIndex: "costPrice",
+                    dataIndex: "stockNum",
                     scopedSlots: {
-                        customRender: "price"
+                        customRender: "stockNum"
                     },
                 },
                 {
-                    title: "出入库数量",
+                    title: "实际库存",
                     align: "center",
-                    // dataIndex: "spec",
+                    // dataIndex: "num",
                     scopedSlots: {
                         customRender: "num"
                     },
@@ -194,8 +208,6 @@ export default {
                         customRender: "action"
                     },
                     align: 'center',
-                    fixed: "right",
-                    width: 200,
                 }
             ],
             url: {
@@ -261,27 +273,31 @@ export default {
             console.log(this.dataSource);
         },
         add() {
-            this.edit(this.modelDefault,1);
+            this.edit(this.modelDefault, 1);
         },
-        edit(record, type) {
-          if (type) {
-            return
-          }
+        edit(record, type=false) {
+            console.log(type);
+            if (typeof type == 'boolean') {
+                this.flag = type
+            }
+            if (type===1) {
+                return
+            }
             this.model = Object.assign({}, record);
             this.model.stockType = this.model.stockType.toString()
             console.log(this.model);
-            getAction(`/kc/kcStockDetail/list?stockId=${this.model.code}`).then(res=>{
-              console.log(res);
-              if ( res.code==200 ) {
-                this.dataSource = res.result.records
-                this.dataSource.forEach(ele=>{
-                  ele.costPrice = ele.price
-                })
-              }
+            getAction(`/kc/kcStockDetail/list?stockId=${this.model.code}`).then(res => {
+                console.log(res);
+                if (res.code == 200) {
+                    this.dataSource = res.result.records
+                    this.dataSource.forEach(ele => {
+                        ele.costPrice = ele.price
+                    })
+                }
             })
             this.visible = true;
         },
-        submitForm() {
+        submitForm(flag) {
             const that = this;
             // 触发表单验证
 
@@ -299,15 +315,29 @@ export default {
                     }
                     this.model.stockDetailList = this.dataSource
                     this.model.stockDetailList.forEach(element => {
-                        element.supplierInGoodsId = element.supplierInGoodsId;
-                        element.price = element.costPrice;
+                        if (!element.supplierInGoodsId) {
+                            element.supplierInGoodsId = element.id;
+                        }
+                        // element.supplierInGoodsId = element.supplierInGoodsId;
+                        element.price = 0;
                         element.num = Number(element.num);
                     });
                     httpAction(httpurl, this.model, method)
                         .then((res) => {
                             if (res.success) {
-                                that.$message.success(res.message);
                                 that.$emit("ok");
+                                that.$message.success(res.message);
+                                if (flag) {
+                                    // this.model.status = 1
+                                    // postAction("/kc/kcStock/audit", this.model).then((res) => {
+                                    //     if (res.success) {
+                                    //         // this.loadData();
+                                    //         that.$emit("ok");
+                                    //         this.$message.success("审核成功");
+                                    //         // this.examineVisible = false;
+                                    //     }
+                                    // });
+                                }
                             } else {
                                 that.$message.warning(res.message);
                             }

+ 16 - 3
src/views/stock/stockChecks/stockChecksModal.vue

@@ -8,6 +8,14 @@
     :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
     @cancel="handleCancel"
     cancelText="关闭">
+    <template slot="footer">
+        <a-button key="back" @click="handleCancel">
+          关闭
+        </a-button>
+        <a-button v-if="!flag" key="submit" type="primary" @click="handleOk">
+          确认
+        </a-button>
+      </template>
     <pos-type-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></pos-type-form>
   </j-modal>
 </template>
@@ -25,7 +33,8 @@
         title:'',
         width:800,
         visible: false,
-        disableSubmit: false
+        disableSubmit: false,
+        flag:true
       }
     },
     methods: {
@@ -35,10 +44,11 @@
           this.$refs.realForm.add();
         })
       },
-      edit (record) {
+      edit (record, flag) {
         this.visible=true
+        this.flag = flag
         this.$nextTick(()=>{
-          this.$refs.realForm.edit(record);
+          this.$refs.realForm.edit(record, flag);
         })
       },
       close () {
@@ -48,6 +58,9 @@
       handleOk () {
         this.$refs.realForm.submitForm();
       },
+      // handleYes(){
+      //   this.$refs.realForm.submitForm(true);
+      // },
       submitCallback(){
         this.$emit('ok');
         this.visible = false;