Przeglądaj źródła

入库 修改1-6的功能

Qukatie 1 tydzień temu
rodzic
commit
292f7133e6

+ 51 - 34
src/views/storehouse/configuration/commodity.json

@@ -43,16 +43,24 @@
     },
     {
       "label": "单价",
-      "prop":"price",
+      "prop": "price",
       "overHidden": true,
       "slot": true,
       "width": 120,
       "cell": true,
-      "rules": [{
-        "required": true,
-        "message": " ",
-        "trigger": "blur"
-      }]
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "批次号",
+      "prop": "dot",
+      "cell": true,
+      "overHidden": true
     },
     {
       "label": "库存",
@@ -96,50 +104,59 @@
     {
       "label": "是否静音棉",
       "prop": "originalFactory",
-      "type":"select",
-      "search":true,
+      "type": "select",
+      "search": true,
       "hide": false,
       "showColumn": true,
       "width": 120,
-      "dicData":[{
-        "label":"否",
-        "value":"0"
-      },{
-        "label":"是",
-        "value":"1"
-      }]
+      "dicData": [
+        {
+          "label": "否",
+          "value": "0"
+        },
+        {
+          "label": "是",
+          "value": "1"
+        }
+      ]
     },
     {
       "label": "是否防爆",
       "prop": "explosionProof",
-      "type":"select",
-      "search":true,
+      "type": "select",
+      "search": true,
       "hide": false,
       "showColumn": true,
       "width": 120,
-      "dicData":[{
-        "label":"否",
-        "value":0
-      },{
-        "label":"是",
-        "value":1
-      }]
+      "dicData": [
+        {
+          "label": "否",
+          "value": 0
+        },
+        {
+          "label": "是",
+          "value": 1
+        }
+      ]
     },
     {
       "label": "是否自修补",
       "prop": "selfRecovery",
-      "type":"select",
-      "search":true,
+      "type": "select",
+      "search": true,
       "hide": false,
       "showColumn": true,
       "width": 120,
-      "dicData":[{
-        "label":"否",
-        "value":"0"
-      },{
-        "label":"是",
-        "value":"1"
-      }]
+      "dicData": [
+        {
+          "label": "否",
+          "value": "0"
+        },
+        {
+          "label": "是",
+          "value": "1"
+        }
+      ]
     },
     {
       "label": "备注",
@@ -147,4 +164,4 @@
       "slot": true
     }
   ]
-}
+}

+ 301 - 356
src/views/storehouse/inStockManage/inStockPlan/detailsPage.vue

@@ -45,14 +45,28 @@
                             :remote="true" dataName="cname" @selectChange="dicChange('customerName', $event)"
                             :disabled="editButton || form.status == 2"></dic-select>
                     </tempalte>
+                    <tempalte slot="storageName">
+                        <dic-select v-model="form.storageName" placeholder="货主" key="id" label="cname" res="records"
+                            url="/blade-sales-part/tire/center/warehouse/storage/list?current=1&size=5"
+                            :filterable="true" :remote="true" dataName="cname"
+                            @selectChange="dicChange('storageName', $event)"
+                            :disabled="editButton || form.status == 2"></dic-select>
+                    </tempalte>
+                    <tempalte slot="warehouseKeeperName">
+                        <dic-select v-model="form.warehouseKeeperName" placeholder="库管" key="id" label="realName"
+                            res="records" url="/blade-user/page?current=1&size=5&userType=2" :filterable="true"
+                            :remote="true" dataName="realName" @selectChange="dicChange('warehouseKeeperName', $event)"
+                            :disabled="editButton || form.status == 2"></dic-select>
+                    </tempalte>
                 </avue-form>
             </trade-card>
             <trade-card title="明细信息">
                 <el-tabs v-model="activeName" type="card">
                     <el-tab-pane label="商品明细" name="sale_detail">
-                        <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
-                            :data="form.planItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
-                            @row-close="rowClose" :before-close="beforeClose" @selection-change="selectionContacts"
+                        <avue-crud :option="optionContacts" ref="formContacts"
+                            :data="form.planItemsList.filter(item => item.isDeleted != 1)" :key="key"
+                            @row-save="rowSave" @row-update="rowUpdate" @row-close="rowClose"
+                            :before-close="beforeClose" @selection-change="selectionContacts"
                             @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
                             @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)">
                             <template slot-scope="{scope,row}" slot="menuLeft">
