|
@ -27,7 +27,7 @@ function StuffMgm(props) { |
|
|
region_id: ['0'],//区域 |
|
|
region_id: ['0'],//区域 |
|
|
code: '',//物品编号 |
|
|
code: '',//物品编号 |
|
|
brand_id: '0',//物品类型 |
|
|
brand_id: '0',//物品类型 |
|
|
model_id: '',//物品型号 |
|
|
|
|
|
|
|
|
model_id: '0',//物品型号 |
|
|
operatorid: '0',//商户名称 |
|
|
operatorid: '0',//商户名称 |
|
|
name: '',//物品名称 |
|
|
name: '',//物品名称 |
|
|
status: '3',//状态 |
|
|
status: '3',//状态 |
|
@ -57,12 +57,20 @@ function StuffMgm(props) { |
|
|
const [getBrandId, setGetBrandId] = useState('') |
|
|
const [getBrandId, setGetBrandId] = useState('') |
|
|
const handleOperator = (v) => { |
|
|
const handleOperator = (v) => { |
|
|
setGetBrandId(v) |
|
|
setGetBrandId(v) |
|
|
setFormData({ ...formData, brand_id: v }) |
|
|
|
|
|
|
|
|
setFormData({ ...formData, brand_id: v, model_id: '' }) |
|
|
|
|
|
setGetAssetsModel([]) |
|
|
} |
|
|
} |
|
|
//商户名称 |
|
|
//商户名称 |
|
|
const handleDeployType = (value) => { |
|
|
const handleDeployType = (value) => { |
|
|
setFormData({ ...formData, operatorid: value }) |
|
|
|
|
|
|
|
|
setGetOperatorValue(value) |
|
|
|
|
|
if (value) { |
|
|
|
|
|
setGetOperatorid(false) |
|
|
} |
|
|
} |
|
|
|
|
|
setFormData({ ...formData, operatorid: value, brand_id: '', model_id: '' }) |
|
|
|
|
|
setGetOperationName([]) |
|
|
|
|
|
setGetAssetsModel([]) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//区域 |
|
|
//区域 |
|
|
const [getOption, setGetOption] = useState(['0']) |
|
|
const [getOption, setGetOption] = useState(['0']) |
|
|
const onChangeList = (value, options) => { |
|
|
const onChangeList = (value, options) => { |
|
@ -305,10 +313,7 @@ function StuffMgm(props) { |
|
|
setFormData({ |
|
|
setFormData({ |
|
|
...parameter, |
|
|
...parameter, |
|
|
}) |
|
|
}) |
|
|
setTimeout(()=>{ |
|
|
|
|
|
|
|
|
|
|
|
getData({ ...parameter, pn: 1}) |
|
|
|
|
|
},800) |
|
|
|
|
|
|
|
|
getData({ ...parameter, pn: 1 }, []) |
|
|
} |
|
|
} |
|
|
//检索数据 |
|
|
//检索数据 |
|
|
const getSearchData = (data = formData) => { |
|
|
const getSearchData = (data = formData) => { |
|
@ -366,9 +371,9 @@ function StuffMgm(props) { |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
// 获取列表数据 |
|
|
// 获取列表数据 |
|
|
const getData = (data = formData) => { |
|
|
|
|
|
|
|
|
const getData = (data = formData, region_id = getOption) => { |
|
|
setAjaxLoading(true) |
|
|
setAjaxLoading(true) |
|
|
ajax.assetsList({ ...data,region_id:getOption}).then(res => { |
|
|
|
|
|
|
|
|
ajax.assetsList({ ...data, region_id }).then(res => { |
|
|
setAjaxLoading(false) |
|
|
setAjaxLoading(false) |
|
|
if (res.status === 20000) { |
|
|
if (res.status === 20000) { |
|
|
utils.tableScrollTop() |
|
|
utils.tableScrollTop() |
|
@ -413,9 +418,13 @@ function StuffMgm(props) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [getRecipient, setGetRecipient] = useState([]) |
|
|
const [getRecipient, setGetRecipient] = useState([]) |
|
|
|
|
|
const [getNewRecipient, setNewGetRecipient] = useState([]) |
|
|
const recipientName = () => { |
|
|
const recipientName = () => { |
|
|
ajax.recipient().then(res => { |
|
|
ajax.recipient().then(res => { |
|
|
|
|
|
let arr = res.data |
|
|
|
|
|
let newArr = arr.slice(1) |
|
|
setGetRecipient(res.data) |
|
|
setGetRecipient(res.data) |
|
|
|
|
|
setNewGetRecipient(newArr) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
//添加 |
|
|
//添加 |
|
@ -551,7 +560,7 @@ function StuffMgm(props) { |
|
|
status: '', |
|
|
status: '', |
|
|
uid: '' |
|
|
uid: '' |
|
|
}) |
|
|
}) |
|
|
setGetSelectStatus(false) |
|
|
|
|
|
|
|
|
setGetSelectStatus(true) |
|
|
setGetUid({ |
|
|
setGetUid({ |
|
|
uid: '' |
|
|
uid: '' |
|
|
}) |
|
|
}) |
|
@ -642,6 +651,8 @@ function StuffMgm(props) { |
|
|
// }, []) |
|
|
// }, []) |
|
|
|
|
|
|
|
|
const [getNewOperationName, setNewGetOperationName] = useState([]) |
|
|
const [getNewOperationName, setNewGetOperationName] = useState([]) |
|
|
|
|
|
const [getOperationName, setGetOperationName] = useState([]) |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (getOperatorValue != '') { |
|
|
if (getOperatorValue != '') { |
|
|
let data = { |
|
|
let data = { |
|
@ -696,7 +707,13 @@ function StuffMgm(props) { |
|
|
// sessionStorage.removeItem('stuffMgm') |
|
|
// sessionStorage.removeItem('stuffMgm') |
|
|
// } |
|
|
// } |
|
|
// }, []) |
|
|
// }, []) |
|
|
const [getOperationName, setGetOperationName] = useState([]) |
|
|
|
|
|
|
|
|
const getAssetData=()=>{ |
|
|
|
|
|
ajax.assetsModel().then(res => { |
|
|
|
|
|
let arr = res.data |
|
|
|
|
|
let newArr = arr.slice(1) |
|
|
|
|
|
setGetAssetsModel(res.data) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
const getOperName = () => { |
|
|
const getOperName = () => { |
|
|
ajax.assetsType().then(res => { |
|
|
ajax.assetsType().then(res => { |
|
|
setGetOperationName(res.data) |
|
|
setGetOperationName(res.data) |
|
@ -707,6 +724,7 @@ function StuffMgm(props) { |
|
|
operatorid() |
|
|
operatorid() |
|
|
getOperName() |
|
|
getOperName() |
|
|
merchantDataName() |
|
|
merchantDataName() |
|
|
|
|
|
getAssetData() |
|
|
recipientName() |
|
|
recipientName() |
|
|
getCascaderList() |
|
|
getCascaderList() |
|
|
}, []) |
|
|
}, []) |
|
@ -762,6 +780,7 @@ function StuffMgm(props) { |
|
|
<Select |
|
|
<Select |
|
|
style={{ width: 220 }} |
|
|
style={{ width: 220 }} |
|
|
value={formData.brand_id} |
|
|
value={formData.brand_id} |
|
|
|
|
|
disabled={getOperatorid} |
|
|
options={getOperationName} |
|
|
options={getOperationName} |
|
|
onChange={handleOperator} |
|
|
onChange={handleOperator} |
|
|
/> |
|
|
/> |
|
@ -773,6 +792,7 @@ function StuffMgm(props) { |
|
|
placeholder="请选择" |
|
|
placeholder="请选择" |
|
|
value={formData.model_id} |
|
|
value={formData.model_id} |
|
|
options={getAssetsModel} |
|
|
options={getAssetsModel} |
|
|
|
|
|
disabled={getOperatorid} |
|
|
onChange={handleJobStatus} |
|
|
onChange={handleJobStatus} |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
@ -986,7 +1006,7 @@ function StuffMgm(props) { |
|
|
placeholder="请选择" |
|
|
placeholder="请选择" |
|
|
disabled={getSelectStatus} |
|
|
disabled={getSelectStatus} |
|
|
value={getUid.uid} |
|
|
value={getUid.uid} |
|
|
options={getRecipient} |
|
|
|
|
|
|
|
|
options={getNewRecipient} |
|
|
onChange={handleAddRecipient} |
|
|
onChange={handleAddRecipient} |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
@ -1145,7 +1165,7 @@ function StuffMgm(props) { |
|
|
placeholder="请选择" |
|
|
placeholder="请选择" |
|
|
disabled={getSelectStatus} |
|
|
disabled={getSelectStatus} |
|
|
value={getEditData.uid} |
|
|
value={getEditData.uid} |
|
|
options={getRecipient} |
|
|
|
|
|
|
|
|
options={getNewRecipient} |
|
|
onChange={(v) => { |
|
|
onChange={(v) => { |
|
|
setGetEditData( |
|
|
setGetEditData( |
|
|
Object.assign({}, getEditData, { uid: v }) |
|
|
Object.assign({}, getEditData, { uid: v }) |
|
|