Browse Source

修改共享上架和共享销售

Qukatie 6 tháng trước cách đây
mục cha
commit
33dcf9c6a4

+ 19 - 13
src/views/tirePartsMall/basicData/shareListing/index.vue

@@ -394,21 +394,27 @@ export default {
           overHidden: true,
         },
         {
-          label: "共享公司",
-          prop: "sharedCompany",
-          // searchProp: "sharedCompanyList",
-          search: true,
+          label: "共享成本",
+          prop: "shareCost",
+          hide: false,
           overHidden: true,
-          // tags: true,
-          multiple: true,   //将可选变为多选
-          searchMultiple: false,
-          type: 'select',
-          props: {
-            label: 'fullName',
-            value: 'id'
-          },
-          dicUrl: '/api/blade-system/dept/deptList'
         },
+        // {
+        //   label: "共享公司",
+        //   prop: "sharedCompany",
+        //   // searchProp: "sharedCompanyList",
+        //   search: true,
+        //   overHidden: true,
+        //   // tags: true,
+        //   multiple: true,   //将可选变为多选
+        //   searchMultiple: false,
+        //   type: 'select',
+        //   props: {
+        //     label: 'fullName',
+        //     value: 'id'
+        //   },
+        //   dicUrl: '/api/blade-system/dept/deptList'
+        // },
         {
           label: "商品图片",
           prop: "filesList",

+ 52 - 49
src/views/tirePartsMall/basicData/sharedSales/detailsPage.vue

@@ -7,8 +7,8 @@
                 </el-button>
             </div>
             <div class="add-customer-btn">
-                <el-button class="el-button&#45;&#45;small-yh" :disabled="isEditButton" style="margin-left: 6px;"
-                    type="primary" size="small" v-if="editButton" @click="confirmEditing">编 辑
+                <el-button class="el-button&#45;&#45;small-yh" style="margin-left: 6px;" type="primary" size="small"
+                    v-if="editButton" @click="confirmEditing">编 辑
                 </el-button>
                 <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
                     :disabled="isSaveBtn" @click="editCustomer">保 存
@@ -18,11 +18,11 @@
                     @click="getReturns">
                     销售退货
                 </el-button>
-                <el-button v-if="form.status!='已发货'" class="el-button--small-yh" style="margin-left: 6px;" type="success" size="small"
-                    :disabled="!form.id" @click="confirm(1)">确认发货
+                <el-button v-if="form.status != '已发货'" class="el-button--small-yh" style="margin-left: 6px;"
+                    type="success" size="small" :disabled="!form.id || editButton" @click="confirm(1)">确认发货
                 </el-button>
-                <el-button v-if="form.status=='已发货'" class="el-button--small-yh" style="margin-left: 6px;" type="danger" size="small"
-                    :disabled="!form.id" @click="confirm(2)">撤销发货
+                <el-button v-if="form.status == '已发货'" class="el-button--small-yh" style="margin-left: 6px;"
+                    type="danger" size="small" :disabled="!form.id || editButton" @click="confirm(2)">撤销发货
                 </el-button>
             </div>
         </div>
@@ -33,12 +33,12 @@
                         <dic-select v-model="form.customerName" placeholder="客户" key="id" label="cname" res="records"
                             url="/blade-sales-part/corpsDesc/list?current=1&size=10&corpType=KH" :filterable="true"
                             :remote="true" dataName="cname" @selectChange="dicChange('customerName', $event)"
-                            :disabled="false"></dic-select>
+                            :disabled="editButton || form.status == '已发货'"></dic-select>
                     </tempalte>
                     <template slot-scope="{row,index}" slot="contacts">
                         <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" clearable
                             filterable allow-create default-first-option @change="contactsChange($event)"
-                            :disabled=isContacts>
+                            :disabled="editButton || form.status == '已发货'">
                             <el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts"
                                 :value="item.contacts" />
                         </el-select>
@@ -53,39 +53,44 @@
                             @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 434)"
                             @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 434)">
                             <template slot-scope="{scope,row}" slot="menuLeft">