@@ -64,76 +78,99 @@
                                 </el-button>
                                 <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印
                                 </el-button>
-                                <el-button type="danger" plain size="small" @click="batchDelete"
+                                <!-- <el-button type="danger" plain size="small" @click="batchDelete"
                                     :disabled="editButton || form.status == 2 || selectionMultilist.length == 0">
                                     一键删除
-                                </el-button>
+                                </el-button> -->
                             </template>
                             <template slot="goodsId" slot-scope="{ row }">
-                                <!--<el-select v-if="row.$cellEdit" v-model="row.goodsId" allow-create filterable default-first-option >-->
-                                <!--    <el-option v-for="(item, index) in goodsIdoptions" :key="index" :label="item.cname"-->
-                                <!--        :value="item.id"></el-option>-->
-                                <!--</el-select>-->
                                 <span>{{ row.goodsName }}</span>
                             </template>
                             <template slot="goodsNum" slot-scope="{ row }">
-                                <el-input-number v-if="!mingxibaocun" size="small" v-model="row.goodsNum"
+                                <el-input-number v-if="row.$cellEdit" size="small" v-model="row.goodsNum"
                                     :controls="false" :precision="numberDecimal" style="width: 100%"></el-input-number>
                                 <span v-else>{{ row.goodsNum }}</span>
                             </template>
                             <template slot="price" slot-scope="{ row }">
-                                <el-input v-if="!mingxibaocun" size="small" v-model="row.price"
+                                <el-input v-if="row.$cellEdit" size="small" v-model="row.price"
                                     style="width: 100%"></el-input>
                                 <span v-else>{{ row.price }}</span>
                             </template>
+                            <template slot="dot" slot-scope="{row}">
+                                <el-input v-if="row.$cellEdit" v-model="row.dot" size="small" style="width: 100%" />
+                                <span v-else>{{ row.price }}</span>
+                            </template>
                             <template slot="rebatePrice" slot-scope="{ row }">
-                                <el-input v-if="!mingxibaocun" size="small" v-model="row.rebatePrice"
+                                <el-input v-if="row.$cellEdit" size="small" v-model="row.rebatePrice"
                                     style="width: 100%"></el-input>
                                 <span v-else>{{ row.rebatePrice }}</span>
                             </template>
-                            <template slot="dot" slot-scope="{ row }">
-                                <el-select v-if="!mingxibaocun && row.whether == '1'" v-model="row.dot" allow-create
-                                    filterable default-first-option @focus="picihaolistfun(row.goodsId)">
-                                    <el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
-                                        :value="item.dot"></el-option>
-                                </el-select>
-                                <span v-else>{{ row.dot }}</span>
-                            </template>
-
                             <template slot="subTotalMoney" slot-scope="{ row }">
                                 {{ (row.goodsNum * row.price).toFixed(2) }}
                             </template>
-
                             <template slot="remarks" slot-scope="{ row }">
-                                <el-input v-if="!mingxibaocun" size="small" v-model="row.remarks"
+                                <el-input v-if="row.$cellEdit" size="small" v-model="row.remarks"
                                     style="width: 100%"></el-input>
                                 <span v-else>{{ row.remarks }}</span>
                             </template>
                             <template slot-scope="{type,size,row,index,disabled}" slot="menu">
-                                <el-button v-if="mingxibaocun" :size="size" :disabled="editButton || form.status == 2"
+                                <el-button :size="size" :disabled="editButton || form.status == 2"
                                     :type="type" :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
-                                    @click="hangeditBtn(row, index)">编辑
-                                </el-button>
-                                <el-button v-else :size="size" :disabled="editButton || form.status == 2" :type="type"
-                                    :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
-                                    @click="hangbaocun(row, index)">保存
+                                    @click="rowEdit(row, index)">{{ row.$cellEdit ? '保存' : '编辑' }}
                                 </el-button>
                                 <el-button icon="el-icon-delete" :size="size" :disabled="editButton || form.status == 2"
