| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <!-- 钻石搜索-单颗彩钻 -->
- <template>
- <app-view>
- <template #header>
- <el-form ref="formRef" label-width="80px" :rules="formRules">
- <el-form-item label="形状">
- <app-multiple :data-list="enums.shapeTypeList" v-model="formData.zsshapetype" checkbox />
- </el-form-item>
- <el-form-item label="颜色">
- <app-multiple :data-list="enums.colorTypeList" v-model="formData.zscolortype" checkbox />
- </el-form-item>
- <el-form-item label="净度">
- <app-multiple :data-list="enums.clarityTypeList" v-model="formData.zsclaritytype" checkbox />
- </el-form-item>
- <el-form-item label="对称">
- <app-multiple :data-list="enums.symmetryTypeList" v-model="formData.zssymmetrytype" checkbox />
- </el-form-item>
- <el-form-item label="抛光">
- <app-multiple :data-list="enums.polishTypeList" v-model="formData.zspolishtype" checkbox />
- </el-form-item>
- <el-form-item label="荧光">
- <app-multiple :data-list="enums.fluorescenceTypeList" v-model="formData.zsfluorescencetype"
- checkbox />
- </el-form-item>
- <!-- <el-form-item label="仓库">
- <el-select v-model="formData.warehouseid" clearable>
- <el-option :label="item.warehousename" :value="item.autoid"
- v-for="(item, index) in warehouseList" :key="index" />
- </el-select>
- </el-form-item> -->
- <el-form-item label="货币">
- <app-multiple :data-list="enums.currencyTypeList" v-model="formData.zscurrencytype" checkbox />
- </el-form-item>
- <el-form-item label="证书">
- <app-multiple :data-list="enums.certTypeList" v-model="formData.zscerttype" checkbox />
- </el-form-item>
- <el-form-item label="克拉重量" prop="weight">
- <div class="el-form-item--col">
- <el-input-number placeholder="从" v-model="formData.weight1" :precision="2" :controls="false" />
- <span>-</span>
- <el-input-number placeholder="至" v-model="formData.weight2" :precision="2" :controls="false" />
- </div>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" :loading="loading" @click="onSearch">搜索</el-button>
- <el-button :disabled="loading" @click="onReset">重置</el-button>
- </el-form-item>
- </el-form>
- </template>
- <app-table :data="dataList" v-model:columns="columns" :show-header="false" :loading="loading">
- <!-- 价格 -->
- <template #price="{ row }">
- {{ row.zscurrencytypedisplayunit + formatDecimal(row.price) }}
- </template>
- <!-- 克拉单价 -->
- <template #fixedprice="{ row }">
- {{ row.zscurrencytypedisplayunit + formatDecimal(row.fixedprice) }}
- </template>
- <!-- 操作 -->
- <template #operate="{ row }">
- <app-auth-operation :menus="handleTableButtons(row)" :options="{ selectedRow: row }"
- @closed="getSellOrderList" />
- </template>
- <template #footer>
- <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
- @change="getSellOrderList" />
- </template>
- </app-table>
- </app-view>
- </template>
- <script lang="ts" setup>
- import { ref } from 'vue'
- import type { FormInstance, FormRules } from 'element-plus'
- import { formatDecimal } from '@/filters'
- import { useLoginStore, useFavoriteStore } from '@/stores'
- import { useSearch } from '@/business/search'
- import { Category } from '@/constants/diamond'
- import AppMultiple from '@pc/components/base/multiple/index.vue'
- import AppTable from '@pc/components/base/table/index.vue'
- import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
- import AppPagination from '@pc/components/base/pagination/index.vue'
- const { getUserId } = useLoginStore()
- const { hasFavorite } = useFavoriteStore()
- const { loading, dataList, columns, total, pageIndex, pageSize, formData, enums, getSellOrderList, onSearch, onReset } = useSearch(Category.Fancy)
- const formRef = ref<FormInstance>()
- const formRules: FormRules = {
- weight: [{
- validator: (rule, value, callback) => {
- const { weight1 = 0, weight2 = 0 } = formData.value
- if (weight1 && weight2) {
- if (weight1 > weight2) {
- callback(new Error('克拉重量应该从小到大'))
- } else {
- callback()
- }
- } else {
- if ((!weight1 || !weight2) && (weight1 || weight2)) {
- callback(new Error('克拉重量不能小于 0'))
- } else {
- callback()
- }
- }
- }
- }],
- }
- // 未收藏的卖委托有收藏按钮
- const handleTableButtons = (row: Ermcp.SellOrderRsp) => {
- if (hasFavorite(row.goodsno) || row.userid === getUserId()) {
- return ['details']
- }
- return ['details', 'favorite']
- }
- getSellOrderList()
- </script>
|