|
@@ -0,0 +1,269 @@
|
|
|
+<template>
|
|
|
+ <div class="pageIndexClass">
|
|
|
+ <div>
|
|
|
+ <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
|
|
|
+ :selectConfig="selectConfig" :action-list="[
|
|
|
+
|
|
|
+ ]" @get-list="getList">
|
|
|
+
|
|
|
+ <template #aa="{ item }">
|
|
|
+ <div style="width:100%">
|
|
|
+ <el-progress type="circle" :percentage="Number(item.completionRate)" width="60"
|
|
|
+ :status="Number(item.completionRate) == 100 ? 'success' : ''" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ </byTable>
|
|
|
+ </div>
|
|
|
+ <el-dialog :title="modalType == 'add' ? '添加店铺' : '编辑店铺'" v-model="dialogVisible" width="500px" destroy-on-close>
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
|
|
|
+ </byForm>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="dialogVisible = false" size="defualt">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm()" size="defualt" :loading="submitLoading">
|
|
|
+ 确 定
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import byTable from "@/components/byTable/index";
|
|
|
+import byForm from "@/components/byForm/index";
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+const loading = ref(false);
|
|
|
+const submitLoading = ref(false);
|
|
|
+const sourceList = ref({
|
|
|
+ data: [],
|
|
|
+ pagination: {
|
|
|
+ total: 3,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ keyword: "",
|
|
|
+ },
|
|
|
+});
|
|
|
+const treeData = ref([]);
|
|
|
+const dialogVisible = ref(false);
|
|
|
+const modalType = ref("add");
|
|
|
+const selectConfig = computed(() => [
|
|
|
+ {
|
|
|
+ label: "事业部",
|
|
|
+ prop: "status",
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ label: "待采购",
|
|
|
+ value: "15",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "部分采购",
|
|
|
+ value: "30",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "生产状态",
|
|
|
+ prop: "status",
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ label: "待采购",
|
|
|
+ value: "15",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "部分采购",
|
|
|
+ value: "30",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "time",
|
|
|
+ label: "交期",
|
|
|
+ placeholder: "开始日期",
|
|
|
+ prop: "time",
|
|
|
+ placeholderOne: "结束日期",
|
|
|
+ propOne: "time1",
|
|
|
+ // data: status.value,
|
|
|
+ },
|
|
|
+]);
|
|
|
+const config = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ type: "selection",
|
|
|
+ attrs: {
|
|
|
+ checkAtt: "isCheck",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "事业部",
|
|
|
+ prop: "code",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "订单号",
|
|
|
+ prop: "name",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "交期",
|
|
|
+ prop: "deptName",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "生产状态",
|
|
|
+ prop: "deptName",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ slot: "aa",
|
|
|
+ label: "各款SKU生产进度",
|
|
|
+ prop: "name",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "操作",
|
|
|
+ width: "100",
|
|
|
+ align: "center",
|
|
|
+ fixed: "right",
|
|
|
+ },
|
|
|
+ renderHTML(row) {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "完成订单",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ getDtl(row);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+const formData = reactive({
|
|
|
+ data: {},
|
|
|
+});
|
|
|
+const formOption = reactive({
|
|
|
+ inline: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ itemWidth: 100,
|
|
|
+});
|
|
|
+const formDom = ref(null);
|
|
|
+const formConfig = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "code",
|
|
|
+ label: "店铺编号",
|
|
|
+ itemWidth: 100,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "name",
|
|
|
+ label: "店铺名称",
|
|
|
+ itemWidth: 100,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "treeSelect",
|
|
|
+ prop: "deptId",
|
|
|
+ label: "负责部门",
|
|
|
+ data: treeData.value,
|
|
|
+ propsTreeLabel: "deptName",
|
|
|
+ propsTreeValue: "deptId",
|
|
|
+ itemWidth: 100,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+const rules = ref({
|
|
|
+ deptId: [{ required: true, message: "请选择负责部门", trigger: "change" }],
|
|
|
+ name: [{ required: true, message: "请输入店铺名称", trigger: "blur" }],
|
|
|
+ code: [{ required: true, message: "请输入店铺编号", trigger: "blur" }],
|
|
|
+});
|
|
|
+
|
|
|
+const getDeptData = () => {
|
|
|
+ proxy
|
|
|
+ .get("/tenantDept/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9999,
|
|
|
+ keyword: "",
|
|
|
+ tenantId: proxy.useUserStore().user.tenantId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ treeData.value = proxy.handleTree(res.data, "deptId");
|
|
|
+ });
|
|
|
+};
|
|
|
+getDeptData();
|
|
|
+
|
|
|
+const getList = async (req) => {
|
|
|
+ sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
+ loading.value = true;
|
|
|
+ proxy.post("/shopInfo/page", sourceList.value.pagination).then((res) => {
|
|
|
+ sourceList.value.data = res.rows;
|
|
|
+ sourceList.value.pagination.total = res.total;
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false;
|
|
|
+ }, 200);
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const openModal = () => {
|
|
|
+ dialogVisible.value = true;
|
|
|
+ modalType.value = "add";
|
|
|
+ formData.data = {
|
|
|
+ definition: "2",
|
|
|
+ fileList: [],
|
|
|
+ };
|
|
|
+ if (currencyData.value && currencyData.value.length > 0) {
|
|
|
+ formData.data.currency = currencyData.value[0].dictKey;
|
|
|
+ formData.data.costCurrency = currencyData.value[0].dictKey;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const submitForm = () => {
|
|
|
+ formDom.value.handleSubmit((valid) => {
|
|
|
+ submitLoading.value = true;
|
|
|
+ proxy.post("/shopInfo/" + modalType.value, formData.data).then(
|
|
|
+ (res) => {
|
|
|
+ proxy.msgTip("操作成功", 1);
|
|
|
+ dialogVisible.value = false;
|
|
|
+ submitLoading.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ submitLoading.value = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const getDtl = (row) => {
|
|
|
+ modalType.value = "edit";
|
|
|
+ proxy.post("/shopInfo/detail", { id: row.id }).then((res) => {
|
|
|
+ formData.data = res;
|
|
|
+ dialogVisible.value = true;
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+getList();
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+::v-deep(.el-progress__text) {
|
|
|
+ font-size: 14px !important;
|
|
|
+}
|
|
|
+.content {
|
|
|
+ padding: 20px;
|
|
|
+}
|
|
|
+</style>
|