-                                    :type="type" @click="rowDelBox(row, index, 'planItemsList')">删除
+                                    :type="type" @click="rowDel(row, index)">删除
                                 </el-button>
                             </template>
                         </avue-crud>
                     </el-tab-pane>
-                    <el-tab-pane label="入库记录" name="outbound_records">
-                        <avue-crud :option="optionOutboundRecords" v-model="formContacts" ref="outbound_records"
-                            :data="form.outboundRecordsList" @row-save="rowSave" @row-update="rowUpdate"
+                    <el-tab-pane label="费用明细" name="outbound_records">
+                        <avue-crud :option="optionOutboundRecords" ref="outbound_records"
+                            :data="form.centerShipCostList.filter(item => item.isDeleted != 1)" @row-save="rowSave" @row-update="rowUpdate"
                             @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)"
                             @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)">
+                            <template slot="indexHeader" slot-scope="{row,index}">
+                                <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editButton" circle
+                                    @click="addRow()">
+                                </el-button>
+                            </template>
+                            <template slot="index" slot-scope="{row,index}">
+                                <span>{{ index + 1 }}</span>
+                            </template>
+                            <template slot="costName" slot-scope="{ row }">
+                                <dic-select v-if="row.$cellEdit" v-model="row.costName" placeholder="费用名称" key="id"
+                                    res="records" label="cname"
+                                    url="/blade-sales-part/storageDesc/list?current=1&size=5" :filterable="true"
+                                    :remote="true" dataName="cname"
+                                    @selectChange="rowDicChange('costName', $event, row)"></dic-select>
+                                <span v-else>{{ row.costName }}</span>
+                            </template>
+                            <tempalte slot="costPrice" slot-scope="{ row }">
+                                <el-input-number v-if="row.$cellEdit" v-model="row.costPrice" @change="countChange(row)"
+                                    :controls="false" placeholder="请输入 单价" size="small"
+                                    style="width: 100%;"></el-input-number>
+                                <span v-else>{{ row.costPrice }}</span>
+                            </tempalte>
+                            <tempalte slot="goodsNum" slot-scope="{ row }">
+                                <el-input-number v-if="row.$cellEdit" v-model="row.goodsNum" @change="countChange(row)"
+                                    :controls="false" placeholder="请输入 数量" size="small"
+                                    style="width: 100%;"></el-input-number>
+                                <span v-else>{{ row.goodsNum }}</span>
+                            </tempalte>
+                            <template slot-scope="{type,size,row,index,disabled}" slot="menu">
+                                <el-button  :size="size" :disabled="editButton || form.status == 2"
+                                    :type="type" :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
+                                    @click="rowEdit(row, index)">{{ row.$cellEdit ? '保存' : '编辑' }}
+                                </el-button>
+                                <el-button icon="el-icon-delete" :size="size" :disabled="editButton || form.status == 2"
+                                    :type="type" @click="rowDel2(row, index)">删除
+                                </el-button>
+                            </template>
                         </avue-crud>
                     </el-tab-pane>
                 </el-tabs>
             </trade-card>
-            <report-dialog :switchDialog="switchDialog" reportName="轮胎商城-采购订单" :reportId="form.id"
+            <report-dialog :switchDialog="switchDialog" reportName="仓库管理-中心仓入库单" :reportId="form.id"
                 @onClose="onClose()"></report-dialog>
         </div>
         <el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px"
@@ -182,7 +219,9 @@
                             <template slot="price" slot-scope="{row}">
                                 <el-input-number v-model="row.price" size="small" :controls="false"
                                     style="width: 100%" />
-                                <!--<span v-else>{{ row.price }}</span>-->
+                            </template>
+                            <template slot="dot" slot-scope="{row}">
+                                <el-input v-model="row.dot" size="small" style="width: 100%" />
                             </template>
                             <template slot-scope="scope" slot="menu">
                                 <el-button type="text" icon="el-icon-edit" size="small"
@@ -234,7 +273,7 @@ import { isProcurement } from "@/api/basicData/configuration";
 import commodity from "../../configuration/commodity.json";
 import { getDetails, submit, itemRemove, auditPlan } from "@/api/storehouse/plan.js";
 import dicSelect from "@/components/dicSelect/main";
