|
@@ -37,6 +37,49 @@
|
|
|
<span>{{ item.advanceRatio }}%</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
+ <template #tags="{ item }">
|
|
|
+ <div style="width: 100%" v-if="item.tag">
|
|
|
+ <el-tag
|
|
|
+ style="margin-right: 8px"
|
|
|
+ type="success"
|
|
|
+ v-for="(tag, index) in item.tag"
|
|
|
+ closable
|
|
|
+ :key="index"
|
|
|
+ @close="tagClose(tag, item)"
|
|
|
+ >
|
|
|
+ {{ dictValueLabel(tag, customerTag) }}
|
|
|
+ </el-tag>
|
|
|
+ <template v-if="item.tag.length !== customerTag.length">
|
|
|
+ <el-select
|
|
|
+ v-if="item.addTagShow"
|
|
|
+ v-model="addTag"
|
|
|
+ style="width: 100%"
|
|
|
+ @change="
|
|
|
+ (val) => {
|
|
|
+ return changeTag(val, item);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="tag in customerTag"
|
|
|
+ :key="tag.value"
|
|
|
+ :label="tag.label"
|
|
|
+ :value="tag.value"
|
|
|
+ :disabled="judgeTagSelect(item.tag, tag.value)"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <el-tag
|
|
|
+ style="cursor: pointer"
|
|
|
+ type="success"
|
|
|
+ @click="showSelect(item)"
|
|
|
+ v-else
|
|
|
+ >
|
|
|
+ +
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</byTable>
|
|
|
</div>
|
|
|
|
|
@@ -468,6 +511,13 @@ const config = computed(() => {
|
|
|
"min-width": 220,
|
|
|
},
|
|
|
},
|
|
|
+ // {
|
|
|
+ // attrs: {
|
|
|
+ // label: "客户标签",
|
|
|
+ // slot: "tags",
|
|
|
+ // width: 180,
|
|
|
+ // },
|
|
|
+ // },
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "报价金额",
|
|
@@ -528,6 +578,8 @@ const config = computed(() => {
|
|
|
},
|
|
|
];
|
|
|
});
|
|
|
+const customerTag = ref([]);
|
|
|
+
|
|
|
const getDict = () => {
|
|
|
proxy
|
|
|
.post("/saleQuotation/page", { pageNum: 1, pageSize: 999 })
|
|
@@ -550,7 +602,12 @@ const getDict = () => {
|
|
|
});
|
|
|
|
|
|
proxy
|
|
|
- .getDictOne(["trade_mode", "account_currency", "shipping_method"])
|
|
|
+ .getDictOne([
|
|
|
+ "trade_mode",
|
|
|
+ "account_currency",
|
|
|
+ "shipping_method",
|
|
|
+ "customer_tag",
|
|
|
+ ])
|
|
|
.then((res) => {
|
|
|
tradeMethods.value = res["trade_mode"].map((x) => ({
|
|
|
label: x.dictValue,
|
|
@@ -564,6 +621,10 @@ const getDict = () => {
|
|
|
label: x.dictValue,
|
|
|
value: x.dictKey,
|
|
|
}));
|
|
|
+ customerTag.value = res["customer_tag"].map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
});
|
|
|
};
|
|
|
const getList = async (req) => {
|
|
@@ -697,6 +758,55 @@ const getAllMoney = (num) => {
|
|
|
}
|
|
|
return money;
|
|
|
};
|
|
|
+const addTag = ref("");
|
|
|
+const judgeTagSelect = (data, val) => {
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ if (data.includes(val)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+};
|
|
|
+
|
|
|
+const changeTag = (val, item) => {
|
|
|
+ let data = {
|
|
|
+ id: item.buyCorporationId,
|
|
|
+ tag: JSON.parse(JSON.stringify(item.tag)),
|
|
|
+ };
|
|
|
+ data.tag.push(val);
|
|
|
+ data.tag = data.tag.join(",");
|
|
|
+ proxy.post("/customer/editTag", data).then(() => {
|
|
|
+ ElMessage({
|
|
|
+ message: "添加成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ item.addTagShow = false;
|
|
|
+ addTag.value = "";
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const tagClose = (val, item) => {
|
|
|
+ let data = {
|
|
|
+ id: item.buyCorporationId,
|
|
|
+ tag: JSON.parse(JSON.stringify(item.tag)),
|
|
|
+ };
|
|
|
+ data.tag = data.tag.filter((row) => row !== val);
|
|
|
+ if (data.tag && data.tag.length > 0) {
|
|
|
+ data.tag = data.tag.join(",");
|
|
|
+ } else {
|
|
|
+ data.tag = "";
|
|
|
+ }
|
|
|
+ proxy.post("/customer/editTag", data).then(() => {
|
|
|
+ ElMessage({
|
|
|
+ message: "添加成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ item.addTagShow = false;
|
|
|
+ addTag.value = "";
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|