瀏覽代碼

已采购高级检索

cz 1 年之前
父節點
當前提交
4adffd7694

+ 66 - 56
src/views/WDLY/outInBound/waitOutBound/index.vue

@@ -313,8 +313,10 @@ const formOption = reactive({
 const byform = ref(null);
 let formConfig = ref([]);
 const businessType = [
+  { label: "生产任务出库", value: "7" },
   { label: "销售订单出库", value: "6" },
   { label: "京东订单出库", value: "5" },
+  { label: "采购退货出库", value: "4" },
 ];
 const configData = [
   [
@@ -451,75 +453,83 @@ const openModal = () => {
 
 const submitForm = () => {
   byform.value.handleSubmit((valid) => {
-    if (modalType.value === "add") {
-      const list = formData.data.jdOrderDetailsList;
-      for (let i = 0; i < list.length; i++) {
-        const e = list[i];
-        if (!(e.quantity > 0)) {
+    if (submitType.value == 4) {
+      console.log("aa");
+    } else if (submitType.value == 5 || submitType.value == 6) {
+      if (modalType.value === "add") {
+        const list = formData.data.jdOrderDetailsList;
+        for (let i = 0; i < list.length; i++) {
+          const e = list[i];
+          if (!(e.quantity > 0)) {
+            return ElMessage({
+              message: "调仓数量不能为0!",
+              type: "info",
+            });
+          }
+          if (e.quantity > e.waitQuantity) {
+            return ElMessage({
+              message: "调仓数量不能大于待出库数量!",
+              type: "info",
+            });
+          }
+        }
+        submitLoading.value = true;
+        proxy.post("/jdOrder/outbound", formData.data).then(
+          (res) => {
+            ElMessage({
+              message: "操作成功",
+              type: "success",
+            });
+            dialogVisible.value = false;
+            submitLoading.value = false;
+            getList();
+          },
+          (err) => (submitLoading.value = false)
+        );
+      } else if (modalType.value === "edit") {
+        const data = {
+          id: formData.data.id,
+          businessType: formData.data.businessType,
+          warehouseId: formData.data.warehouseId,
+          quantity: formData.data.quantity,
+          waitQuantity: formData.data.waitQuantity,
+        };
+        if (!(data.quantity > 0)) {
           return ElMessage({
-            message: "调仓数量不能为0!",
+            message: "出库数量不能为0!",
             type: "info",
           });
         }
-        if (e.quantity > e.waitQuantity) {
+        if (data.quantity > data.waitQuantity) {
           return ElMessage({
-            message: "调仓数量不能大于待出库数量!",
+            message: "出库数量不能大于待出库数量!",
             type: "info",
           });
         }
+        submitLoading.value = true;
+        proxy.post("/stockWaitDetails/add", data).then(
+          (res) => {
+            ElMessage({
+              message: "操作成功",
+              type: "success",
+            });
+            dialogVisible.value = false;
+            submitLoading.value = false;
+            getList();
+          },
+          (err) => (submitLoading.value = false)
+        );
       }
-      submitLoading.value = true;
-      proxy.post("/jdOrder/outbound", formData.data).then(
-        (res) => {
-          ElMessage({
-            message: "操作成功",
-            type: "success",
-          });
-          dialogVisible.value = false;
-          submitLoading.value = false;
-          getList();
-        },
-        (err) => (submitLoading.value = false)
-      );
-    } else if (modalType.value === "edit") {
-      const data = {
-        id: formData.data.id,
-        businessType: formData.data.businessType,
-        warehouseId: formData.data.warehouseId,
-        quantity: formData.data.quantity,
-        waitQuantity: formData.data.waitQuantity,
-      };
-      if (!(data.quantity > 0)) {
-        return ElMessage({
-          message: "出库数量不能为0!",
-          type: "info",
-        });
-      }
-      if (data.quantity > data.waitQuantity) {
-        return ElMessage({
-          message: "出库数量不能大于待出库数量!",
-          type: "info",
-        });
-      }
-      submitLoading.value = true;
-      proxy.post("/stockWaitDetails/add", data).then(
-        (res) => {
-          ElMessage({
-            message: "操作成功",
-            type: "success",
-          });
-          dialogVisible.value = false;
-          submitLoading.value = false;
-          getList();
-        },
-        (err) => (submitLoading.value = false)
-      );
     }
   });
 };
-
+const submitType = ref("-1");
 const outBound = (row) => {
-  if (row.businessType == 5) {
+  submitType.value = row.businessType;
+  if (row.businessType == 4) {
+    modalType.value = "other";
+    dialogVisible.value = true;
+  } else if (row.businessType == 5) {
     modalType.value = "add";
     formConfig.value = configData[1];
     proxy.post("/jdOrder/detail", { id: row.businessId }).then((res) => {

+ 240 - 15
src/views/WDLY/purchaseManage/alreadyPurchase/index.vue

@@ -12,7 +12,12 @@
         :table-events="{
           //element talbe事件都能传
         }"
-        :action-list="[]"
+        :action-list="[
+          {
+            text: '高级检索',
+            action: () => (dialogVisibleThree = true),
+          },
+        ]"
         @get-list="getList"
       >
         <template #contractCode="{ item }">
@@ -25,16 +30,12 @@
         </template>
 
         <template #arrivalStatus="{ item }">
-          <!-- v-if="item.arrivalStatus != '0'" -->
           <div
             style="cursor: pointer; color: #409eff"
             @click="handleClickArrivalStatus(item)"
           >
             {{ dictValueLabel(item.arrivalStatus, arrivalStatus) }}
           </div>
-          <!-- <div v-else>
-            {{ dictValueLabel(item.arrivalStatus, arrivalStatus) }}
-          </div> -->
         </template>
 
         <template #btn="{ item }">
@@ -469,6 +470,168 @@
         </el-button>
       </template>
     </el-dialog>
+
+    <el-dialog
+      :title="'高级检索'"
+      v-model="dialogVisibleThree"
+      width="500px"
+      destroy-on-close
+    >
+      <el-form
+        :model="sourceList.pagination"
+        label-width="100px"
+        label-position="top"
+      >
+        <el-form-item label="采购单号">
+          <el-input
+            v-model="sourceList.pagination.contractCode"
+            placeholder="请输入"
+          />
+        </el-form-item>
+        <el-form-item label="供应商">
+          <el-select
+            v-model="sourceList.pagination.supplyId"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in supplierData"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="收货仓库">
+          <el-select
+            v-model="sourceList.pagination.receiptWarehouseId"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in warehouseList"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="采购金额">
+          <el-row>
+            <el-col :span="8">
+              <el-input-number
+                v-model="sourceList.pagination.startAmount"
+                placeholder="请输入"
+                :controls="false"
+                :min="1"
+                :precision="2"
+                style="width: 100%"
+              />
+            </el-col>
+            <el-col :span="2" style="text-align: center"> 到 </el-col>
+            <el-col :span="8">
+              <el-input-number
+                v-model="sourceList.pagination.endAmount"
+                placeholder="请输入"
+                :controls="false"
+                :min="1"
+                :precision="2"
+                style="width: 100%"
+              />
+            </el-col>
+          </el-row>
+        </el-form-item>
+        <el-form-item label="采购人">
+          <el-select
+            v-model="sourceList.pagination.purchaseUserId"
+            placeholder="请选择"
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in userList"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="采购时间">
+          <!-- <el-date-picker
+            v-model="sourceList.pagination.arr"
+            type="datetimerange"
+            range-separator="到"
+            start-placeholder="请选择"
+            end-placeholder="请选择"
+          /> -->
+          <el-date-picker
+            v-model="sourceList.pagination.arr"
+            type="daterange"
+            range-separator="到"
+            start-placeholder="请选择"
+            end-placeholder="请选择"
+            value-format="YYYY-MM-DD HH:mm:ss"
+          />
+        </el-form-item>
+        <el-row>
+          <el-col :span="7">
+            <el-form-item label="采购状态">
+              <el-select
+                v-model="sourceList.pagination.purchaseStatus"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in statusData"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="1"></el-col>
+          <el-col :span="7">
+            <el-form-item label="到货状态">
+              <el-select
+                v-model="sourceList.pagination.arrivalStatus"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in arrivalStatus"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="1"></el-col>
+          <el-col :span="7">
+            <el-form-item label="付款状态">
+              <el-select
+                v-model="sourceList.pagination.payStatus"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in paymentStatus"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <template #footer>
+        <el-button @click="handleReset" size="large">重置</el-button>
+        <el-button @click="handleQuery" type="primary" size="large"
+          >搜索</el-button
+        >
+      </template>
+    </el-dialog>
   </div>
 </template>
   
@@ -478,6 +641,7 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { computed } from "vue";
 import selectCity from "@/components/selectCity/index.vue";
+import useUserStore from "@/store/modules/user";
 
 const loading = ref(false);
 const loadingTwo = ref(false);
@@ -488,11 +652,13 @@ const sourceList = ref({
     total: 3,
     pageNum: 1,
     pageSize: 10,
+    arr: [],
   },
 });
 const dialogVisible = ref(false);
 const dialogVisibleOne = ref(false);
 const dialogVisibleTwo = ref(false);
+const dialogVisibleThree = ref(false);
 const modalType = ref("add");
 let rules = ref({
   deliverGoodsId: [
@@ -552,6 +718,21 @@ const statusData = ref([
     value: "88",
   },
 ]);
+const paymentStatus = ref([
+  {
+    label: "未付款",
+    value: "0",
+  },
+  {
+    label: "部分付款",
+    value: "10",
+  },
+  {
+    label: "已付款",
+    value: "20",
+  },
+]);
+
 const selectConfig = reactive([
   {
     label: "采购状态",
@@ -1015,16 +1196,6 @@ const handleEdit = (row, status) => {
   });
 };
 
-// 获取供应商数据
-const supplierData = ref([]);
-const getSupplierList = async (req) => {
-  proxy
-    .post("/supplierInfo/page", { pageNum: 1, pageSize: 9999 })
-    .then((res) => {
-      supplierData.value = res.rows;
-    });
-};
-
 const logisticsData = ref([]);
 const getLogisticsData = (row) => {
   proxy.post("/companyInfo/list", { pageNum: 1, pageSize: 999 }).then((res) => {
@@ -1178,6 +1349,9 @@ const getCityData = (id, type, flag) => {
   });
 };
 const productUnit = ref([]);
+const supplierData = ref([]);
+const warehouseList = ref([]);
+const userList = ref([]);
 const getDict = () => {
   proxy.getDictOne(["unit"]).then((res) => {
     productUnit.value = res["unit"].map((x) => ({
@@ -1185,11 +1359,62 @@ const getDict = () => {
       value: x.dictKey,
     }));
   });
+  proxy
+    .post("/supplierInfo/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      supplierData.value = res.rows;
+    });
+  proxy.post("/warehouse/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      warehouseList.value = res.rows.map((item) => {
+        return {
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
 };
 getCityData("0");
 getList();
 getLogisticsData();
 getDict();
+
+const handleQuery = () => {
+  if (
+    sourceList.value.pagination.arr &&
+    sourceList.value.pagination.arr.length > 1
+  ) {
+    sourceList.value.pagination.purchaseStartTime =
+      sourceList.value.pagination.arr[0];
+    sourceList.value.pagination.purchaseEndTime =
+      sourceList.value.pagination.arr[1];
+  }
+  dialogVisibleThree.value = false;
+  getList();
+};
+const handleReset = () => {
+  sourceList.value.pagination = {
+    pageNum: sourceList.value.pagination.pageNum,
+    pageSize: sourceList.value.pagination.pageSize,
+    arr: [],
+  };
+  handleQuery();
+};
 </script>
   
 <style lang="scss" scoped>

+ 544 - 0
src/views/WDLY/purchaseManage/payment/index.vue

@@ -0,0 +1,544 @@
+<template>
+  <div class="tenant">
+    <!-- <Banner /> -->
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{
+          //element talbe事件都能传
+          select: selectRow,
+        }"
+        :action-list="[
+          {
+            text: '合并付款',
+            disabled: selectData.length === 0,
+            action: () => start(20),
+          },
+        ]"
+        @get-list="getList"
+      >
+        <template #contractCode="{ item }">
+          <div
+            style="cursor: pointer; color: #409eff"
+            @click="handleClickContractCode(item)"
+          >
+            {{ item.contractCode }}
+          </div>
+        </template>
+
+        <template #paymentStatus="{ item }">
+          <div
+            style="cursor: pointer; color: #409eff"
+            @click="handleClickArrivalStatus(item)"
+          >
+            {{ dictValueLabel(item.arrivalStatus, arrivalStatus) }}
+          </div>
+        </template>
+
+        <template #btn="{ item }">
+          <div>
+            <el-button type="primary" link @click="start(10)">付款</el-button>
+
+            <el-button type="primary" link @click="handleEdit(item, 88)"
+              >结束</el-button
+            >
+            <el-button type="primary" link @click="handleEdit(item, 99)"
+              >清空</el-button
+            >
+          </div>
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      :title="modalType == 'add' ? '添加售后记录' : '添加跟进记录'"
+      v-model="dialogVisible"
+      width="800"
+      v-loading="submitLoading"
+      destroy-on-close
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #details>
+          <div style="width: 100%">
+            <el-table :data="formData.data.afterSaleDetailList">
+              <el-table-column prop="productCode" label="采购单号" />
+              <el-table-column prop="productName" label="采购金额" />
+              <el-table-column prop="productSpec" label="已付款金额" />
+              <el-table-column prop="quantity" label="付款金额" min-width="150">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'afterSaleDetailList.' + $index + '.quantity'"
+                    :rules="rules.quantity"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      v-model="row.quantity"
+                      :precision="2"
+                      :controls="false"
+                      :min="0"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog
+      v-model="dialogVisibleOne"
+      title="付款记录"
+      width="500"
+      append-to-body
+      destroy-on-close
+    >
+      <div>
+        <el-timeline :reverse="false">
+          <el-timeline-item
+            placement="top"
+            v-for="(activity, index) in activities"
+            :key="index"
+            :timestamp="activity.handleTime"
+          >
+            <div>
+              跟进人:{{ activity.handleUserName }}
+              <span
+                >({{
+                  dictValueLabel(activity.status, afterSalesStatus)
+                }})</span
+              >
+            </div>
+            <div style="margin-top: 5px">跟进记录: {{ activity.remark }}</div>
+          </el-timeline-item>
+        </el-timeline>
+      </div>
+      <template #footer>
+        <el-button @click="dialogVisibleOne = false">关闭</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import FileUpload from "@/components/FileUpload/index";
+import { computed, defineComponent, ref } from "vue";
+import { getToken } from "@/utils/auth";
+import SelectProduct from "@/components/WDLY/product/SelectProduct";
+import useUserStore from "@/store/modules/user";
+
+const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
+const headers = ref({ Authorization: "Bearer " + getToken() });
+const uploadData = ref({});
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    type: "",
+    keyword: "",
+  },
+});
+let dialogVisible = ref(false);
+let dialogVisibleOne = ref(false);
+let activities = ref([]);
+let modalType = ref("add");
+
+let rules = ref({
+  detailedAddress: [
+    { required: true, message: "请输入详细地址", trigger: "blur" },
+  ],
+  handleUserId: [
+    { required: true, message: "请选择跟进人", trigger: "change" },
+  ],
+});
+const { proxy } = getCurrentInstance();
+const afterSalesType = ref([]);
+const afterSalesStatus = ref([]);
+const selectConfig = computed(() => [
+  {
+    label: "到货状态",
+    prop: "type",
+    data: afterSalesType.value,
+  },
+  {
+    label: "付款状态",
+    prop: "status",
+    data: afterSalesStatus.value,
+  },
+]);
+const config = computed(() => {
+  return [
+    {
+      type: "selection",
+      attrs: {
+        checkAtt: "isCheck",
+      },
+    },
+    {
+      attrs: {
+        label: "采购单号",
+        slot: "contractCode",
+      },
+      // render(type) {
+      //   return proxy.dictValueLabel(type, afterSalesType.value);
+      // },
+    },
+    {
+      attrs: {
+        label: "供应商",
+        prop: "customerName",
+      },
+    },
+    {
+      attrs: {
+        label: "收获仓库",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "采购金额",
+        prop: "address",
+      },
+      render() {
+        return proxy.moneyFormat(20, 2);
+      },
+    },
+    {
+      attrs: {
+        label: "已付款金额",
+        prop: "cause",
+      },
+      render() {
+        return proxy.moneyFormat(20, 2);
+      },
+    },
+    {
+      attrs: {
+        label: "采购人",
+        prop: "createTime",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "采购时间",
+        prop: "createTime",
+        width: 155,
+      },
+    },
+    {
+      attrs: {
+        label: "到货状态",
+        prop: "createTime",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "付款状态",
+        slot: "paymentStatus",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        slot: "btn",
+        width: "180",
+        align: "center",
+        fixed: "right",
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {
+    type: "1",
+  },
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+
+let formConfig = computed(() => [
+  {
+    type: "input",
+    prop: "type",
+    label: "供应商",
+    disabled: true,
+  },
+  {
+    type: "date",
+    itemType: "datetime",
+    prop: "type",
+    label: "付款时间",
+    format: "YYYY-MM-DD HH:mm:ss",
+  },
+  {
+    type: "number",
+    prop: "aa",
+    label: "付款金额",
+    precision: 2,
+    min: 0,
+    controls: false,
+  },
+  {
+    type: "title",
+    title: "付款明细",
+  },
+  {
+    type: "slot",
+    slotName: "details",
+    label: "",
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/afterSaleRecord/page", sourceList.value.pagination)
+    .then((message) => {
+      console.log(message);
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+
+const rowData = ref({});
+
+const submitForm = () => {
+  byform.value.handleSubmit((valid) => {
+    const list = formData.data.afterSaleDetailList;
+    if (!list.length > 0)
+      return ElMessage({
+        message: `请关联商品!`,
+        type: "info",
+      });
+    for (let i = 0; i < list.length; i++) {
+      const e = list[i];
+      if (e.quantity == 0) {
+        return ElMessage({
+          message: `数量不能为0!`,
+          type: "info",
+        });
+      }
+    }
+    proxy.post("ada", formData.data).then(
+      (res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        setTimeout(() => {
+          submitLoading.value = false;
+        }, 5000);
+        getList();
+      },
+      (err) => {
+        submitLoading.value = false;
+      }
+    );
+  });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  proxy.post("/supplierInfo/detail", { id: row.id }).then((res) => {
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [row.id] })
+      .then((fileObj) => {
+        fileList.value = fileObj[row.id] || [];
+        fileListCopy.value = [...fileList.value];
+        getCityData(res.countryId, "20");
+        getCityData(res.provinceId, "30");
+        res.type = res.type + "";
+        res.victoriatouristJson = JSON.parse(res.victoriatouristJson);
+        formData.data = res;
+        dialogVisible.value = true;
+      });
+  });
+};
+
+const handleClickFile = (row) => {
+  ElMessage({
+    message: "数据请求中,请稍后!",
+    type: "success",
+  });
+  let id = row.id;
+  proxy.post("/fileInfo/getList", { businessIdList: [id] }).then((res) => {
+    const file = res[id][0];
+    window.open(file.fileUrl, "_blank");
+  });
+};
+
+const handleClose = (index) => {
+  if (fileListCopy.value.length === 1) {
+    return ElMessage({
+      message: "最后一个附件啦!",
+      type: "info",
+    });
+  }
+  fileList.value.splice(index, 1);
+  fileListCopy.value.splice(index, 1);
+};
+
+const countryData = ref([]);
+const provinceData = ref([]);
+const cityData = ref([]);
+
+const getCityData = (id, type, flag) => {
+  proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
+    if (type === "20") {
+      provinceData.value = res;
+      if (flag) {
+        formData.data.provinceId = "";
+        formData.data.provinceName = "";
+        formData.data.cityId = "";
+        formData.data.cityName = "";
+      }
+    } else if (type === "30") {
+      cityData.value = res;
+      if (flag) {
+        formData.data.cityId = "";
+        formData.data.cityName = "";
+      }
+    } else {
+      countryData.value = res;
+    }
+  });
+};
+const handleSelect = (row) => {
+  const flag = formData.data.afterSaleDetailList.some(
+    (x) => x.productId === row.id
+  );
+  if (flag)
+    return ElMessage({
+      message: "该商品已选择",
+      type: "info",
+    });
+  formData.data.afterSaleDetailList.push({
+    productName: row.name,
+    productCode: row.code,
+    productSpec: row.spec,
+    productId: row.id,
+    quantity: null,
+    remark: "",
+  });
+  return ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+};
+
+const handleRemove = (index) => {
+  formData.data.afterSaleDetailList.splice(index, 1);
+  return ElMessage({
+    message: "删除成功",
+    type: "success",
+  });
+};
+
+const getDict = () => {
+  proxy.getDict(["after_sale_type", "after_sale_status"]).then((res) => {
+    afterSalesType.value = res["after_sale_type"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+    afterSalesStatus.value = res["after_sale_status"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+
+const selectData = ref([]);
+const selectDataOne = ref([]);
+const selectRow = (data) => {
+  selectData.value = data;
+};
+watch(selectData, (newVal, oldVal) => {
+  if (newVal.length == 0) {
+    sourceList.value.data.forEach((x) => {
+      if (x.status <= 30) {
+        x.isCheck = true;
+      } else {
+        x.isCheck = false;
+      }
+    });
+  } else if (newVal.length == 1) {
+    const current = newVal[0];
+    sourceList.value.data.forEach((x) => {
+      if (x.receiptWarehouseId !== current.receiptWarehouseId) {
+        x.isCheck = false;
+      }
+    });
+  }
+});
+
+const start = (type, data) => {
+  modalType.value = "add";
+  let ids = [];
+  let row = {};
+  if (type === 10) {
+    selectDataOne.value = [data];
+    // row = selectDataOne.value[0];
+    // ids = selectDataOne.value.map((x) => x.id).join();
+  } else if (type === 20) {
+    // ids = selectData.value.map((x) => x.id).join();
+    // row = selectData.value[0];
+  }
+  dialogVisible.value = true;
+};
+
+getCityData("0");
+getList();
+getDict();
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+:deep(.el-table__header-wrapper .el-checkbox) {
+  display: none;
+}
+</style>