将页面的商品名称转拼音改为接口的方式
This commit is contained in:
parent
1173578859
commit
fccfd83c99
@ -12,7 +12,6 @@
|
|||||||
"ant-design-vue": "1.5.2",
|
"ant-design-vue": "1.5.2",
|
||||||
"area-data": "^5.0.6",
|
"area-data": "^5.0.6",
|
||||||
"axios": "^0.18.0",
|
"axios": "^0.18.0",
|
||||||
"chinese-to-pinyin": "^1.0.2",
|
|
||||||
"clipboard": "^2.0.4",
|
"clipboard": "^2.0.4",
|
||||||
"codemirror": "^5.46.0",
|
"codemirror": "^5.46.0",
|
||||||
"dayjs": "^1.8.0",
|
"dayjs": "^1.8.0",
|
||||||
|
|||||||
@ -61,6 +61,7 @@ const getMaterialByBarCode = (params)=>getAction("/material/getMaterialByBarCode
|
|||||||
const getMaxBarCode = (params)=>getAction("/material/getMaxBarCode",params);
|
const getMaxBarCode = (params)=>getAction("/material/getMaxBarCode",params);
|
||||||
const checkMaterialBarCode = (params)=>getAction("/materialsExtend/checkIsBarCodeExist",params);
|
const checkMaterialBarCode = (params)=>getAction("/materialsExtend/checkIsBarCodeExist",params);
|
||||||
const batchUpdateMaterial = (params)=>postAction("/material/batchUpdate",params);
|
const batchUpdateMaterial = (params)=>postAction("/material/batchUpdate",params);
|
||||||
|
const changeNameToPinYin = (params)=>postAction("/material/changeNameToPinYin",params);
|
||||||
//序列号
|
//序列号
|
||||||
const addSerialNumber = (params)=>postAction("/serialNumber/add",params);
|
const addSerialNumber = (params)=>postAction("/serialNumber/add",params);
|
||||||
const editSerialNumber = (params)=>putAction("/serialNumber/update",params);
|
const editSerialNumber = (params)=>putAction("/serialNumber/update",params);
|
||||||
@ -163,6 +164,7 @@ export {
|
|||||||
getMaxBarCode,
|
getMaxBarCode,
|
||||||
checkMaterialBarCode,
|
checkMaterialBarCode,
|
||||||
batchUpdateMaterial,
|
batchUpdateMaterial,
|
||||||
|
changeNameToPinYin,
|
||||||
addSerialNumber,
|
addSerialNumber,
|
||||||
editSerialNumber,
|
editSerialNumber,
|
||||||
checkSerialNumber,
|
checkSerialNumber,
|
||||||
|
|||||||
@ -295,10 +295,9 @@
|
|||||||
import JEditableTable from '@/components/jeecg/JEditableTable'
|
import JEditableTable from '@/components/jeecg/JEditableTable'
|
||||||
import { FormTypes, getRefPromise, VALIDATE_NO_PASSED, validateFormAndTables } from '@/utils/JEditableTableUtil'
|
import { FormTypes, getRefPromise, VALIDATE_NO_PASSED, validateFormAndTables } from '@/utils/JEditableTableUtil'
|
||||||
import { checkMaterial, checkMaterialBarCode, getMaterialAttributeNameList,
|
import { checkMaterial, checkMaterialBarCode, getMaterialAttributeNameList,
|
||||||
getMaterialAttributeValueListById, getMaxBarCode, queryMaterialCategoryTreeList } from '@/api/api'
|
getMaterialAttributeValueListById, getMaxBarCode, queryMaterialCategoryTreeList, changeNameToPinYin } from '@/api/api'
|
||||||
import { removeByVal, autoJumpNextInput, handleIntroJs } from '@/utils/util'
|
import { removeByVal, autoJumpNextInput, handleIntroJs } from '@/utils/util'
|
||||||
import { getAction, httpAction } from '@/api/manage'
|
import { getAction, httpAction } from '@/api/manage'
|
||||||
import Pinyin from 'chinese-to-pinyin'
|
|
||||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||||
import JDate from '@/components/jeecg/JDate'
|
import JDate from '@/components/jeecg/JDate'
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
@ -346,6 +345,7 @@
|
|||||||
manySkuSelected: 0,
|
manySkuSelected: 0,
|
||||||
model: {},
|
model: {},
|
||||||
showOkFlag: true,
|
showOkFlag: true,
|
||||||
|
setTimeFlag: null,
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 8 },
|
sm: { span: 8 },
|
||||||
@ -1109,20 +1109,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleNameChange(e) {
|
handleNameChange(e) {
|
||||||
|
let that = this
|
||||||
if(e.target.value) {
|
if(e.target.value) {
|
||||||
let pyArr = []
|
if(this.setTimeFlag != null){
|
||||||
e.target.value.split("").forEach(w => {
|
clearTimeout(this.setTimeFlag)
|
||||||
w = w.trim()
|
}
|
||||||
if (w) {
|
this.setTimeFlag = setTimeout(()=>{
|
||||||
if (/[\u4e00-\u9fa5]/.test(w)) {
|
changeNameToPinYin({name: e.target.value}).then((res) => {
|
||||||
let py = Pinyin(w, {removeTone: true, keepRest: true}).trim()
|
if (res && res.code === 200) {
|
||||||
pyArr.push(py.substring(0, 1))
|
that.form.setFieldsValue({'mnemonic':res.data})
|
||||||
} else {
|
} else {
|
||||||
pyArr.push(w)
|
that.$message.warning(res.data)
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
},500)
|
||||||
this.form.setFieldsValue({'mnemonic':pyArr.join("")})
|
} else {
|
||||||
|
that.form.setFieldsValue({'mnemonic':''})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onlyUnitOnChange(e) {
|
onlyUnitOnChange(e) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user