|
@@ -0,0 +1,327 @@
|
|
|
+<template>
|
|
|
+ <div class="pageIndexClass">
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
|
|
|
+ :selectConfig="selectConfig" :table-events="{
|
|
|
+ //element talbe事件都能传
|
|
|
+ }" :action-list="[
|
|
|
+ {
|
|
|
+ text: '添加退货',
|
|
|
+ disabled: false,
|
|
|
+ action: () => clickAdd(),
|
|
|
+ },
|
|
|
+ ]" @get-list="getList">
|
|
|
+ </byTable>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog title="添加退货" v-model="dialogVisible" width="70%" destroy-on-close>
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
|
|
|
+ <template #btn>
|
|
|
+ <div style="width:100%">
|
|
|
+ <el-button type="primary" @click="openMaterial = true" plain>选择订单</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #details>
|
|
|
+ <div style="width:100%">
|
|
|
+ <el-table :data="formData.data.claimContractList">
|
|
|
+ <el-table-column prop="contractCode" label="产品编码" width="140" />
|
|
|
+ <el-table-column prop="sumContractNotClaimMoney" label="产品名称" width="100" />
|
|
|
+ <el-table-column prop="sumContractNotClaimMoney" label="尺寸" width="100" />
|
|
|
+ <el-table-column prop="sumContractNotClaimMoney" label="采购数量" width="100" />
|
|
|
+ <el-table-column prop="contractMoney" label="退货数量" min-width="150">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <el-form-item :prop="'claimContractList.' + $index + '.contractMoney'" :rules="rules.contractMoney" :inline-message="true">
|
|
|
+ <el-input v-model="row.contractMoney" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="contractMoney" label="退货原因" min-width="150">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <el-form-item :prop="'claimContractList.' + $index + '.contractMoney'" :rules="rules.contractMoney" :inline-message="true">
|
|
|
+ <el-input v-model="row.contractMoney" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </byForm>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="dialogVisible = false" size="defualt" v-debounce>取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm()" size="defualt" v-debounce>
|
|
|
+ 确 定
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog v-model="openMaterial" title="选择采购订单" width="80%" append-to-body>
|
|
|
+ <SelectPurchased @handleSelect="handleSelect"></SelectPurchased>
|
|
|
+ <!-- <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="openMaterial = false">取消</el-button>
|
|
|
+ </span>
|
|
|
+ </template> -->
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import byTable from "@/components/byTable/index";
|
|
|
+import byForm from "@/components/byForm/index";
|
|
|
+import SelectPurchased from "@/views/EHSD/procurement/purchasedEHSD/selectPurchased.vue";
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+const loading = ref(false);
|
|
|
+const submitLoading = ref(false);
|
|
|
+const sourceList = ref({
|
|
|
+ data: [],
|
|
|
+ pagination: {
|
|
|
+ total: 3,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ keyword: "",
|
|
|
+ },
|
|
|
+});
|
|
|
+const openMaterial = ref(false);
|
|
|
+const dialogVisible = ref(false);
|
|
|
+const openFollow = ref(false);
|
|
|
+const rules = ref({
|
|
|
+ productSn: [{ required: true, message: "请输入产品Sn", trigger: "blur" }],
|
|
|
+ type: [{ required: true, message: "请选择售后类型", trigger: "change" }],
|
|
|
+ remark: [{ required: true, message: "请输入售后说明", trigger: "blur" }],
|
|
|
+ contactName: [
|
|
|
+ { required: true, message: "请输入客户联系人", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ contactInfo: [
|
|
|
+ { required: true, message: "请输入客户联系方式", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ afterSalesPersonId: [
|
|
|
+ { required: true, message: "请选择售后人员", trigger: "change" },
|
|
|
+ ],
|
|
|
+ quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
|
|
|
+});
|
|
|
+const userList = ref([]);
|
|
|
+const afterSalesType = computed(
|
|
|
+ () => proxy.useUserStore().allDict["after_sales_type"]
|
|
|
+);
|
|
|
+const selectConfig = computed(() => [
|
|
|
+ // {
|
|
|
+ // label: "售后类型",
|
|
|
+ // prop: "type",
|
|
|
+ // data: afterSalesType.value,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label: "售后状态",
|
|
|
+ // prop: "status",
|
|
|
+ // data: [
|
|
|
+ // {
|
|
|
+ // label: "进行中",
|
|
|
+ // value: 0,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label: "完成",
|
|
|
+ // value: 1,
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
+]);
|
|
|
+const config = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "售后编码",
|
|
|
+ prop: "code",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "产品Sn",
|
|
|
+ prop: "productSn",
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "产品名称",
|
|
|
+ prop: "productName",
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "规格型号",
|
|
|
+ prop: "productSpec",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "售后金额",
|
|
|
+ prop: "amount",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "售后状态",
|
|
|
+ prop: "status",
|
|
|
+ },
|
|
|
+ render(status) {
|
|
|
+ return status == "0" ? "进行中" : "完成";
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "操作",
|
|
|
+ width: "200",
|
|
|
+ align: "center",
|
|
|
+ fixed: "right",
|
|
|
+ },
|
|
|
+ renderHTML(row) {
|
|
|
+ return [];
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+const formData = reactive({
|
|
|
+ data: {
|
|
|
+ afterSalesDetailList: [],
|
|
|
+ },
|
|
|
+ followData: {},
|
|
|
+ detailData: {},
|
|
|
+});
|
|
|
+const formOption = reactive({
|
|
|
+ inline: true,
|
|
|
+ labelWidth: 110,
|
|
|
+ itemWidth: 100,
|
|
|
+ rules: [],
|
|
|
+});
|
|
|
+const formConfig = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "订单信息",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "btn",
|
|
|
+ label: " ",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "code",
|
|
|
+ label: "订单号",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "supplyName",
|
|
|
+ label: "供应商",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "退货明细",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "details",
|
|
|
+ label: " ",
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+
|
|
|
+const formDom = ref(null);
|
|
|
+
|
|
|
+const getList = (req) => {
|
|
|
+ sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
+ loading.value = true;
|
|
|
+ proxy
|
|
|
+ .post("/sale/accountRunningWater/page", sourceList.value.pagination)
|
|
|
+ .then((res) => {
|
|
|
+ sourceList.value.data = res.rows;
|
|
|
+ sourceList.value.pagination.total = res.total;
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false;
|
|
|
+ }, 200);
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const submitForm = () => {
|
|
|
+ formDom.value.handleSubmit(() => {
|
|
|
+ submitLoading.value = true;
|
|
|
+ proxy.post("/afterSalesRecord/add", formData.data).then(
|
|
|
+ (res) => {
|
|
|
+ ElMessage({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ dialogVisible.value = false;
|
|
|
+ submitLoading.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ submitLoading.value = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const getDict = () => {
|
|
|
+ proxy
|
|
|
+ .get("/tenantUser/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10000,
|
|
|
+ companyId: proxy.useUserStore().user.companyId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ userList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.nickName,
|
|
|
+ value: item.userId,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+getDict();
|
|
|
+getList();
|
|
|
+
|
|
|
+const clickAdd = (type) => {
|
|
|
+ // formData.data = {
|
|
|
+ // claimContractList: [],
|
|
|
+ // claimContractList: [],
|
|
|
+ // };
|
|
|
+ // dialogVisible.value = true;
|
|
|
+
|
|
|
+ proxy.$router.replace({
|
|
|
+ path: "/platform_manage/process/processApproval",
|
|
|
+ query: {
|
|
|
+ flowKey: "return_good_flow",
|
|
|
+ flowName: "采购退货审批流程",
|
|
|
+ random: proxy.random(),
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const handleSelect = (row) => {
|
|
|
+ console.log(row, "ssa");
|
|
|
+ formData.data = {
|
|
|
+ code: row.code,
|
|
|
+ supplyName: row.supplyName,
|
|
|
+ id: row.id,
|
|
|
+ };
|
|
|
+ openMaterial.value = false;
|
|
|
+};
|
|
|
+
|
|
|
+const handleRemove = (index, type) => {
|
|
|
+ formData.followData.afterSalesMaterialsList.splice(index, 1);
|
|
|
+ return ElMessage({
|
|
|
+ message: "删除成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+</style>
|