Browse Source

Merge remote-tracking branch 'origin/master'

master
wangpengfei 2 years ago
parent
commit
2c16507289
  1. 12
      warehousing-system/project_web_ui-xxs/src/views/classification/classManagementInfo.vue
  2. 162
      warehousing-system/project_web_ui-xxs/src/views/component/initial_value/add/productAdd.vue

12
warehousing-system/project_web_ui-xxs/src/views/classification/classManagementInfo.vue

@ -30,10 +30,10 @@
<td> <td>
<el-input v-model="form.categorys" style="width:100%"></el-input> <el-input v-model="form.categorys" style="width:100%"></el-input>
</td> </td>
<td>类别编码</td> <!-- <td>类别编码</td>
<td> <td>
<el-input v-model="form.category_key" style="width:100%"></el-input> <el-input v-model="form.category_key" oninput="value=value.replace(/[^\d.]/g,'')" maxlength="6" style="width:100%"></el-input>
</td> </td> -->
</tr> </tr>
</table> </table>
@ -92,10 +92,10 @@
<td> <td>
<el-input v-model="form.categorys" style="width:100%"></el-input> <el-input v-model="form.categorys" style="width:100%"></el-input>
</td> </td>
<td>类别编码</td> <!-- <td>类别编码</td>
<td> <td>
<el-input v-model="form.category_key" style="width:100%"></el-input> <el-input v-model="form.category_key" oninput="value=value.replace(/[^\d.]/g,'')" maxlength="6" style="width:100%"></el-input>
</td> </td> -->
</tr> </tr>
</table> </table>

162
warehousing-system/project_web_ui-xxs/src/views/component/initial_value/add/productAdd.vue

