|
@@ -22,7 +22,11 @@
|
|
|
}
|
|
|
"
|
|
|
></query>
|
|
|
- <el-table :data="tableList" v-loading="loading">
|
|
|
+ <el-table
|
|
|
+ :data="tableList"
|
|
|
+ v-loading="loading"
|
|
|
+ @filter-change="filterChange"
|
|
|
+ >
|
|
|
<el-table-column
|
|
|
label="产品类型"
|
|
|
align="left"
|
|
@@ -90,12 +94,56 @@
|
|
|
/>
|
|
|
|
|
|
<el-table-column
|
|
|
+ label="标签"
|
|
|
+ align="left"
|
|
|
+ width="200"
|
|
|
+ column-key="product"
|
|
|
+ :filters="nameList"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div
|
|
|
+ style="height: 8px"
|
|
|
+ v-if="scope.row.tagNames && scope.row.tagNames.length > 0"
|
|
|
+ ></div>
|
|
|
+
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="编辑标签"
|
|
|
+ placement="bottom"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ style="padding: 0 5px; font-size: 14px; cursor: pointer"
|
|
|
+ class="el-icon-edit-outline"
|
|
|
+ @click="editLabel(scope.row)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tag
|
|
|
+ type="success"
|
|
|
+ size="small"
|
|
|
+ style="margin-left: 8px; margin-bottom: 8px"
|
|
|
+ v-for="(item, index) in scope.row.tagNames"
|
|
|
+ :key="index"
|
|
|
+ >{{ item.tagName }}</el-tag
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
- width="120"
|
|
|
+ width="180"
|
|
|
fixed="right"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="handleMove(scope.row)"
|
|
|
+ >移交
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ v-if="scope.row.receiveFlag"
|
|
|
+ @click="handleReceivee(scope.row)"
|
|
|
+ >接收
|
|
|
+ </el-button>
|
|
|
<el-button type="text" @click="handleEdit(scope.row)"
|
|
|
>修改
|
|
|
</el-button>
|
|
@@ -132,206 +180,60 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog
|
|
|
- :title="$t('seniorQuery')"
|
|
|
- v-if="queryDialog"
|
|
|
- :visible.sync="queryDialog"
|
|
|
- width="50%"
|
|
|
- top="60px"
|
|
|
+ title="产品移交"
|
|
|
+ :visible.sync="openOne"
|
|
|
+ v-if="openOne"
|
|
|
+ width="40%"
|
|
|
+ top="20vh"
|
|
|
>
|
|
|
- <div class="search-box">
|
|
|
- <el-form
|
|
|
- :form="req"
|
|
|
- label-position="top"
|
|
|
- label-width="100px"
|
|
|
- @submit.native.prevent
|
|
|
- >
|
|
|
- <el-form-item
|
|
|
- :label="$t('product_material.product.productType')"
|
|
|
- >
|
|
|
- <el-radio-group v-model="req.type">
|
|
|
- <el-radio-button label="">
|
|
|
- {{ $t("product_material.product.all") }}
|
|
|
- </el-radio-button>
|
|
|
- <el-radio-button
|
|
|
- v-for="item in productTypeList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.dictKey"
|
|
|
- >
|
|
|
- {{ item.dictValue }}</el-radio-button
|
|
|
- >
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <el-row :gutter="10">
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item
|
|
|
- :label="$t('product_material.product.productCode')"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="req.code"
|
|
|
- placeholder="请输入"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="18">
|
|
|
- <el-form-item
|
|
|
- :label="$t('product_material.product.productName')"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="req.name"
|
|
|
- placeholder="请输入"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-form-item
|
|
|
- :label="$t('product_material.product.combination')"
|
|
|
- >
|
|
|
- <el-radio-group v-model="req.combination">
|
|
|
- <el-radio-button label="">
|
|
|
- {{ $t("product_material.product.all") }}</el-radio-button
|
|
|
- >
|
|
|
- <el-radio-button label="1">
|
|
|
- {{ $t("product_material.product.yes") }}
|
|
|
- </el-radio-button>
|
|
|
- <el-radio-button label="0">
|
|
|
- {{ $t("product_material.product.no") }}</el-radio-button
|
|
|
- >
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <el-row>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- :label="$t('product_material.product.deptId')"
|
|
|
- >
|
|
|
- <avue-input-tree
|
|
|
- v-model="req.deptId"
|
|
|
- style="width: 100%"
|
|
|
- placeholder="请选择"
|
|
|
- type="tree"
|
|
|
- size="small"
|
|
|
- :dic="deptList"
|
|
|
- :props="defaultProps"
|
|
|
- :node-click="popoverDeptHide"
|
|
|
- ></avue-input-tree>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-form-item
|
|
|
- :label="$t('product_material.product.jdPurchasePrice')"
|
|
|
- >
|
|
|
- <el-row>
|
|
|
- <el-col :span="4">
|
|
|
- <el-form-item label-width="0px">
|
|
|
- <el-input
|
|
|
- v-model="req.jdPurchasePriceMin"
|
|
|
- placeholder="请输入"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2" style="text-align: center"> ~ </el-col>
|
|
|
- <el-col :span="4">
|
|
|
- <el-form-item label-width="0px">
|
|
|
- <el-input
|
|
|
- v-model="req.jdPurchasePriceMax"
|
|
|
- placeholder="请输入"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- :label="$t('product_material.product.sellingPrice')"
|
|
|
- >
|
|
|
- <el-row>
|
|
|
- <el-col :span="4">
|
|
|
- <el-form-item label-width="0px">
|
|
|
- <el-input
|
|
|
- v-model="req.sellingPriceMin"
|
|
|
- placeholder="请输入"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2" style="text-align: center"> ~ </el-col>
|
|
|
- <el-col :span="4">
|
|
|
- <el-form-item label-width="0px">
|
|
|
- <el-input
|
|
|
- v-model="req.sellingPriceMax"
|
|
|
- placeholder="请输入"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- :label="$t('product_material.product.purchasePrice')"
|
|
|
- >
|
|
|
- <el-row>
|
|
|
- <el-col :span="4">
|
|
|
- <el-form-item label-width="0px">
|
|
|
- <el-input
|
|
|
- v-model="req.purchasePriceMin"
|
|
|
- placeholder="请输入"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="2" style="text-align: center"> ~ </el-col>
|
|
|
- <el-col :span="4">
|
|
|
- <el-form-item label-width="0px">
|
|
|
- <el-input
|
|
|
- v-model="req.purchasePriceMax"
|
|
|
- placeholder="请输入"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item :label="$t('product_material.product.lifeCycle')">
|
|
|
- <el-radio-group v-model="req.lifeCycle">
|
|
|
- <el-radio-button label="">
|
|
|
- {{ $t("product_material.product.all") }}</el-radio-button
|
|
|
- >
|
|
|
- <el-radio-button label="1">
|
|
|
- {{
|
|
|
- $t("product_material.product.newProductsExpectedSales")
|
|
|
- }}</el-radio-button
|
|
|
- >
|
|
|
- <el-radio-button label="2">
|
|
|
- {{
|
|
|
- $t("product_material.product.growUpExpectedSales")
|
|
|
- }}</el-radio-button
|
|
|
- >
|
|
|
- <el-radio-button
|
|
|
- :label="
|
|
|
- $t('product_material.product.matureExpectedSales')
|
|
|
- "
|
|
|
- name="3"
|
|
|
- ></el-radio-button>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- :label="$t('product_material.product.clearancePeriod')"
|
|
|
+ <el-form
|
|
|
+ ref="moveForm"
|
|
|
+ :model="moveForm"
|
|
|
+ :rules="moveRules"
|
|
|
+ label-width="80px"
|
|
|
+ >
|
|
|
+ <el-form-item label="移交部门" prop="transferDetpId">
|
|
|
+ <el-cascader
|
|
|
+ v-model="moveForm.transferDetpId"
|
|
|
+ :options="deptList"
|
|
|
+ :props="{
|
|
|
+ expandTrigger: 'hover',
|
|
|
+ value: 'id',
|
|
|
+ label: 'deptName',
|
|
|
+ }"
|
|
|
+ style="width: 100%"
|
|
|
+ @change="handleDeptChange"
|
|
|
+ ></el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="移交备注" prop="remarks">
|
|
|
+ <el-input
|
|
|
+ v-model="moveForm.code"
|
|
|
+ type="textarea"
|
|
|
+ size="mini"
|
|
|
+ placeholder="请输入"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item> -->
|
|
|
+ <div style="text-align: center; margin-top: 15px">
|
|
|
+ <el-button size="small" @click="moveCancel">取消 </el-button>
|
|
|
+ <el-button type="primary" size="small" @click="moveSubmit">
|
|
|
+ 确定</el-button
|
|
|
>
|
|
|
- <el-date-picker
|
|
|
- v-model="timeArr"
|
|
|
- type="daterange"
|
|
|
- range-separator="-"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- @change="handleDateChange"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- <div style="text-align: center; margin-top: 15px">
|
|
|
- <el-button size="small" @click="handleReset"
|
|
|
- >{{ $t("reset") }}
|
|
|
- </el-button>
|
|
|
- <el-button type="primary" size="small" @click="handleQuery">
|
|
|
- 确定</el-button
|
|
|
- >
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="编辑标签"
|
|
|
+ v-if="openEditorLabel"
|
|
|
+ :visible.sync="openEditorLabel"
|
|
|
+ width="30%"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <product-label
|
|
|
+ :rowData="rowData"
|
|
|
+ @clickCancel="clickCancelLabel"
|
|
|
+ @update="handleTagUpdate"
|
|
|
+ ></product-label>
|
|
|
</el-dialog>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
@@ -343,6 +245,7 @@
|
|
|
import addProduct from "./addProduct.vue";
|
|
|
import query from "@/components/query/index.vue";
|
|
|
import tree from "./tree.vue";
|
|
|
+import productLabel from "./productLabel.vue";
|
|
|
|
|
|
import byTable from "@/components/by-table/index.js";
|
|
|
import test from "@/components/form-test/index.vue";
|
|
@@ -358,6 +261,7 @@ export default {
|
|
|
byTable,
|
|
|
test,
|
|
|
addProduct,
|
|
|
+ productLabel,
|
|
|
query,
|
|
|
},
|
|
|
data() {
|
|
@@ -389,6 +293,7 @@ export default {
|
|
|
endTime: null,
|
|
|
productSpuId: "",
|
|
|
definition: "2",
|
|
|
+ tagNameList: [], //标签集合名称,2023-2-21新增
|
|
|
},
|
|
|
tableList: [],
|
|
|
total: 0,
|
|
@@ -436,6 +341,22 @@ export default {
|
|
|
queryDialog: false,
|
|
|
timeArr: [],
|
|
|
fileData: {},
|
|
|
+ openOne: false,
|
|
|
+ moveForm: {
|
|
|
+ transferDetpId: "",
|
|
|
+ id: "",
|
|
|
+ },
|
|
|
+ moveRules: {
|
|
|
+ transferDetpId: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择移交部门",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ openEditorLabel: false,
|
|
|
+ nameList: [],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -447,6 +368,9 @@ export default {
|
|
|
console.log("getDeptData:" + err);
|
|
|
}
|
|
|
);
|
|
|
+ API.getTagMap().then((res) => {
|
|
|
+ this.nameList = res.data.data.map((x) => ({ text: x, value: x }));
|
|
|
+ });
|
|
|
const businessDictData = JSON.parse(
|
|
|
window.localStorage.getItem("businessDict")
|
|
|
);
|
|
@@ -515,6 +439,7 @@ export default {
|
|
|
warehouseId: "",
|
|
|
definition: "2",
|
|
|
fileInfoList: [],
|
|
|
+ tagNameList: [],
|
|
|
};
|
|
|
this.timeArr = [];
|
|
|
this.getList();
|
|
@@ -529,22 +454,24 @@ export default {
|
|
|
this.tableList = res.data.data.records;
|
|
|
this.total = res.data.data.total;
|
|
|
this.loading = false;
|
|
|
+ const arr = this.tableList.map((x) => x.id);
|
|
|
+ API.getTagList(arr).then((res) => {
|
|
|
+ for (let i = 0; i < this.tableList.length; i++) {
|
|
|
+ for (let key in res.data.data) {
|
|
|
+ if (this.tableList[i].id === key) {
|
|
|
+ this.tableList[i].tagNames = res.data.data[key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$forceUpdate();
|
|
|
+ });
|
|
|
},
|
|
|
(err) => {
|
|
|
console.log("productList: " + err);
|
|
|
this.loading = false;
|
|
|
}
|
|
|
);
|
|
|
- // API.productCount(this.req).then(
|
|
|
- // (res) => {
|
|
|
- // this.total = res.data.data.count;
|
|
|
- // },
|
|
|
- // (err) => {
|
|
|
- // console.log("productCount: " + err);
|
|
|
- // }
|
|
|
- // );
|
|
|
},
|
|
|
-
|
|
|
handleCancel() {
|
|
|
this.open = false;
|
|
|
},
|
|
@@ -583,7 +510,6 @@ export default {
|
|
|
if (file.data.data.length > 0) {
|
|
|
this.fileData = file.data.data[0];
|
|
|
}
|
|
|
-
|
|
|
if (row.combination === 1) {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.addProduct.loading = true;
|
|
@@ -659,14 +585,7 @@ export default {
|
|
|
);
|
|
|
}
|
|
|
},
|
|
|
- showType(row) {
|
|
|
- const current = this.productTypeList.find(
|
|
|
- (item) => item.dictKey == row.type
|
|
|
- );
|
|
|
- if (current) {
|
|
|
- return current.dictValue;
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
showCycleSales(row) {
|
|
|
if (row.lifeCycle) {
|
|
|
switch (row.lifeCycle) {
|
|
@@ -689,6 +608,67 @@ export default {
|
|
|
}
|
|
|
return row.name;
|
|
|
},
|
|
|
+
|
|
|
+ editLabel(row) {
|
|
|
+ this.rowData = row;
|
|
|
+ this.openEditorLabel = true;
|
|
|
+ },
|
|
|
+ clickCancelLabel() {
|
|
|
+ this.openEditorLabel = false;
|
|
|
+ },
|
|
|
+ handleTagUpdate() {
|
|
|
+ this.handleQuery();
|
|
|
+ API.getTagMap().then((res) => {
|
|
|
+ this.nameList = res.data.data.map((x) => ({ text: x, value: x }));
|
|
|
+ });
|
|
|
+ },
|
|
|
+ filterChange(val) {
|
|
|
+ if (val.product) {
|
|
|
+ this.req.tagNameList = val.product;
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleMove(row) {
|
|
|
+ this.openOne = true;
|
|
|
+ this.moveForm = {
|
|
|
+ id: row.id,
|
|
|
+ transferDetpId: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ handleDeptChange() {
|
|
|
+ this.moveForm.transferDetpId =
|
|
|
+ this.moveForm.transferDetpId[this.moveForm.transferDetpId.length - 1];
|
|
|
+ },
|
|
|
+ moveSubmit() {
|
|
|
+ this.$refs.moveForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ API.moveProduct(this.moveForm).then(() => {
|
|
|
+ this.msgSuccess("移交成功");
|
|
|
+ this.openOne = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleReceivee(row) {
|
|
|
+ this.$confirm("请问是否确认接收 ?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ API.receiveProduct({ id: row.id }).then(() => {
|
|
|
+ this.msgSuccess("接收成功");
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ moveCancel() {
|
|
|
+ this.openOne = false;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|