-                                <el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
+                                <el-button type="primary" icon="el-icon-plus" size="small"
+                                    :disabled="editButton || form.status == '已发货'"
                                     @click="rowAdd(row, 1)">添加商品</el-button>
-                                <el-button type="success" size="small" :disabled="!form.id" icon="el-icon-bottom"
+                                <el-button type="success" size="small"
+                                    :disabled="!form.id || editButton || form.status == '已发货'" icon="el-icon-bottom"
                                     @click="excelDialogfun('名称')">按名称导入
                                 </el-button>
-                                <el-button type="success" size="small" :disabled="!form.id" icon="el-icon-bottom"
+                                <el-button type="success" size="small"
+                                    :disabled="!form.id || editButton || form.status == '已发货'" icon="el-icon-bottom"
                                     @click="excelDialogfun('code')">按Code导入
                                 </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"
-                                    :disabled="form.generateTask == '已生成' || form.businessSource == '外部销售'">一键删除</el-button>
-                                <el-button type="primary" plain size="small" :disabled="selectionMultilist.length == 0"
+                                    :disabled="editButton || form.status == '已发货'">一键删除</el-button>
+                                <el-button type="primary" plain size="small"
+                                    :disabled="selectionMultilist.length == 0 || editButton || form.status == '已发货'"
                                     @click="allClick('派发销售单')">派发销售单</el-button>
-                                <el-button type="danger" plain size="small" @click="allClick('撤销派发')" :disabled="selectionMultilist.length == 0">撤销派发</el-button>
+                                <el-button type="danger" plain size="small" @click="allClick('撤销派发')"
+                                    :disabled="selectionMultilist.length == 0 || editButton || form.status == '已发货'">撤销派发</el-button>
                             </template>
                             <template slot="goodsId" slot-scope="{ row }">
                                 {{ row.goodsName }}
                             </template>
 
                             <template slot="goodsNum" slot-scope="{ row }">
-                                <el-input-number v-if="!mingxibaocun && form.businessSource != '外部销售'" size="small"
-                                    v-model="row.goodsNum" :precision="numberDecimal" :controls="false"
-                                    @change="goodsNumblurfun(row)" style="width: 100%"></el-input-number>
+                                <el-input-number v-if="row.$cellEdit" size="small" v-model="row.goodsNum"
+                                    :precision="numberDecimal" :controls="false" @change="goodsNumblurfun(row)"
+                                    style="width: 100%"></el-input-number>
                                 <span v-else>{{ row.goodsNum }}</span>
                             </template>
                             <template slot="price" slot-scope="{ row }">
-                                <el-input v-if="!mingxibaocun && form.businessSource != '外部销售'" size="small"
-                                    v-model="row.price" style="width: 100%"></el-input>
+                                <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-select v-if="!mingxibaocun" v-model="row.dot" filterable default-first-option
+                                <el-select v-if="row.$cellEdit" v-model="row.dot" filterable default-first-option
                                     @focus="picihaolistfun(row.goodsId)" @change="dotchangefun($event, row)"
                                     size="small">
                                     <el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
@@ -96,20 +101,20 @@
                             <template slot="subTotalMoney" slot-scope="{ row }">{{ row.goodsNum * row.price
                                 }}</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="disabled" :type="type"
-                                    :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
+                                <el-button v-if="!row.$cellEdit" :size="size" :disabled="editButton || row.sendNum > 0"
+                                    :type="type" :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
                                     @click="rowCell(row, index)">编辑
                                 </el-button>
-                                <el-button v-else :size="size" :disabled="disabled" :type="type"
+                                <el-button v-else :size="size" :disabled="editButton || row.sendNum > 0" :type="type"
                                     :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
                                     @click="rowSave(row, index)">保存
                                 </el-button>