@ -28,21 +28,56 @@
<span class="item_text">别名</span> <span class="item_text">别名</span>
<el-input v-model="locationForm.anotherName" class="item_input" clearable></el-input> <el-input v-model="locationForm.anotherName" class="item_input" clearable></el-input>
</div> </div>
<div class="item">
<span class="item_text">编码</span>
<el-input v-model="locationForm.code" :disabled="true" class="item_input" clearable></el-input>
</div>
<div class="item">
<span class="item_text">品牌</span>
<el-select v-model="locationForm.brand" @change="selectBrand" class="item_input" placeholder="请选择">
<el-option v-for="(item,i) in brandList" :key="i" :label="item.dictValue" :value="item.sid">
</el-option>
</el-select>
</div>
<div class="item">
<span class="item_text">一级类别</span>
<el-select v-model="locationForm.categoryY" @change="selectCategoryA" class="item_input" placeholder="请选择">
<el-option v-for="(item,i) in categoryAList" :key="i" :label="item.categorys" :value="item.sid">
</el-option>
</el-select>
</div>
<div class="item">
<span class="item_text">二级类别</span>
<el-select v-model="locationForm.categoryR" @change="selectCategoryB" class="item_input" placeholder="请选择">
<el-option v-for="(item,i) in categoryBList" :key="i" :label="item.categorys" :value="item.sid">
</el-option>
</el-select>
</div>
<div class="item">
<span class="item_text">三级类别</span>
<el-select v-model="locationForm.category" @change="selectCategoryC" class="item_input" placeholder="请选择">
<el-option v-for="(item,i) in categoryCList" :key="i" :label="item.categorys" :value="item.sid">
</el-option>
</el-select>
</div>
<div class="item"> <div class="item">
<span class="item_text">价值</span> <span class="item_text">价值</span>
<el-input v-model="locationForm.value" class="item_input" @input="limitInput1($event)" clearable></el-input> <el-input v-model="locationForm.value" class="item_input" @input="limitInput1($event)" clearable></el-input>
</div> </div>
<div class="item"> <div class="item">
<span class="item_text">净重</span> <span class="item_text">净重</span>
<el-input v-model="locationForm.netWeight" class="item_input" @input="limitInput2($event)" clearable></el-input> <el-input v-model="locationForm.netWeight" class="item_input" @input="limitInput2($event)"
clearable></el-input>
</div> </div>
<div class="item"> <div class="item">
<span class="item_text">毛重</span> <span class="item_text">毛重</span>
<el-input v-model="locationForm.roughWeight" class="item_input" @input="limitInput3($event)" clearable></el-input> <el-input v-model="locationForm.roughWeight" class="item_input" @input="limitInput3($event)"
clearable></el-input>
</div> </div>
<div class="item"> <div class="item">
<span class="item_text">有效天数</span> <span class="item_text">有效天数</span>
<el-input v-model="locationForm.effectiveDays" class="item_input" @input="limitInput4($event)" clearable></el-input> <el-input v-model="locationForm.effectiveDays" class="item_input" @input="limitInput4($event)"
clearable></el-input>
</div> </div>
<div class="item"> <div class="item">
<span class="item_text">备注</span> <span class="item_text">备注</span>
@ -64,19 +99,113 @@
barCode: "", barCode: "",
name: "", name: "",
anotherName: "", anotherName: "",
code: "系统自动排序生成",
value: "", value: "",
netWeight: "", netWeight: "",
roughWeight: "", roughWeight: "",
effectiveDays: "", effectiveDays: "",
remarks: "", remarks: "",
brand:"",
brandSid: "",
categoryY: "",
categorySidY: "",
categoryR: "",
categorySidR: "",
category: "",
categorySid: "",
}, },
viewTitle: "【新增】产品信息", viewTitle: "【新增】产品信息",
brandList: [],
categoryAList: [],
categoryBList: [],
categoryCList: [],
categoryPSid: "1" // sid
} }
}, },
created() { created() {
this.getBrandList()
this.getCategoryList("1")
}, },
methods: { methods: {
async getBrandList() {
const {
data: result
} = await this.$http.post('/v1/restrictedbrand/brandList', '')
if (result.code == 200) {
console.log("getBrandList", result.data)
this.brandList = result.data
}
},
async getCategoryList(type) {
const {
data: result
} = await this.$http.get('/v1/restrictedcategory/categoryListByPsid/' + this.categoryPSid, this.categoryPSid)
if (result.code == 200) {
console.log("getCategoryList", result.data)
if ('1' == type) {
this.categoryAList = result.data
}
if ('2' == type) {
this.categoryBList = result.data
}
if ('3' == type) {
this.categoryCList = result.data
}
// this.brandList = result.data
}
},
selectBrand(value) {
console.log("selectBrand", value)
this.locationForm.brandSid = value
console.log("selectBrand", this.locationForm.brandSid)
},
selectCategoryA(value) {
this.categoryBList = []
this.categoryCList = []
this.locationForm.categoryR = ''
this.locationForm.categorySidR = ''
this.locationForm.category = ''
this.locationForm.categorySid = ''
this.categoryPSid = value
this.locationForm.categoryAsid = value
this.getCategoryList("2")
console.log("categoryPSid", this.categoryPSid)
console.log("selectCategoryA", value)
},
selectCategoryB(value) {
this.categoryCList = []
this.locationForm.category = ''
this.locationForm.categorySid = ''
this.categoryPSid = value
this.locationForm.categoryBsid = value
this.getCategoryList("3")
console.log("categoryPSid", this.categoryPSid)
console.log("selectCategoryB", value)
},
selectCategoryC(value) {
console.log("selectCategoryC", value)
this.locationForm.categorySid = value
},
saveOrUpdate() { saveOrUpdate() {
if (this.viewTitle === "【新增】产品信息") return this.addProduct() if (this.viewTitle === "【新增】产品信息") return this.addProduct()
if (this.viewTitle === "【修改】产品信息") { if (this.viewTitle === "【修改】产品信息") {
@ -101,10 +230,18 @@
name: "", name: "",
anotherName: "", anotherName: "",
value: "", value: "",
code:"系统自动排序生成",
netWeight: "", netWeight: "",
roughWeight: "", roughWeight: "",
effectiveDays: "", effectiveDays: "",
remarks: "", remarks: "",
brandSid: "",
categoryA: "",
categoryAsid: "",
categoryB: "",
categoryBsid: "",
categoryC: "",
categorySid: "",
} }
}, },
showEdit(row) { showEdit(row) {
@ -114,17 +251,21 @@
this.locationForm = row this.locationForm = row
}, },
async updataProduct() { async updataProduct() {
// this.locationForm = {
// name: "", console.log("updataProduct", this.locationForm)
// anotherName: "",
// } const {
const { data: result } = await this.$http.put('/product/updataProduct', this.locationForm) data: result
} = await this.$http.put('/product/updataProduct', this.locationForm)
if (result.status !== 200) return this.$message.error('更新数据失败') if (result.status !== 200) return this.$message.error('更新数据失败')
this.$message.success('更新成功') this.$message.success('更新成功')
this.handleReturn('true') this.handleReturn('true')
}, },
async addProduct() { async addProduct() {
const { data: result } = await this.$http.post('/product/addProduct', this.locationForm) console.log("addProduct", this.locationForm)
const {
data: result
} = await this.$http.post('/product/addProduct', this.locationForm)
if (result.status !== 200) return this.$message.error('添加产品失败') if (result.status !== 200) return this.$message.error('添加产品失败')
this.$message.success('添加产品成功') this.$message.success('添加产品成功')
this.handleReturn('true') this.handleReturn('true')
@ -196,6 +337,7 @@
margin-left: 10px; margin-left: 10px;
margin-right: 80px; margin-right: 80px;
} }
.item_inputs { .item_inputs {
flex: 4; flex: 4;
font-size: 16px; font-size: 16px;

Loading…
Cancel
Save