|
@@ -35,12 +35,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="editButton || form.status == '已发货' || form.businessSource == '外部销售'"></dic-select>
|
|
|
+ :disabled="editButton || form.status == '已发货' || form.businessSource == '外部销售' || form.goodsTotalShipNum > 0"></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="editButton || form.status == '已发货' || form.businessSource == '外部销售'">
|
|
|
+ :disabled="editButton || form.status == '已发货' || form.businessSource == '外部销售' || form.goodsTotalShipNum > 0">
|
|
|
<el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts"
|
|
|
:value="item.contacts" />
|
|
|
</el-select>
|
|
@@ -66,17 +66,18 @@
|
|
|
:disabled="!form.id || editButton || form.status == '已发货' || form.businessSource == '外部销售'"
|
|
|
icon="el-icon-bottom" @click="excelDialogfun('code')">按Code导入
|
|
|
</el-button>
|
|
|
+ <el-button type="primary" plain size="small" @click="quickCopy">快捷复制</el-button>
|
|
|
<el-popover placement="top" width="400" trigger="click" @show="inventoryShow2()">
|
|
|
<avue-crud :data="inventoryList" :option="inventoryOption">
|
|
|
</avue-crud>
|
|
|
<el-button slot="reference" type="primary" plain size="small"
|
|
|
- :disabled="selectionMultilist.length != 1">查看库存</el-button>
|
|
|
+ :disabled="selectionMultilist.length != 1 || form.businessSource == '外部销售'">查看库存</el-button>
|
|
|
</el-popover>
|
|
|
<el-button type="primary" plain size="small"
|
|
|
- :disabled="selectionMultilist.length == 0 || editButton || form.status == '已发货'"
|
|
|
+ :disabled="selectionMultilist.length == 0 || editButton || form.status == '已发货' || form.businessSource == '外部销售'"
|
|
|
@click="allClick('派发销售单')">派发销售单</el-button>
|
|
|
<el-button type="danger" plain size="small" @click="allClick('撤销派发')"
|
|
|
- :disabled="selectionMultilist.length == 0 || editButton || form.goodsTotalShipNum == 0">撤销派发</el-button>
|
|
|
+ :disabled="selectionMultilist.length == 0 || editButton || form.goodsTotalShipNum == 0 || form.businessSource == '外部销售'">撤销派发</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"
|
|
@@ -114,13 +115,15 @@
|
|
|
<span v-else>{{ row.remarks }}</span>
|
|
|
</template>
|
|
|
<template slot-scope="{type,size,row,index,disabled}" slot="menu">
|
|
|
- <el-button v-if="!row.$cellEdit" :size="size" :disabled="editButton || row.sendNum > 0"
|
|
|
+ <el-button v-if="!row.$cellEdit" :size="size"
|
|
|
+ :disabled="editButton || row.sendNum > 0 || form.businessSource == '外部销售'"
|
|
|
:type="type" icon="el-icon-edit" @click="rowCell(row, index)">编辑
|
|
|
</el-button>
|
|
|
<el-button v-else :size="size" :disabled="editButton || row.sendNum > 0" :type="type"
|
|
|
icon="el-icon-plus" @click="rowSave(row, index)">保存
|
|
|
</el-button>
|
|
|
- <el-button icon="el-icon-delete" :size="size" :disabled="editButton || row.sendNum > 0"
|
|
|
+ <el-button icon="el-icon-delete" :size="size"
|
|
|
+ :disabled="editButton || row.sendNum > 0 || form.businessSource == '外部销售'"
|
|
|
:type="type" @click="rowDelBox(row, index, 'orderItemsList')">删除
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -1124,6 +1127,19 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 快捷复制
|
|
|
+ quickCopy() {
|
|
|
+ let temp = document.createElement("textarea")
|
|
|
+ let txt = `${this.form.customerName} ${this.form.businesDate}`
|
|
|
+ for (let item of this.form.orderItemsList) {
|
|
|
+ txt += `\n${item.goodsName} ${item.goodsNum}`
|
|
|
+ }
|
|
|
+ document.body.appendChild(temp)
|
|
|
+ temp.value = txt
|
|
|
+ temp.select()
|
|
|
+ document.execCommand("copy")
|
|
|
+ document.body.removeChild(temp)
|
|
|
+ },
|
|
|
confirmEditing() {
|
|
|
this.editButton = false
|
|
|
if (this.form.status != '已发货') {
|
|
@@ -1137,7 +1153,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- if (this.form.businessSource == '内部销售') {
|
|
|
+ if (this.form.businessSource == '内部销售' && this.form.goodsTotalShipNum == 0) {
|
|
|
this.optionForm.disabled = false
|
|
|
}
|
|
|
|
|
@@ -1275,7 +1291,7 @@ export default {
|
|
|
});
|
|
|
revokeDistributeShareSales({ itemIds: ids.join(',') }).then(res => {
|
|
|
this.$message.success("操作成功");
|
|
|
- this.getDetail(this.form.id)
|
|
|
+ this.getDetail(this.form.id, '撤销派发')
|
|
|
}).finally(() => {
|
|
|
loading.close();
|
|
|
});
|
|
@@ -1542,6 +1558,14 @@ export default {
|
|
|
if (res.data.data.status == '已发货') {
|
|
|
this.optionForm.disabled = true
|
|
|
}
|
|
|
+ if (res.data.data.goodsTotalShipNum > 0) {
|
|
|
+ this.optionForm.disabled = true
|
|
|
+ }
|
|
|
+ if (type == '撤销派发') {
|
|
|
+ if (res.data.data.goodsTotalShipNum == 0) {
|
|
|
+ this.optionForm.disabled = false
|
|
|
+ }
|
|
|
+ }
|
|
|
}).finally(() => {
|
|
|
loading.close();
|
|
|
})
|