-                                <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled||row.sendNum>0"
+                                <el-button icon="el-icon-delete" :size="size" :disabled="editButton || row.sendNum > 0"
                                     :type="type" @click="rowDelBox(row, index, 'orderItemsList')">删除
                                 </el-button>
                             </template>
@@ -757,7 +762,7 @@ export default {
                 addRowBtn: false,
                 editBtn: false,
                 delBtn: false,
-                menuWidth: 140,
+                menuWidth: 150,
                 dialogTop: 25,
                 dialogWidth: "80%",
                 summaryText: "合计",
@@ -1076,10 +1081,18 @@ export default {
         this.optionOutboundRecords = await this.getColumnData(this.getColumnName(435), this.optionOutboundRecordsBack);
         this.key++
         if (this.detailData.id) {
+            this.editButton = true
+            this.optionForm.disabled = true
             this.getDetail(this.detailData.id, true)
         }
     },
     methods: {
+        confirmEditing() {
+            this.editButton = false
+            if (this.form.status != '已发货') {
+                this.optionForm.disabled = false
+            }
+        },
         outGoodsChange(row) {
             if (Number(row.outGoodsTotalShipNum) > Number(Number(row.goodsNum) - Number(row.sendNum))) {
                 this.$set(row, 'outGoodsTotalShipNum', null)
@@ -1131,7 +1144,7 @@ export default {
             if (type == 1) {
                 for (let item of this.form.orderItemsList) {
                     if (item.sendNum != item.goodsNum) {
-                        return this.$message.error("第"+Number(item.$index+1)+"行明细未发货,请先发货");
+                        return this.$message.error("第" + Number(item.$index + 1) + "行明细未发货,请先发货");
                     }
                 }
                 this.$confirm('是否确认发货?', '提示', {
@@ -1192,7 +1205,7 @@ export default {
                 this.distributeVisible = true
             }
             if (name == '撤销派发') {
-                let ids=[]
+                let ids = []
                 for (let item of this.selectionMultilist) {
                     if (item.sendNum == 0) {
                         return this.$message.error("请正确选择明细");
@@ -1210,7 +1223,7 @@ export default {
                         spinner: 'el-icon-loading',
                         background: 'rgba(255,255,255,0.7)'
                     });
-                    revokeDistributeShareSales({ itemIds:ids.join(',')}).then(res => {
+                    revokeDistributeShareSales({ itemIds: ids.join(',') }).then(res => {
                         this.$message.success("操作成功");
                         this.getDetail(this.form.id)
                     }).finally(() => {
@@ -1363,11 +1376,11 @@ export default {
             this.onLoad(this.page, params);
             done()
         },
-        rowCell() {
-            this.mingxibaocun = false
+        rowCell(row) {
+            this.$set(row, "$cellEdit", true);
         },
-        rowSave() {
-            this.mingxibaocun = true
+        rowSave(row) {
+            this.$set(row, "$cellEdit", false);
         },
         // 标签页切换
         tabHandle(data) {
@@ -1463,24 +1476,14 @@ export default {
             })
             getDetails({ id: id }).then(res => {
                 this.form = res.data.data
-                loading.close();
-            }).catch(() => {
-                loading.close();
-            })
-        },
-        refreshs(id, type) {
-            const loading = this.$loading({
-                lock: true,
-                text: '加载中',
-                spinner: 'el-icon-loading',
-                background: 'rgba(255,255,255,0.7)'
-            });
-            getDetails({ id: id }).then(res => {
-                this.form = res.data.data
-                this.dataList = res.data.data.paymentRecordsList ? res.data.data.paymentRecordsList : [];
+                if (res.data.data.status != '已发货') {
+                    this.optionForm.disabled = false
+                }else{
+                    this.optionForm.disabled = true
+                }
             }).finally(() => {
                 loading.close();
-            });
+            })
         },
         rowDelBox(row, index, type) {
             this.$confirm("确定将选择数据删除?", {