|
|
@@ -40,6 +40,13 @@
|
|
|
<el-input type="number" v-model="form.packqty" placeholder="输入装箱数"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="12" v-if="siteid === 'HY'">
|
|
|
+ <el-form-item label="商品大类" prop="tags">
|
|
|
+ <el-select v-model="form.tags" style="width:100%">
|
|
|
+ <el-option v-for="item in tagList" :key="item.index" :value="item.tag" :label="item.tag"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="辅助单位">
|
|
|
<el-checkbox :true-label="1" :false-label="0" v-model="form.isauxunit" @change="isauxunitChange">是否需要辅助单位</el-checkbox>
|
|
|
@@ -365,7 +372,8 @@ export default {
|
|
|
"specalnote": "",
|
|
|
"prodline": "",
|
|
|
"device": "",
|
|
|
- "packqty":'1'
|
|
|
+ "packqty":'1',
|
|
|
+ "tags":''
|
|
|
},
|
|
|
rules:{
|
|
|
itemno: [
|
|
|
@@ -389,6 +397,9 @@ export default {
|
|
|
tradefields: [
|
|
|
{ required: true,message:'请选择领域', trigger:'change'}
|
|
|
],
|
|
|
+ tags: [
|
|
|
+ { required: true,message:'请选择商品大类', trigger:'change'}
|
|
|
+ ],
|
|
|
},
|
|
|
unitGroupData:[],
|
|
|
unitData:[],
|
|
|
@@ -403,7 +414,8 @@ export default {
|
|
|
actuatortype:[], // 执行器类型
|
|
|
actuatorbrand:[],// 执行器品牌
|
|
|
connectionmode:[],// 连接形式
|
|
|
-
|
|
|
+ tagList:[],//商品大类
|
|
|
+ siteid:JSON.parse(sessionStorage.getItem('active_account')).siteid
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
@@ -425,6 +437,7 @@ export default {
|
|
|
this.actuatortypeData()
|
|
|
this.actuatorbrandData()
|
|
|
this.connectionmodeData()
|
|
|
+ this.getTagList()
|
|
|
},
|
|
|
// 查询领域
|
|
|
async fieldData () {
|
|
|
@@ -522,45 +535,57 @@ export default {
|
|
|
ownerid:res.data.itemid,
|
|
|
usetype:'default'
|
|
|
}
|
|
|
- this.$refs['form'].resetFields();
|
|
|
- this.$refs['upload'].toUpload()
|
|
|
- this.$emit('onSuccess')
|
|
|
- this.refresh()
|
|
|
- this.dialogFormVisible = false
|
|
|
- this.$store.dispatch('changeDetailDrawer',true)
|
|
|
- this.$router.push({path:'/productmagDetail',query:{id:res.data.itemid,rowindex:res.data.rowindex}})
|
|
|
+ this.setTag(res.data.itemid,res.data.rowindex)
|
|
|
})
|
|
|
})
|
|
|
|
|
|
},
|
|
|
+ async setTag(id,rowindex){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20220929090901,
|
|
|
+ "content": {
|
|
|
+ "ownertable":"plm_item",
|
|
|
+ "ownerid":id,
|
|
|
+ "datatag":[this.form.tags]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(res.data,'标签设置结果')
|
|
|
+ this.$refs['form'].resetFields();
|
|
|
+ this.$refs['upload'].toUpload()
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ this.refresh()
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.$store.dispatch('changeDetailDrawer',true)
|
|
|
+ this.$router.push({path:'/productmagDetail',query:{id:id,rowindex:rowindex}})
|
|
|
+ },
|
|
|
onCancel(){
|
|
|
this.dialogFormVisible = false
|
|
|
this.$refs['form'].resetFields();
|
|
|
this.form={
|
|
|
"attinfos":[],
|
|
|
- "itemid":0,
|
|
|
- "isauxunit":0,
|
|
|
- "unitid":'',
|
|
|
- "unitgroupid":'',
|
|
|
- "itemno":'',
|
|
|
- "itemname":'',
|
|
|
- "model": "",
|
|
|
- "spec": "",
|
|
|
- "orderminqty": 1, //订单起订量
|
|
|
- "orderaddqty": 1, //订单增量
|
|
|
- "orderminqty_auxunit": 0, //订单起订量控制单位(0:主单位;1:辅助单位)
|
|
|
- "orderaddqty_auxunit": 0, //订单增量控制单位(0:主单位;1:辅助单位
|
|
|
- "remarks": "", //可选
|
|
|
- "barcode": "", //可选
|
|
|
- "skucontrol": 0, //可选
|
|
|
- "batchcontrol": 1, //可选
|
|
|
- "grossweight": '', //可选
|
|
|
- "weight": '', //可选
|
|
|
- "height": '', //可选
|
|
|
- "width": '', //可选
|
|
|
- "length": '', //可选
|
|
|
- "packqty":'1',
|
|
|
-
|
|
|
+ "itemid":0,
|
|
|
+ "isauxunit":0,
|
|
|
+ "unitid":'',
|
|
|
+ "unitgroupid":'',
|
|
|
+ "itemno":'',
|
|
|
+ "itemname":'',
|
|
|
+ "model": "",
|
|
|
+ "spec": "",
|
|
|
+ "orderminqty": 1, //订单起订量
|
|
|
+ "orderaddqty": 1, //订单增量
|
|
|
+ "orderminqty_auxunit": 0, //订单起订量控制单位(0:主单位;1:辅助单位)
|
|
|
+ "orderaddqty_auxunit": 0, //订单增量控制单位(0:主单位;1:辅助单位
|
|
|
+ "remarks": "", //可选
|
|
|
+ "barcode": "", //可选
|
|
|
+ "skucontrol": 0, //可选
|
|
|
+ "batchcontrol": 1, //可选
|
|
|
+ "grossweight": '', //可选
|
|
|
+ "weight": '', //可选
|
|
|
+ "height": '', //可选
|
|
|
+ "width": '', //可选
|
|
|
+ "length": '', //可选
|
|
|
+ "packqty":'1',
|
|
|
+ "tags":''
|
|
|
}
|
|
|
},
|
|
|
unitChange () {
|
|
|
@@ -629,8 +654,34 @@ export default {
|
|
|
},
|
|
|
erpitemnoChange(){
|
|
|
this.form.erpitemno = this.form.erpitemno.replace(/^\s+|\s+$/g,'')
|
|
|
- }
|
|
|
+ },
|
|
|
|
|
|
+ /*获取可选商品大类*/
|
|
|
+ async getTagList () {
|
|
|
+ let res = await this.$api.requested({
|
|
|
+ "id": 20221013104401,
|
|
|
+ "content": {
|
|
|
+ "isExport":1,
|
|
|
+ "pageNumber":1,
|
|
|
+ "pageSize":100,
|
|
|
+ "sys_systemtagid":22,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tagList = res.data
|
|
|
+ },
|
|
|
+ hasDisabledTag (item) {
|
|
|
+ let arr = []
|
|
|
+ let arr2 = []
|
|
|
+ arr = this.tagList.filter(item=>{
|
|
|
+ return this.form.tags.includes(item.tag)
|
|
|
+ })
|
|
|
+ arr.forEach(e=>{
|
|
|
+ arr2 = arr2.concat(e.mutextag)
|
|
|
+ })
|
|
|
+ arr2 = this.form.tags.length === 0?[]:arr2
|
|
|
+ let _isSame = arr2.some(tag=>item.tag === tag)
|
|
|
+ return _isSame
|
|
|
+ },
|
|
|
},
|
|
|
mounted () {
|
|
|
|