dev2 #1
@ -124,6 +124,21 @@
|
||||
@change="change"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="product_state_id">
|
||||
<el-select
|
||||
v-model.trim="queryForm.is_special"
|
||||
clearable
|
||||
:placeholder="__('是否特价商品')"
|
||||
style="width: 100px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in specialOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="false" icon="el-icon-delete" type="primary" @click="clearData">
|
||||
{{ __('清空') }}
|
||||
@ -312,7 +327,7 @@
|
||||
</span>
|
||||
<span v-else>
|
||||
<el-tag :type='({"1001":"success","1002":"info","1000":"warning"})[scope.row.product_state_id]'>
|
||||
{{ ({"1001":"销售中","1002":"仓库中","1000":"违规禁售"})[scope.row.product_state_id] }}
|
||||
{{ ({"1001":"销售中","1002":"仓库中","1000":"违规禁售","1003":"未分配商品"})[scope.row.product_state_id] }}
|
||||
</el-tag>
|
||||
</span>
|
||||
</template>
|
||||
@ -496,6 +511,20 @@ import {
|
||||
value: 1000,
|
||||
label: this.__('违规禁售'),
|
||||
},
|
||||
{
|
||||
value:1003,
|
||||
label:"未分配商品"
|
||||
}
|
||||
],
|
||||
specialOptions:[
|
||||
{
|
||||
value:0,
|
||||
label:"否"
|
||||
},
|
||||
{
|
||||
value:1,
|
||||
label:"是"
|
||||
}
|
||||
],
|
||||
data: [], // 产品规格数据
|
||||
defaultProps: {
|
||||
|
||||
@ -66,6 +66,21 @@
|
||||
style="width: 120px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<tree-select
|
||||
ref="treeSelect"
|
||||
:checked-keys="defaultCheckedKeys"
|
||||
clearable
|
||||
:data="productDataList"
|
||||
:default-props="defaultProps"
|
||||
:height="300"
|
||||
:node-key="nodeKey"
|
||||
size="small"
|
||||
style="width: 120px"
|
||||
:width="220"
|
||||
@change="change"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-search" type="primary" @click="queryData">
|
||||
{{ __('查询') }}
|
||||
@ -273,10 +288,12 @@
|
||||
import { getToken } from '@/utils/token'
|
||||
import excelExeImport from './components/ExcelImport'
|
||||
import {mapGetters} from "vuex";
|
||||
import TreeSelect from '@/components/treeSelect'
|
||||
import { getTree } from '@/api/base/product/category'
|
||||
|
||||
export default {
|
||||
name: 'ProductList',
|
||||
components: { Edit, Add, excelExeImport },
|
||||
components: { Edit, Add, excelExeImport,TreeSelect },
|
||||
beforeRouteEnter(to, form, next) {
|
||||
next((vm) => vm.queryData())
|
||||
},
|
||||
@ -351,6 +368,13 @@
|
||||
label: this.__('供应商产品'),
|
||||
},
|
||||
],
|
||||
defaultCheckedKeys: [],
|
||||
nodeKey: 'id',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
},
|
||||
productDataList: [], // 产品规格数据
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -369,6 +393,7 @@
|
||||
|
||||
this.params.authorization = getToken()
|
||||
this.fetchData()
|
||||
this.getTree()
|
||||
},
|
||||
methods: {
|
||||
__,
|
||||
@ -390,6 +415,11 @@
|
||||
await this.fetchData()
|
||||
})
|
||||
},
|
||||
async getTree() {
|
||||
const { data } = await getTree()
|
||||
debugger;
|
||||
this.productDataList = data
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
let status = response.status
|
||||
let msg = response.msg
|
||||
@ -525,6 +555,9 @@
|
||||
this.total = data.records
|
||||
this.listLoading = false
|
||||
},
|
||||
change(id) {
|
||||
this.queryForm.category_id = id
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user