|
@@ -39,99 +39,99 @@
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
- name: "category-move",
|
|
|
+ name: 'category-move',
|
|
|
components: {},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
visible: false,
|
|
|
id: 0,
|
|
|
dataForm: {
|
|
|
- id: "",
|
|
|
+ id: ''
|
|
|
},
|
|
|
dataList: [],
|
|
|
dataRule: {
|
|
|
- materialTypeId: { required: true, trigger: "blur", message: "请选择" },
|
|
|
- },
|
|
|
- };
|
|
|
+ materialTypeId: { required: true, trigger: 'blur', message: '请选择' }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- onChose() {
|
|
|
- this.$emit("onChose");
|
|
|
+ onChose () {
|
|
|
+ this.$emit('onChose')
|
|
|
},
|
|
|
- async init(id) {
|
|
|
- this.visible = true;
|
|
|
- this.id = id || 0;
|
|
|
- this.dataForm = {};
|
|
|
- this.dataForm.id = id || 0;
|
|
|
+ async init (id) {
|
|
|
+ this.visible = true
|
|
|
+ this.id = id || 0
|
|
|
+ this.dataForm = {}
|
|
|
+ this.dataForm.id = id || 0
|
|
|
|
|
|
- await this.getDataList();
|
|
|
+ await this.getDataList()
|
|
|
|
|
|
if (this.id) {
|
|
|
this.$http({
|
|
|
url: this.$http.adornUrl(`/biz-service/wh-category/info/${this.id}`),
|
|
|
- method: "get",
|
|
|
- params: this.$http.adornParams(),
|
|
|
+ method: 'get',
|
|
|
+ params: this.$http.adornParams()
|
|
|
}).then(({ data }) => {
|
|
|
- if (data.code === "200") {
|
|
|
- this.dataForm = data.data;
|
|
|
- if (this.dataForm.parentId == "0") {
|
|
|
- this.dataForm.parentId = "";
|
|
|
+ if (data.code === '200') {
|
|
|
+ this.dataForm = data.data
|
|
|
+ if (this.dataForm.parentId === '0') {
|
|
|
+ this.dataForm.parentId = ''
|
|
|
}
|
|
|
} else {
|
|
|
- this.$message.error(data.msg);
|
|
|
+ this.$message.error(data.msg)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
// 表单提交
|
|
|
- dataFormSubmit() {
|
|
|
- this.$refs["dataForm"].validate((valid) => {
|
|
|
+ dataFormSubmit () {
|
|
|
+ this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.$http({
|
|
|
url: this.$http.adornUrl(`/biz-service/wh-category/move`),
|
|
|
- method: "post",
|
|
|
+ method: 'post',
|
|
|
data: {
|
|
|
businessId: this.dataForm.id,
|
|
|
- materialTypeId: this.dataForm.materialTypeId,
|
|
|
- },
|
|
|
+ materialTypeId: this.dataForm.materialTypeId
|
|
|
+ }
|
|
|
}).then(({ data }) => {
|
|
|
- if (data && data.code === "200") {
|
|
|
+ if (data && data.code === '200') {
|
|
|
this.$message({
|
|
|
- message: "操作成功",
|
|
|
- type: "success",
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
duration: 1500,
|
|
|
onClose: () => {
|
|
|
- this.onChose();
|
|
|
- this.$emit("refreshDataList");
|
|
|
- },
|
|
|
- });
|
|
|
+ this.onChose()
|
|
|
+ this.$emit('refreshDataList')
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.$message.error(data.msg);
|
|
|
+ this.$message.error(data.msg)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
// 获取数据列表
|
|
|
- getDataList(name) {
|
|
|
+ getDataList (name) {
|
|
|
this.$http({
|
|
|
- url: this.$http.adornUrl("/biz-service/wh-category/list"),
|
|
|
- method: "get",
|
|
|
+ url: this.$http.adornUrl('/biz-service/wh-category/list'),
|
|
|
+ method: 'get',
|
|
|
params: this.$http.adornParams({
|
|
|
current: this.pageIndex,
|
|
|
size: 100,
|
|
|
- materialName: name,
|
|
|
- }),
|
|
|
+ materialName: name
|
|
|
+ })
|
|
|
}).then(({ data }) => {
|
|
|
- if (data && data.code === "200") {
|
|
|
- this.dataList = data.data.records;
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.dataList = data.data.records
|
|
|
} else {
|
|
|
- this.dataList = [];
|
|
|
+ this.dataList = []
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped></style>
|