|
|
@@ -3,6 +3,7 @@ import { v4 } from 'uuid'
|
|
|
import { ClientType } from '@/constants/enum/client'
|
|
|
import { useDataTable } from '@/hooks/datatable'
|
|
|
import { Market } from '@/constants/enum/market'
|
|
|
+import { queryDiamondList } from '@/services/api/goods'
|
|
|
import { zsBuyOrderListing, zsSellOrderListing, queryBuyOrder, querySellOrder, queryMyBuyOrder, queryMySellOrder } from '@/services/api/order'
|
|
|
import { sessionData } from '@/stores'
|
|
|
import {
|
|
|
@@ -60,11 +61,13 @@ export function useBuyOrder() {
|
|
|
{
|
|
|
prop: 'validtime',
|
|
|
label: '有效日期',
|
|
|
+ width: 180,
|
|
|
show: true,
|
|
|
},
|
|
|
{
|
|
|
prop: 'ordertime',
|
|
|
label: '委托时间',
|
|
|
+ width: 180,
|
|
|
show: true,
|
|
|
},
|
|
|
{
|
|
|
@@ -233,7 +236,7 @@ export function useSellOrder() {
|
|
|
show: true,
|
|
|
},
|
|
|
{
|
|
|
- prop: 'zscategory',
|
|
|
+ prop: 'zscategorydisplay',
|
|
|
label: '商品分类',
|
|
|
show: true,
|
|
|
},
|
|
|
@@ -265,6 +268,7 @@ export function useSellOrder() {
|
|
|
{
|
|
|
prop: 'ordertime',
|
|
|
label: '委托时间',
|
|
|
+ width: 180,
|
|
|
show: true,
|
|
|
},
|
|
|
{
|
|
|
@@ -346,10 +350,12 @@ export function useSellOrder() {
|
|
|
* @returns
|
|
|
*/
|
|
|
export function useSellOrderForm() {
|
|
|
+ const { dataList } = useDataTable<Ermcp.MyWRPositionRsp>()
|
|
|
const { UserID, AccountIDs } = sessionData.getValue('loginInfo')
|
|
|
const loading = shallowRef(false)
|
|
|
- const categoryList = getCategoryList()
|
|
|
+ const categoryList = getCategoryList() // 分类列表
|
|
|
const selectedCategoryId = shallowRef(Category.Diamonds)
|
|
|
+
|
|
|
const formItem = reactive<Proto.ZSSellOrderListingReq>({
|
|
|
Header: {
|
|
|
AccountID: AccountIDs[0],
|
|
|
@@ -370,6 +376,60 @@ export function useSellOrderForm() {
|
|
|
MarketID: Market.GZ,
|
|
|
})
|
|
|
|
|
|
+ const columns = shallowRef<Ermcp.TableColumn[]>([
|
|
|
+ {
|
|
|
+ prop: 'goodsno',
|
|
|
+ label: '商品编号',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'price',
|
|
|
+ label: '总价',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'weight',
|
|
|
+ label: '总重量',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'weightavg',
|
|
|
+ label: '平均单颗重量',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'priceper',
|
|
|
+ label: '克拉单位',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'ftotalqty',
|
|
|
+ label: '库存重量',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'remainqty',
|
|
|
+ label: '剩余重量',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'zsshapetypedisplay',
|
|
|
+ label: '形状',
|
|
|
+ show: true,
|
|
|
+ width: 200,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'zscolortype',
|
|
|
+ label: '颜色',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'zsclaritytype',
|
|
|
+ label: '净度',
|
|
|
+ show: true,
|
|
|
+ }
|
|
|
+ ])
|
|
|
+
|
|
|
const formSubmit = () => {
|
|
|
loading.value = true
|
|
|
return zsSellOrderListing({
|
|
|
@@ -380,9 +440,24 @@ export function useSellOrderForm() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ queryDiamondList({
|
|
|
+ data: {
|
|
|
+ wruserid: UserID,
|
|
|
+ zscategory: Category.Diamonds,
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ dataList.value = res.data.filter((e) => e.ftotalqty - e.ffreezeqty > 0)
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ dataList.value = []
|
|
|
+ },
|
|
|
+ })
|
|
|
+
|
|
|
return {
|
|
|
loading,
|
|
|
formItem,
|
|
|
+ dataList,
|
|
|
+ columns,
|
|
|
categoryList,
|
|
|
selectedCategoryId,
|
|
|
formSubmit,
|
|
|
@@ -404,12 +479,7 @@ export function useSaleOrder() {
|
|
|
show: true,
|
|
|
},
|
|
|
{
|
|
|
- prop: 'buyusername',
|
|
|
- label: '挂牌会员',
|
|
|
- show: true,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'zscategory',
|
|
|
+ prop: 'zscategorydisplay',
|
|
|
label: '商品分类',
|
|
|
show: true,
|
|
|
},
|
|
|
@@ -441,6 +511,7 @@ export function useSaleOrder() {
|
|
|
{
|
|
|
prop: 'ordertime',
|
|
|
label: '委托时间',
|
|
|
+ width: 180,
|
|
|
show: true,
|
|
|
},
|
|
|
{
|
|
|
@@ -526,11 +597,6 @@ export function usePurchaseOrder() {
|
|
|
show: true,
|
|
|
},
|
|
|
{
|
|
|
- prop: 'buyusername',
|
|
|
- label: '会员',
|
|
|
- show: true,
|
|
|
- },
|
|
|
- {
|
|
|
prop: 'zscategorydisplay',
|
|
|
label: '商品分类',
|
|
|
show: true,
|
|
|
@@ -548,11 +614,13 @@ export function usePurchaseOrder() {
|
|
|
{
|
|
|
prop: 'validtime',
|
|
|
label: '有效日期',
|
|
|
+ width: 180,
|
|
|
show: true,
|
|
|
},
|
|
|
{
|
|
|
prop: 'ordertime',
|
|
|
label: '委托时间',
|
|
|
+ width: 180,
|
|
|
show: true,
|
|
|
},
|
|
|
{
|