-
+import _ from "lodash";
 export default {
     name: "detailsPage",
     data() {
@@ -337,7 +376,7 @@ export default {
             templateUrl: '/api/blade-sales-part/ship/export-item', // 模板url
             form: {
                 planItemsList: [],
-                outboundRecordsList: [],
+                centerShipCostList: [],
                 bsType: 'RP',
                 status: 0,
             },
@@ -404,14 +443,7 @@ export default {
                     disabled: true,
                 }, {
                     label: '仓库',
-                    prop: "storageId",
-                    type: 'select',
-                    disabled: false,
-                    props: {
-                        label: 'cname',
-                        value: 'id'
-                    },
-                    dicUrl: '/api/blade-sales-part/tire/center/warehouse/storage/storageSelectedList',
+                    prop: "storageName",
                     rules: [{
                         required: true,
                         message: " ",
@@ -458,14 +490,15 @@ export default {
                     prop: "licensePlate"
                 },
                 {
-                    label: '人员选择',
-                    prop: "warehouseKeeper"
+                    label: '库管',
+                    prop: "warehouseKeeperName"
                 },
                 {
                     label: '车辆照片',
                     prop: "vehiclePhoto",
                     listType: "picture-card",
                     type: "upload",
+                    limit: 4,
                     span: 24,
                     propsHttp: {
                         url: 'link',
@@ -502,7 +535,7 @@ export default {
                 // 保存按钮
                 editBtn: false,
                 // 航编辑开启
-                cellBtn: true,
+                // cellBtn: true,
                 rowKey: 'ids',
                 delBtn: false,
                 menuWidth: 140,
@@ -533,153 +566,109 @@ export default {
                     name: "returnsAmount",
                     type: "sum"
                 }],
-                column: [{
-                    label: '商品名称',
-                    prop: 'goodsId',
-                    width: 200,
-                    disabled: false,
-                    remote: true,
-                    hide: true,
-                    overHidden: true,
-                    type: 'select',
-                    // dicData: [],
-                    props: {
-                        label: 'cname',
-                        value: 'id'
+                column: [
+                    {
+                        label: '商品名称',
+                        prop: 'goodsName',
+                        width: 200,
+                        disabled: false,
+                        remote: true,
+                        overHidden: true,
+                    }, {
+                        label: '数量',
+                        prop: 'goodsNum',
+                        overHidden: true,
+                        disabled: false,
+                        cell: true,
+                        width: 100,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
                     },
-                    // dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}'
-                    dicUrl: "/api/blade-sales-part/goodsDesc/list?current=1&size=10&cname={{key}}&enableOrNot=1"
-                    // dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}"
-                }, {
-                    label: '商品名称',
-                    prop: 'goodsName',
-                    width: 200,
-                    disabled: false,
-                    remote: true,
-                    overHidden: true,
-                }, {
-                    label: '数量',
-                    prop: 'goodsNum',
-                    overHidden: true,
-                    disabled: false,
-                    cell: true,
-                    width: 100,
-                    rules: [{
-                        required: true,
-                        message: " ",
-                        trigger: "blur"
+                    {
+                        label: '价格',
+                        prop: 'price',
+                        overHidden: true,
+                        width: 100,
+                        disabled: false,
+                        cell: true,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: '批次号',
+                        prop: 'dot',
+                        cell: true,
+                        width: 100,
+                        overHidden: true,
                     }, {
-                        validator: (rule, value, callback) => {
-                            console.log(this.formContacts.inventory);
-                            if (value < 0) {
-                                callback(new Error("数量不能小于0"));
-                            } else {
-                                callback();
-                            }
-                        },
-                        trigger: "blur"
-                    }]
-                },
-                {
-                    label: '价格',
-                    prop: 'price',
-                    overHidden: true,
-                    width: 100,
-                    disabled: false,
-                    cell: true,
-                    rules: [{
-                        required: true,
-                        message: " ",
-                        trigger: "blur"
+                        label: '小计',
+                        prop: 'subTotalMoney',
+                        overHidden: true,
+                        width: 100,
+                        disabled: true,
+                        editDisplay: false,
+                        addDisplay: false
                     }, {
-                        validator: (rule, value, callback) => {
-                            if (value < 0) {
-                                callback(new Error("价格不能小于0"));
-                            } else {
-                                callback();
-                            }
-                        },
-                        trigger: "blur"
-                    }]
-                },
-                {
-                    label: '批次号',
-                    prop: 'dot',
-                    cell: true,
-                    width: 120,
-                    type: "select",
-                    disabled: true,
-                    allowCreate: true,
-                    filterable: true,
-                    dicData: [],
-                    props: {
-                        label: "dot",
-                        value: "dot"
+                        label: '商品编码',
+                        prop: 'goodsNo',
+                        overHidden: true,
+                        disabled: false,
+                        width: 100
                     },
-                    dicUrl: "/api/blade-sales-part/stockDesc/dotList",
-                    overHidden: true,
-                }, {
-                    label: '小计',
-                    prop: 'subTotalMoney',
-                    overHidden: true,
-                    width: 100,
-                    disabled: true,
-                    editDisplay: false,
-                    addDisplay: false
-                }, {
-                    label: '商品编码',
-                    prop: 'goodsNo',
-                    overHidden: true,
-                    disabled: false,
-                    width: 100
-                },
-                {
-                    label: '品牌',
-                    prop: 'brandName',
-                    disabled: false,
-                    width: 100,
-                    overHidden: true,
-                },
-                {
-                    label: '规格型号',
-                    prop: 'propertyName',
-                    overHidden: true,
-                    disabled: false,
-                    width: 100
-                }, {
-                    label: '花纹',
-                    prop: 'pattern',
-                    overHidden: true,
-                    disabled: false,
-                    width: 100
-                }, {
-                    label: '商品描述',
-                    prop: 'goodsDescription',
-                    disabled: false,
-                    overHidden: true,
-                    width: 100
-                },
-                {
-                    label: '单位',
-                    prop: 'units',
-                    type: "select",
-                    disabled: false,
-                    props: {
-                        label: "dictValue",
-                        value: "dictValue"
+                    {
+                        label: '品牌',
+                        prop: 'brandName',
+                        disabled: false,
+                        width: 100,
+                        overHidden: true,
                     },
-                    dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
-                    overHidden: true,
-                    width: 100
-                },
-                {
-                    label: '备注',
-                    prop: "remarks",
-                    overHidden: true,
-                    width: 100,
-                    disabled: false,
+                    {
+                        label: '规格型号',
+                        prop: 'propertyName',
+                        overHidden: true,
+                        disabled: false,
+                        width: 100
+                    }, {
+                        label: '花纹',
+                        prop: 'pattern',
+                        overHidden: true,
+                        disabled: false,
+                        width: 100
+                    }, {
+                        label: '商品描述',
+                        prop: 'goodsDescription',
+                        disabled: false,
+                        overHidden: true,
+                        width: 100
+                    },
+                    {
+                        label: '单位',
+                        prop: 'units',
+                        overHidden: true,
+                        // type: "select",
+                        // disabled: false,
+                        // props: {
+                        //     label: "dictValue",
+                        //     value: "dictValue"
+                        // },
+                        // dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
+                        // overHidden: true,
+                        // width: 100
+                    },
+                    {
+                        label: '备注',
+                        prop: "remarks",
+                        overHidden: true,
+                        width: 100,
+                        disabled: false,
 
-                }
+                    }
                 ]
             },
             selectionMultilist: [], // 多选数据
@@ -716,45 +705,52 @@ export default {
             },
             optionOutboundRecords: {},
             optionOutboundRecordsBack: {
+                height: 'auto',
+                calcHeight: 30,
+                menuWidth: 120,
                 align: 'center',
-                index: true,
-                menu: false,
-                addBtnText: "录入明细",
+                border: true,
+                menu: true,
                 refreshBtn: false,
-                dialogDrag: true,
                 addBtn: false,
                 span: 8,
-                height: 600,
                 addRowBtn: false,
                 editBtn: false,
                 delBtn: false,
-                // menuWidth: 140,
-                dialogTop: 25,
-                dialogWidth: "80%",
-                column: [{
-                    label: '入库单号',
-                    prop: 'billno'
-                },
-                // {
-                //     label: '来源单号',
-                //     prop: 'ordNo'
-                // },
-                {
-                    label: '数量',
-                    prop: 'goodsTotalNum'
-                }, {
-                    label: '实际数量',
-                    prop: 'sendTotalNum'
-                }, {
-                    label: '业务类型',
-                    prop: 'bizTypeName'
-                }, {
-                    label: '状态',
-                    prop: 'statusName'
-                }, {
-                    label: '业务时间',
-                    prop: 'createTime'
-                }]
+                column: [
+                    {
+                        label: "index",
+                        prop: "index",
+                        width: "55",
+                        headerslot: true,
+                    },
+                    {
+                        label: '费用名称',
+                        prop: 'costName',
+                        headerslot: true,
+                    },
+                    {
+                        label: '单价',
+                        prop: 'costPrice',
+                        headerslot: true,
+                    },
+                    {
+                        label: '数量',
+                        prop: 'goodsNum',
+                        headerslot: true,
+                    },
+                    {
+                        label: '金额',
+                        prop: 'costAmount',
+                        headerslot: true,
+                    },
+                    {
+                        label: '备注',
+                        prop: 'remark',
+                        cell: true,
+                        headerslot: true,
+                    }
+                ]
             }
         }
     },
@@ -764,57 +760,6 @@ export default {
         detailData: Object
     },
     async created() {
-        this.findObject(this.optionContactsBack.column, "goodsId").click = ({ value, column }) => {
-            this.$refs.formContacts.dicInit()
-        }
-        this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
-            if (this.formContacts.goodsId !== value) {
-                goodsDetail({
-                    id: value,
-                    customId: this.dicUrlWithCustomId,
-                    stock: this.form.storageId ? this.form.storageId : ''
-                }).then(res => {
-                    this.goods = res.data.data
-                    this.formContacts.goodsNo = res.data.data.code
-                    this.formContacts.brandId = res.data.data.brandId
-                    this.formContacts.inventory = res.data.data.inventory
-                    // this.formContacts.brandId = res.data.data.brandName
-                    // this.formContacts.brandName = res.data.data.brandId
-
-                    this.formContacts.propertyName = res.data.data.specificationAndModel
-                    this.formContacts.pattern = res.data.data.brandItem
-                    this.formContacts.goodsDescription = res.data.data.goodsDescription
-                    this.formContacts.units = res.data.data.unit
-                    this.formContacts.price = res.data.data.price
-                    //
-                    this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId
-                    console.log(res.data.data.sharedCompanyId);
-                    console.log(res.data.data.sharedCompanyName);
-                    this.form.sharedCompanyId = res.data.data.sharedCompanyId
-                    this.form.sharedCompanyName = res.data.data.sharedCompanyName
-                    this.sharedCompanyId = res.data.data.sharedCompanyId
-                    console.log(res.data.data.sharedCompanyId);
-                    console.log(this.form.planItemsList);
-                    for (let i = 0; i < this.form.planItemsList.length; i++) {
-                        console.log(Number(this.form.planItemsList[i].sharedCompanyId));
-                        if (Number(this.form.planItemsList[i].sharedCompanyId) != Number(res.data.data.sharedCompanyId)) {
-                            this.isStatus = 0
-                        }
-                    }
-                    if (res.data.data.whether == 0) {
-                        this.findObject(this.optionContactsBack.column, "dot").disabled = true
-                    } else {
-                        this.findObject(this.optionContactsBack.column, "dot").disabled = false
-                        dotList({
-                            storageId: this.form.storageId,
-                            goodsId: this.formContacts.goodsId
-                        }).then(res => {
-                            this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
-                        })
-                    }
-                })
-            }
-        }
         this.optionContacts = await this.getColumnData(this.getColumnName(269.1), this.optionContactsBack);
         this.optionOutboundRecords = await this.getColumnData(this.getColumnName(269.3), this.optionOutboundRecordsBack);
         this.key++
@@ -839,6 +784,17 @@ export default {
         })
     },
     methods: {
+        countChange(row) {
+            row.costAmount = _.multiply(Number(row.costPrice ? row.costPrice : 0), Number(row.goodsNum ? row.goodsNum : 0))
+        },
+        addRow() {
+            if (!this.form.id) {
+                return this.$message.error('请保存数据')
+            }
+            this.form.centerShipCostList.push({
+                $cellEdit: true
+            })
+        },
         inEdit() {
             if (this.form.status != 2) {
                 this.editButton = false
@@ -846,6 +802,16 @@ export default {
                 this.$set(this.optionContactsBack, 'disabled', false)
             }
         },
+        rowDicChange(name, row, el) {
+            if (name == 'costName') {
+                if (row) {
+                    el.costId = row.id
+                } else {
+                    el.costId = null
+                    el.costName = null
+                }
+            }
+        },
         dicChange(name, row) {
             if (name == 'customerName') {
                 if (row) {
@@ -853,7 +819,6 @@ export default {
                     getCustom({ id: row.id }).then(res => {
                         if (res.data.data) {
                             this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
-                            // this.form.storageId = this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
                             this.form.contacts = res.data.data.corpsAttnList[0].cname
                             this.form.phone = res.data.data.corpsAttnList[0].tel
                             this.contactsOption = res.data.data.corpsAddrList
@@ -863,44 +828,28 @@ export default {
                     this.form.customerId = null
                     this.form.customerName = null
                     this.dicUrlWithCustomId = null
-                    // this.form.storageId = null
                     this.form.contacts = null
                     this.form.phone = null
                 }
             }
-        },
-        // 一键入库
-        oneClickStorage() {
-            if (this.form.planItemsList.length == 0) {
-                this.$message.warning('请先添加采购明细')
-                return
+            if (name == 'warehouseKeeperName') {
+                if (row) {
+                    this.form.warehouseKeeper = row.id
+                    // this.form.warehouseKeeperName=row.realName
+                } else {
+                    this.form.warehouseKeeper = null
+                    this.form.warehouseKeeperName = null
+                }
             }
-            // 计算合计用于展示
-            let goodsNumhe = 0
-            let subTotalMoneyhe = 0
-            for (let item of this.form.planItemsList) {
-                goodsNumhe += Number(item.goodsNum)
-                subTotalMoneyhe += Number(item.subTotalMoney)
+            if (name == 'storageName') {
+                if (row) {
+                    this.form.storageId = row.id
+                    // this.form.warehouseKeeperName=row.realName
+                } else {
+                    this.form.storageId = null
+                    this.form.storageName = null
+                }
             }
-            this.$alert(`<div style="text-align: center"><span style="color: #d85542">一件采购入库不可撤销,请确认无误在操作</span><br><span>本次入库金额:${subTotalMoneyhe.toFixed(2)}</span><br><span>本次入库数量:${goodsNumhe}</span><br><span>是否要一件采购入库?</span></div>`, '提示', {
-                dangerouslyUseHTMLString: true,
-            }).then(() => {
-                const loading = this.$loading({
-                    lock: true,
-                    text: '加载中',
-                    spinner: 'el-icon-loading',
-                    background: 'rgba(255,255,255,0.7)'
-                });
-                shortcutWarehousing(this.form).then(res => {
-                    this.$message.success("保存成功");
-                    this.isAddBtn = true // 表格的添加商品禁用
-                    this.getDetail(res.data.data.id)
-                    loading.close();
-                }).catch(() => {
-                    loading.close();
-                })
-            })
-
         },
         // 获取左侧筛选
         getAllWorkDicts() {
@@ -1041,8 +990,6 @@ export default {
                         // inventory:item.balanceQuantity,
                         // 备注
                         remarks: item.remarks,
-                        // 判断批次号是否可以编辑
-                        whether: item.whether,
                         rebatePrice: item.rebatePrice,
                         // 批次号的状态
                         dotedittype: false,
@@ -1108,39 +1055,13 @@ export default {
             })
         },
         // 采购明细行编辑
-        hangeditBtn(row, index) {
-            for (let item of this.form.planItemsList) {
-                this.picihaolistfun(item.goodsId)
-                getDetailsLT({ id: item.goodsId }).then((res) => {
-                    this.$set(item, 'whether', res.data.data.whether)
-                })
+        rowEdit(row, index) {
+            if (row.$cellEdit) {
+                this.$set(row, '$cellEdit', false)
+            } else {
+                this.$set(row, '$cellEdit', true)
             }
-
-
-            row.dotedittype = true
-            // 价格数量
-            row.goodsNumtype = true
-            row.pricetype = true
-            // 编辑和保存状态切换
-            this.mingxibaocun = false
-        },
-        // 保存按钮
-        hangbaocun(row) {
-            row.dotedittype = false
-            row.goodsNumtype = false
-            row.pricetype = false
-            this.mingxibaocun = true
-        },
-        // 批次号获取数据
-        picihaolistfun(goodsId) {
-            dotList({
-                storageId: this.form.storageId,
-                goodsId: goodsId
-            }).then(res => {
-                this.picihaolist = res.data.data
-            })
         },
-
         // 编辑
         editBtn(row, index) {
             this.$refs.formContacts.dicInit()
@@ -1249,16 +1170,6 @@ export default {
                     for (let i in this.form.planItemsList) {
                         console.log(this.form.planItemsList[i], 1800)
                         this.form.planItemsList[i].subTotalMoney = this.form.planItemsList[i].goodsNum * this.form.planItemsList[i].price
-                        if (!this.form.planItemsList[i].pid) {
-                            if (this.form.planItemsList[i].whether == '1') {
-                                if (!this.form.planItemsList[i].dot) {
-                                    this.$message.warning(`采购明细序号${Number(i) + 1}的批次号不能为空`);
-                                    picihao = true
-                                    break;
-                                }
-
-                            }
-                        }
                         if (this.form.planItemsList[i].goodsNum <= 0) {
                             this.$message.warning(`采购明细序号${Number(i) + 1}的数量不能为零`);
                             picihao = true
@@ -1269,7 +1180,7 @@ export default {
                     }
                     let obj = {
                         ...this.form,
-                        storageName: this.form.$storageId ? this.form.$storageId : '',
+                        vehiclePhoto: JSON.stringify(this.form.vehiclePhoto),
                         status: type,
                     }
                     const loading = this.$loading({
@@ -1303,7 +1214,8 @@ export default {
                 background: 'rgba(255,255,255,0.7)'
             })
             getDetails({ id: id }).then(res => {
-                this.form = res.data.data
+                res.data.data.vehiclePhoto = JSON.parse(res.data.data.vehiclePhoto),
+                    this.form = res.data.data
                 this.dataList = res.data.data.paymentRecordsList ? res.data.data.paymentRecordsList : [];
                 this.$nextTick(() => {
                     this.$refs.formContacts.doLayout()
@@ -1318,19 +1230,39 @@ export default {
                 loading.close();
             })
         },
-        rowDelBox(row, index, type) {
+        rowDel(row, index) {
             this.$confirm("确定将选择数据删除?", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
                 type: "warning"
             }).then(() => {
                 if (row.id) {
-                    itemRemove({ ids: row.id }).then(res => {
-                        this.form.planItemsList.splice(index, 1);
-                        this.$message.success("操作成功!");
-                    });
+                    // itemRemove({ ids: row.id }).then(res => {
+                    //     this.form.planItemsList.splice(index, 1);
+                    //     this.$message.success("操作成功!");
+                    // });
+                    row.isDeleted = 1
                 } else {
-                    this.form[type].splice(index, 1);
+                    this.form.planItemsList.splice(index, 1);
+                    this.$message.success("操作成功!");
+                }
+            }
+            );
+        },
+        rowDel2(row, index) {
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                if (row.id) {
+                    // itemRemove({ ids: row.id }).then(res => {
+                    //     this.form.planItemsList.splice(index, 1);
+                    //     this.$message.success("操作成功!");
+                    // });
+                    row.isDeleted = 1
+                } else {
+                    this.form.centerShipCostList.splice(index, 1);
                     this.$message.success("操作成功!");
                 }
             }
@@ -1465,4 +1397,17 @@ export default {
 ::v-deep .el-dialog__body {
     padding: 10px 20px;
 }
+
+::v-deep .el-table .cell {
+    padding: 0 2px !important;
+
+    .el-form-item {
+        margin-bottom: 0px !important;
+    }
+
+}
+
+::v-deep .avue-crud .el-table .el-form-item__label {
+    left: -1px;
+}
 </style>