|
@@ -1,9 +1,10 @@
|
|
|
import { shallowRef, reactive, computed } from 'vue'
|
|
import { shallowRef, reactive, computed } from 'vue'
|
|
|
import { v4 } from 'uuid'
|
|
import { v4 } from 'uuid'
|
|
|
import { useDataTable } from '@/hooks/datatable'
|
|
import { useDataTable } from '@/hooks/datatable'
|
|
|
|
|
+import { getTableColumns } from '@/business/table'
|
|
|
import { formatDecimal } from '@/filters'
|
|
import { formatDecimal } from '@/filters'
|
|
|
-import { ClientType } from '@/constants/enum/client'
|
|
|
|
|
-import { Market } from '@/constants/enum/market'
|
|
|
|
|
|
|
+import { ClientType } from '@/constants/client'
|
|
|
|
|
+import { Market } from '@/constants/market'
|
|
|
import { queryWarehouseInfo } from '@/services/api/warehouse'
|
|
import { queryWarehouseInfo } from '@/services/api/warehouse'
|
|
|
import { addZSGoods, queryDiamondList, queryDiamondDetails } from '@/services/api/goods'
|
|
import { addZSGoods, queryDiamondList, queryDiamondDetails } from '@/services/api/goods'
|
|
|
import { sessionData } from '@/stores'
|
|
import { sessionData } from '@/stores'
|
|
@@ -25,79 +26,32 @@ import {
|
|
|
getFancyColorType1List,
|
|
getFancyColorType1List,
|
|
|
getFancyColorType2List,
|
|
getFancyColorType2List,
|
|
|
getFancyColorType3List,
|
|
getFancyColorType3List,
|
|
|
-} from '@/constants/enum/diamond'
|
|
|
|
|
|
|
+} from '@/constants/diamond'
|
|
|
|
|
|
|
|
// 钻石列表相关
|
|
// 钻石列表相关
|
|
|
export function useDiamond() {
|
|
export function useDiamond() {
|
|
|
const { UserID } = sessionData.getValue('loginInfo')
|
|
const { UserID } = sessionData.getValue('loginInfo')
|
|
|
const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam } = useDataTable<Ermcp.MyWRPositionRsp>()
|
|
const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam } = useDataTable<Ermcp.MyWRPositionRsp>()
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
|
|
+ const columns = getTableColumns('warehousingDiamond')
|
|
|
|
|
|
|
|
- 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,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ selectList.value = [
|
|
|
{
|
|
{
|
|
|
- prop: 'ffreezeqty',
|
|
|
|
|
- label: '冻结重量',
|
|
|
|
|
- show: true,
|
|
|
|
|
|
|
+ label: '商品分类',
|
|
|
|
|
+ key: 'zscategory',
|
|
|
|
|
+ selectedValue: Category.Diamonds,
|
|
|
|
|
+ options: getCategoryList(),
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- prop: 'warehousenamedisplay',
|
|
|
|
|
label: '仓库',
|
|
label: '仓库',
|
|
|
- show: true,
|
|
|
|
|
- width: 180,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'zsshapetypedisplay',
|
|
|
|
|
- label: '形状',
|
|
|
|
|
- show: true,
|
|
|
|
|
- width: 200,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'zscolortype',
|
|
|
|
|
- label: '颜色',
|
|
|
|
|
- show: true,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'zsclaritytype',
|
|
|
|
|
- label: '净度',
|
|
|
|
|
- show: true,
|
|
|
|
|
|
|
+ key: 'warehouseid',
|
|
|
|
|
+ options: [],
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- prop: 'operate',
|
|
|
|
|
- label: '操作',
|
|
|
|
|
- show: true,
|
|
|
|
|
- fixed: 'right',
|
|
|
|
|
- }
|
|
|
|
|
- ])
|
|
|
|
|
|
|
+ ]
|
|
|
|
|
+
|
|
|
|
|
+ inputList.value = [
|
|
|
|
|
+ { label: '商品', keys: ['goodsno'] },
|
|
|
|
|
+ ]
|
|
|
|
|
|
|
|
const getDiamondList = () => {
|
|
const getDiamondList = () => {
|
|
|
const param = getQueryParam()
|
|
const param = getQueryParam()
|
|
@@ -124,24 +78,6 @@ export function useDiamond() {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- selectList.value = [
|
|
|
|
|
- {
|
|
|
|
|
- label: '商品分类',
|
|
|
|
|
- key: 'zscategory',
|
|
|
|
|
- selectedValue: Category.Diamonds,
|
|
|
|
|
- options: getCategoryList(),
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '仓库',
|
|
|
|
|
- key: 'warehouseid',
|
|
|
|
|
- options: [],
|
|
|
|
|
- },
|
|
|
|
|
- ]
|
|
|
|
|
-
|
|
|
|
|
- inputList.value = [
|
|
|
|
|
- { label: '商品', keys: ['goodsno'] },
|
|
|
|
|
- ]
|
|
|
|
|
-
|
|
|
|
|
const [reset, search] = buttonList.value
|
|
const [reset, search] = buttonList.value
|
|
|
reset.onClick = () => {
|
|
reset.onClick = () => {
|
|
|
selectList.value.forEach((e, i) => {
|
|
selectList.value.forEach((e, i) => {
|
|
@@ -188,18 +124,27 @@ export function useDiamond() {
|
|
|
|
|
|
|
|
// 钻石详情相关
|
|
// 钻石详情相关
|
|
|
export function useDiamondDetails(goodsno: string) {
|
|
export function useDiamondDetails(goodsno: string) {
|
|
|
|
|
+ const loading = shallowRef(false)
|
|
|
|
|
+ const details = shallowRef<Ermcp.DiamondDetailsRsp>()
|
|
|
|
|
+
|
|
|
const getDiamondDetails = () => {
|
|
const getDiamondDetails = () => {
|
|
|
|
|
+ loading.value = true
|
|
|
return queryDiamondDetails({
|
|
return queryDiamondDetails({
|
|
|
data: {
|
|
data: {
|
|
|
goodsno,
|
|
goodsno,
|
|
|
},
|
|
},
|
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
- console.log(res.data)
|
|
|
|
|
|
|
+ details.value = res.data
|
|
|
|
|
+ },
|
|
|
|
|
+ complete: () => {
|
|
|
|
|
+ loading.value = false
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
|
|
+ loading,
|
|
|
|
|
+ details,
|
|
|
getDiamondDetails
|
|
getDiamondDetails
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|